CommunityGD32Cores / platform-gd32

PlatformIO platform for ARM-based GD32{F,E,L,W} chips. Work in Progress!
67 stars 28 forks source link

Check upload_offset address for Keyboardio board, adapt Python code or board definition as needed #16

Open maxgerhardt opened 3 years ago

maxgerhardt commented 3 years ago

Depends on https://github.com/CommunityGD32Cores/ArduinoCore-GD32/issues/42 to first verify how it can work in the Arduino IDE.

For DFU uploads, the Arduino IDE board definition uses an offset of 0x2000, however, the PlatformIO board definition doesn't have that. It would try to overwrite its own bootloader.

On the other side, when we add the upload.offset_address attribute in the board info, this will also apply for the ST-Link upload. This may be wanted, and thus the flashed firmware will have the bootloader executing before the firmware. This may be wanted, we just need to figure out what we want.

DFU upload should work in all cases though if the DFU bootlaoder is present. For that we at least need the offset.