CommunityGD32Cores / ArduinoCore-GD32

Arduino core for GD32 devices, community developed, based on original GigaDevice's core
Other
89 stars 33 forks source link

Use Upload Offset in DFU Upload #42

Open maxgerhardt opened 3 years ago

maxgerhardt commented 3 years ago

The Keyboardio board added in #39 defines one possible upload method for the board as DFU, with an flash_offset of 0x2000.

This is however not respected in the platform.txt DFU upload method. It is respected when building the firmware through relocating the vector table etc. See https://github.com/CommunityGD32Cores/ArduinoCore-GD32/pull/39#discussion_r711299837.

https://github.com/CommunityGD32Cores/ArduinoCore-GD32/blob/30bac5f1cfaccc63c364d8c6c87eb0d1bae91547/platform.txt#L33-L33

https://github.com/CommunityGD32Cores/ArduinoCore-GD32/blob/30bac5f1cfaccc63c364d8c6c87eb0d1bae91547/platform.txt#L110-L112

We need to very / fix the workings of the DFU upload methods in regards to the upload offset.

Linked to PlatformIO board definition (PR https://github.com/CommunityGD32Cores/platform-gd32/pull/15) too, since DFU upload is also done there but without an upload offset (since the board definition file doesn't have one).