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.
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.