[feat] add envionment variables start address in ld script

This commit is contained in:
zhji 2025-04-19 22:05:50 +08:00
parent ec54eb19e3
commit 3d9c45ea54
2 changed files with 10 additions and 4 deletions

View File

@ -27,8 +27,12 @@ SECTIONS
KEEP(*boot2_pre.*(.text.boot2_pre))
KEEP(*(.text.boot2_pre))
_boot2_pre_size = . - ADDR(.boot2_pre);
ASSERT(_boot2_pre_size <= 252, "Error: .boot2_pre size exceeds 252 bytes!");
. += 256 - _boot2_pre_size;
ASSERT(_boot2_pre_size <= 240, "Error: .boot2_pre size exceeds 240 bytes!");
. += 240 - _boot2_pre_size;
LONG(_env_start) /* envionment variables start address */
LONG(0)
LONG(0)
LONG(0) /* MPEG2 of CRC32 */
} >AUTO AT > FLASH :boot2_pre
.text :
@ -63,4 +67,8 @@ SECTIONS
. = ALIGN(4);
_bss_end = .;
} >RAM :bss
_env_start = ADDR(.bss);
_env_start = ALIGN(4K);
_env_start = _env_start - (ORIGIN(RAM) - ORIGIN(FLASH));
}

View File

@ -12,7 +12,5 @@ boot2_pre:
bl boot2_copy_self
bl main
b .
.word 0x11223344
.word 0xabcdef58
.size .boot2_pre, .-boot2_pre