2389010_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2389010_en-US

2389010_en-US

S32K312 standby wakeup stops working after editing RamInit in startup_cm7.s to retain part of sram

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:

  1. Why does editing the RamInit region (changing where the SRAM zero loop stops) break standby wakeup? What in the standby/wakeup resume path depends on the startup RAM-init behavior?
  2. What is the correct way to modify startup so I can keep my mailbox region preserved across the application-to-bootloader jump, without breaking standby wakeup?
  3. Would switching to a different RTD version (e.g. RTD 2.0.0 or RTD 4.0.0) change this startup/wakeup behavior and resolve it, or is this independent of RTD version?

Attachments: startup_cm7.s(txt) (edited RamInit), PBL linker script (txt) (shows mailbox at 0x20417F80), system.c. 

 S32DS-ARM     S32K312EVB-Q172    

Debugging | Flash ProgrammingSDKsRe: S32K312 standby wakeup stops working after editing RamInit in startup_cm7.s to retain part of s

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

Tags (1)
No ratings
Version history
Last update:
Thursday
Updated by: