-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
Describe the bug
When suspend to ram feature is enabled cortex-m not all the registers
are re-initialized (or restored).
In my specific case I am using a nucleo_stm32wba55cg platform.
So a cortx-m33 architecture.
Without these reinitializations and according specific cortex-m related configurations enabled,
we can face hard fault/usage faults.
I have simply used or redefined specific kernel functions at power.c level for my specific soc, such as:
z_arm_floating_point_init
z_arm_exc_setup
z_arm_fault_init
z_arm_clear_faults
z_arm_configure_static_mpu_regions
inside pm_s2ram.S we clearly have all is strictly required for cpu regs and special regs.
To Reproduce
My pm configuration is the following:
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_PM_DEVICE_SYSTEM_MANAGED=y
CONFIG_PM_S2RAM=y
Indeed we should enable and use features not properly reconfigured after a wake up form stdby
Expected behavior
suspend to ram should work independently from enabled cortex-m features
Impact
Suspend to RAM is not completely transparent from an application point of view
Logs and console output
Environment (please complete the following information):
- windows
- 0.16.5-1
- 4.1
Additional context
Thanks,
@asm5878