Summary
Using the latest linux build tools (arm-none-eabi-gcc (15:14.2.rel1-1) 14.2.1 20241119) and following the build instructions in the README produces a dfu_wifi.hex that is 17,017 bytes of code, exceeding the 16 KB (0x4000) bootloader region assumed by ArduinoCore-renesas. When a sketch is subsequently uploaded, the application's flash erase wipes the tail end of the bootloader, permanently bricking it. For comparison, the dfu_wifi.hex shipped in the directory, is 15,400 bytes.
Observed output
text data bss dec hex filename
17017 0 19092 36109 8d0d _build/uno_r4/arduino-renesas-bootloader.elf
The resulting hex covers 0x00000000..0x00004279 in code flash, overflowing the 16 KB region by 633 bytes (0x279). It also emits records at 0x01010000 (OFS / option-setting memory), which the shipped bootloader does not.
Expected output
A text size under 16384 bytes, comparable to the shipped dfu_wifi.hex (15,400 bytes), with no records outside the 16 KB code region.
Suggestions
- Manually downgrading to tooling version 10.3 (
gcc-arm-none-eabi-10.3-2021.10) reduces the size to the expected levels.
- A post-build size assertion on each Makefile that fails if
text > 16384 would catch such errors
- Document if you manually strip the OFS region (
0x01010000+) emitted by the linker script, or create the .hex out of the .bin which would produce the clean .hexs I see in the prebuilt section (arm-none-eabi-objcopy -I binary -O ihex --change-addresses=0x00000000 arduino-renesas-bootloader.bin arduino-renesas-bootloader-clean.hex)
Summary
Using the latest linux build tools (
arm-none-eabi-gcc (15:14.2.rel1-1) 14.2.1 20241119) and following the build instructions in the README produces adfu_wifi.hexthat is 17,017 bytes of code, exceeding the 16 KB (0x4000) bootloader region assumed by ArduinoCore-renesas. When a sketch is subsequently uploaded, the application's flash erase wipes the tail end of the bootloader, permanently bricking it. For comparison, thedfu_wifi.hexshipped in the directory, is 15,400 bytes.Observed output
The resulting hex covers
0x00000000..0x00004279in code flash, overflowing the 16 KB region by 633 bytes (0x279). It also emits records at0x01010000(OFS / option-setting memory), which the shipped bootloader does not.Expected output
A
textsize under 16384 bytes, comparable to the shippeddfu_wifi.hex(15,400 bytes), with no records outside the 16 KB code region.Suggestions
gcc-arm-none-eabi-10.3-2021.10) reduces the size to the expected levels.text > 16384would catch such errors0x01010000+) emitted by the linker script, or create the.hexout of the.binwhich would produce the clean.hexs I see in the prebuilt section (arm-none-eabi-objcopy -I binary -O ihex --change-addresses=0x00000000 arduino-renesas-bootloader.bin arduino-renesas-bootloader-clean.hex)