Menu

#99 Regression: Application not get booted for GD32V

none
closed
nobody
gd32v (1)
2020-11-15
2020-11-14
No

The following commit broke ability to boot into the application after downloading for GD32V (GD32VF103) .
https://sourceforge.net/p/dfu-util/dfu-util/ci/87df198c72d7ed6dea4b11a67ab1a447c485a305/

When used with -s 0x08000000:leave it is expected to reboot and run the user application.
Without SET_ADDRESS it will reboot into the bootloader again. Because bootloader code is being remapped on to the region starting at address 0x00000000 .

Discussion

  • Tormod Volden

    Tormod Volden - 2020-11-14

    Thanks for the report. This is following a download, so there have been SET_ADDRESS requests, but the last one probably pointing to the start of the last sector being written. I guess this is the problem. So if the LEAVE request makes it jump to this address, it causes a crash or overrun and it restarts from 0x00000000, still being remapped to ROM (bootloader) if the boot pins are configured that way.

    The ST documentation AN3156 says:

    The address pointer has to be set (using the Set Address Pointer command) before
    launching the Leave DFU routine, otherwise, the bootloader will jump to the default address
    (internal Flash memory start address: 0x08000000).

    So from that I assume if nothing has been downloaded, it would still work fine.

    But I guess this applies if there has been a download:

    If the address pointer points to an address that does not contain executable code, then the
    device is reset and, depending on the state of the boot pins, may re-enter the bootloader
    mode.

    We probably need to SET_ADDRESS the start address, if we have been programming other pages.

    Can you please try the attached patch?

     
  • Tormod Volden

    Tormod Volden - 2020-11-14
    • status: open --> closed
     
  • Tormod Volden

    Tormod Volden - 2020-11-14

    I have pushed this to git master now, so you can get it from there. Please test both download, upload, or just -s :leave and reopen the ticket if there still is an issue.

     
  • Ein Terakawa

    Ein Terakawa - 2020-11-15

    Thanks! it's fixed now.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB