cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-L496ZQ-P problem with L4 examples : PWR_STOP1_RTC and PWR_STOP2_RTC

PVall
Associate II

I cannot get PWR_STOP1_RTC nor PWR_STOP2_RTC to wake up as expected using interrupt mode (WFI).

I've tried multiple examples of low power from the L4 examples:

PWR_STANDBY, PWR_STANDBY_RTC, PWR_STOP1, PWR_STOP1_RTC, PWR_STOP2, PWR_STOP2_RTC.

Standby mode works as expected. External interrupts work as expected. But RTC set as WFI does not work. If I modify the wake up to WFE for RTC then it all works fine in either STOP1 or STOP2 but not as the example is written.

I need RTC set as WFI because I have additional external interrupt wake up sources as well.

Thanks for any help,

-Phil

2 REPLIES 2
Imen.D
ST Employee

Hello @Community member​ ,

Try disabling SysTick interrupt before going into stop mode and resuming it after the MCU wake up.

Check this detail according to the reference manual RM0351 (page 178):

All the peripherals which cannot be enabled in Stop 2 mode must be either disabled by clearing the Enable bit in the peripheral itself, or put under reset state by setting the corresponding bit in the AHB1 peripheral reset register (RCC_AHB1RSTR), AHB2 peripheral reset register (RCC_AHB2RSTR), AHB3 peripheral reset register (RCC_AHB3RSTR), APB1 peripheral reset register 1 (RCC_APB1RSTR1), APB1 peripheral reset register 2 (RCC_APB1RSTR2), APB2 peripheral reset register (RCC_APB2RSTR).

Please mark as best by clicking on the "Select as Best" button if it helped 🙂

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hello Imen,

Thank you for responding.

I have tried disabling SysTick and see no difference.

/* Enter STOP 2 mode */

HAL_SuspendTick();

HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

HAL_ResumeTick();

Are you saying additionally I need to explicitly turn off all peripherals vis their RCC_A---RSTR- register?

(Do we know if this example works as currently written?)

And correspondingly shouldn't I need to release all turned off peripherals after wake up?

I am successfully entering STOP2 as the led stops blinking. The problem is the wake up from interrupt when interrupt is RTC.

Thanks,

-Phil