Ensure code doesn't overflow into the MMU bootloader
Take advantage of __TEXT_REGION_LENGTH__ in the avr5 linker script to preset the effective available space in the flash. This ensures we don't overflow into the bootloader.pull/143/head
parent
b3c53b8a85
commit
1623f315af
|
|
@ -142,6 +142,9 @@ if(CMAKE_CROSSCOMPILING)
|
||||||
add_link_dependency(firmware ${LINKER_SCRIPT})
|
add_link_dependency(firmware ${LINKER_SCRIPT})
|
||||||
#]]
|
#]]
|
||||||
|
|
||||||
|
# limit the text section to 28K (32K - 4k reserved for the bootloader)
|
||||||
|
target_link_options(firmware PUBLIC -Wl,--defsym=__TEXT_REGION_LENGTH__=28K)
|
||||||
|
|
||||||
# generate firmware.bin file
|
# generate firmware.bin file
|
||||||
objcopy(firmware "ihex" ".hex")
|
objcopy(firmware "ihex" ".hex")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue