devanlai / dapboot

DFU Bootloader for STM32 chips
Other
331 stars 111 forks source link

Fix build for high memory targets #51

Closed twelho closed 1 year ago

twelho commented 1 year ago

The bootloader doesn't fit into the advertised 6.5 kB anymore, resulting in linker errors for all high-memory targets:

/usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: dapboot.elf section `.text' will not fit in region `rom'
/usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: region `rom' overflowed by 276 bytes

Increase the reserved high-memory area from 0x1A00 to 0x1C00 (7 KiB), with 236 bytes to spare.

devanlai commented 1 year ago

Thanks for spotting this and fixing it!

dmsc commented 1 year ago

Hi!

I don´t like this, as it makes the bootloader bigger for everyone. The compilation problem is because the user is not using the proper compiler.

Using the old GCC 9, the bootloader compiles to 6564 bytes, and using the current "arm-gnu-toolchain-12.2.rel1" release, the size is only 6252 bytes.

I suspect it should be documented to use a newer (>8) compiler.

Have Fun!