Move the version information after the ISR vectors

pull/322/head
Alex Voinea 2024-03-11 16:41:48 +01:00 committed by DRracer
parent 3ee1e22e9a
commit 5d0f772270
2 changed files with 6 additions and 11 deletions

View File

@ -167,9 +167,6 @@ if(CMAKE_CROSSCOMPILING)
# limit the text section to 28K (32K - 4k reserved for the bootloader) # limit the text section to 28K (32K - 4k reserved for the bootloader)
target_link_options(firmware PUBLIC -Wl,--defsym=__TEXT_REGION_LENGTH__=28K) target_link_options(firmware PUBLIC -Wl,--defsym=__TEXT_REGION_LENGTH__=28K)
# place the version information at the end of the app flash
target_link_options(firmware PUBLIC -Wl,--defsym=__VERSION_REGION_LENGTH__=6)
# generate firmware .hex file # generate firmware .hex file
objcopy(firmware "ihex" ".hex") objcopy(firmware "ihex" ".hex")

View File

@ -23,7 +23,6 @@ MEMORY
lock (rw!x) : ORIGIN = 0x830000, LENGTH = __LOCK_REGION_LENGTH__ lock (rw!x) : ORIGIN = 0x830000, LENGTH = __LOCK_REGION_LENGTH__
signature (rw!x) : ORIGIN = 0x840000, LENGTH = __SIGNATURE_REGION_LENGTH__ signature (rw!x) : ORIGIN = 0x840000, LENGTH = __SIGNATURE_REGION_LENGTH__
user_signatures (rw!x) : ORIGIN = 0x850000, LENGTH = __USER_SIGNATURE_REGION_LENGTH__ user_signatures (rw!x) : ORIGIN = 0x850000, LENGTH = __USER_SIGNATURE_REGION_LENGTH__
version (r) : ORIGIN = __TEXT_REGION_ORIGIN__ + __TEXT_REGION_LENGTH__ - __VERSION_REGION_LENGTH__, LENGTH = __VERSION_REGION_LENGTH__
} }
SECTIONS SECTIONS
{ {
@ -89,6 +88,12 @@ SECTIONS
{ {
*(.vectors) *(.vectors)
KEEP(*(.vectors)) KEEP(*(.vectors))
/* Version information kept in flash at a fixed address after the vectors */
. = ALIGN(2);
KEEP(*(.version))
. = ALIGN(2);
/* For data that needs to reside in the lower 64k of progmem. */ /* For data that needs to reside in the lower 64k of progmem. */
*(.progmem.gcc*) *(.progmem.gcc*)
/* PR 13812: Placing the trampolines here gives a better chance /* PR 13812: Placing the trampolines here gives a better chance
@ -167,13 +172,6 @@ SECTIONS
KEEP (*(.fini0)) KEEP (*(.fini0))
_etext = . ; _etext = . ;
} > text } > text
/* It is placed in .bootloader so that avr-size correctly includes it in the Program size calculation */
.bootloader :
{
KEEP(*(.version*))
} > version
.data : .data :
{ {
PROVIDE (__data_start = .) ; PROVIDE (__data_start = .) ;