Skip to content

Uno R4 WiFi bootloader built w/ latest GCC corrupted on first sketch upload due to >16 kB size #538

@lookfwd

Description

@lookfwd

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

  1. Manually downgrading to tooling version 10.3 (gcc-arm-none-eabi-10.3-2021.10) reduces the size to the expected levels.
  2. A post-build size assertion on each Makefile that fails if text > 16384 would catch such errors
  3. 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)

Metadata

Metadata

Assignees

Labels

topic: documentationRelated to documentation for the projecttype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions