diff --git a/example/boot2/boot2.ld b/example/boot2/boot2.ld index 27a688a..b1cce04 100644 --- a/example/boot2/boot2.ld +++ b/example/boot2/boot2.ld @@ -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)); } diff --git a/example/boot2/boot2_pre.S b/example/boot2/boot2_pre.S index f9a6f98..a1cb425 100644 --- a/example/boot2/boot2_pre.S +++ b/example/boot2/boot2_pre.S @@ -12,7 +12,5 @@ boot2_pre: bl boot2_copy_self bl main b . - .word 0x11223344 - .word 0xabcdef58 .size .boot2_pre, .-boot2_pre