sdk: 2.5.1
cpu: nrf5340
I have a bootloader which have a big ram block for upgrade purpose (around 250kb) in bss section (I will move it in noinit, but it is not the point here).
I have an app, that poweroff unused ram with VMC register.
Sometimes, the app will enter in poweroff (using REGULATORS register), and will be awakened by vbus or nfc.
When the cpu is awakened, the bss section and idle stacks are in a part of the ram that is powered off, and this is a unrecoverable crash.
I found a solution with powering ram at early startup, but I would like to check with you if it is correct.
The solution may also be about powering up ram before entering poweroff, but I would like may bootloader to be robust.
I wrapped the method z_arm_reset (with linker argument --wrap), and wrote this method:
I checked the generated code, and no stack seem to be used:
Waiting for your answer.
Regards,