Description:
In my linker script I have a 128-byte mailbox in SRAM at 0x20417F80 (top of RAM, NOLOAD, kept out of the init/zero tables). I use it to pass flags from my application to my bootloader when the application jumps to boot — this data needs to survive for programming flags
To stop the startup ECC-init loop from clearing that mailbox, I edited the RamInit section in startup_cm7.s so the zero loop stops before the mailbox instead of going to __INT_SRAM_END:
RamInit:
ldr r0, =__RAM_INIT
cmp r0, 0
beq SRAM_LOOP_END
ldr r0, =MCRGM_DES
ldr r1, [r0]
ldr r2, =MCRGM_DES_F_POR
and r1, r1, r2
cmp r1, 0
beq NO_INIT_STANDBY_REGION
ldr r1, =__INT_SRAM_START
ldr r2, =__PBL_SBL_MAILBOX_ADDR ; <-- edited (was __INT_SRAM_END)
b ZERO_64B_RAM
NO_INIT_STANDBY_REGION:
ldr r1, =__BSS_SRAM_START
ldr r2, =__PBL_SBL_MAILBOX_ADDR ; <-- edited (was __INT_SRAM_END)
ZERO_64B_RAM:
With this edit, the mailbox retains correctly when the application jumps to the bootloader. for programming /flashing
But after this edit, standby wakeup stops working. My application goes into standby on IGN-low, and it no longer wakes up -the core gets stuck and doesn't resume. at rasr[] 0x2040012e
If I revert RamInit back to the default (loop ending at __INT_SRAM_END), then standby wakeup works fine again, but the mailbox is no longer retained.
So the two are directly linked: the startup edit that retains my mailbox is what breaks my standby wakeup.
My questions:
Attachments: startup_cm7.s(txt) (edited RamInit), PBL linker script (txt) (shows mailbox at 0x20417F80), system.c.
S32DS-ARM S32K312EVB-Q172
Hi @Arif9845,
I can see you've also entered a support ticket; I will answer your questions through there so we can avoid any misunderstandings.
Best regards,
Julián