cancel
Showing results for 
Search instead for 
Did you mean: 

RTC Wake-Up from Stop3 on STM32U545RE

TNaum
Associate II

I would like to use the Stop3 low-power mode on an STM32U545RE (NUCLEO-U545RE-Q board) and to wake-up the device by the RTC. I have a working example for Stop2 mode for which I largely used the inspiration from the stm32u5 workshop. But when I replace the HAL_PWREx_EnterSTOP2Mode call(s) with HAL_PWREx_EnterSTOP3Mode, the device does not wake up from the stop mode anymore. At least the current consumption drops down to 3uA so I am confident that the Stop3 mode itself is working.

The code parts of my main function which I believe are relevant look as follows:

HAL_Init();
SystemClock_Config();
SystemPower_Config();

MX_GPIO_Init();
MX_ICACHE_Init();
MX_RTC_Init();

/* The SMPS regulator supplies the Vcore Power Domains */
HAL_PWREx_ConfigSupply(PWR_SMPS_SUPPLY);

/* Enable ultra low power mode */
HAL_PWREx_EnableUltraLowPowerMode();

/* Enable the Autonomous Mode for the RTC Stop0/1/2 */
__HAL_RCC_RTCAPB_CLKAM_ENABLE();

/* Set RTC wakeup timer for 2s */
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 2, RTC_WAKEUPCLOCK_CK_SPRE_16BITS, 0);

/* Enter in Stop 3 mode */
HAL_PWREx_EnterSTOP3Mode(PWR_STOPENTRY_WFI);

 

Is there anything missing to make the RTC (interrupt) work in Stop3 mode? In the reference manual, I found that the RTC should be able to run and to wake up the CPU from Stop3 mode but I guess some configuration is missing here. Thanks in advanve for any helpful advice.

15 REPLIES 15

Hello @TNaum 

 

Your issue has been reported internally. We will come back to you as soon as possible. 

Internal ticket number: 189257 (This is an internal tracking number and is not accessible or usable by customers)

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

Thanks
Omar

Hello @TNaum,

I have ported an example for STM32U545RE "Stop 3 mode with RTC Timer wake-up". The applicative part is functional (Go to Stop 3 and wake-up with RTC Timer, check the IRQHandler when interrupt occurs).

But as you mentioned, the current remains at 3µA after wake-up, which is not expected. We have reported this issue internally.

You can find the example in the attached Zip folder.


I hope this helps !

Hi,

if your current stays at 3uA, how can you be sure that the wake up works?

Additionally, I see that you call HAL_NVIC_SystemReset() after wake-up. Wouldn't this restart the whole program so that you would go to stop3 mode over and over again?

Best regards

I have monitored the CDSTOP signal to verify if the system enters Stop 3 mode. It operates as expected: when the core enters Stop 3 mode, the "CDSTOP is set", and when the core wakes up, the "CDSTOP is cleared".

Haifa_BEN_HSOUNA_0-1724420980741.png

Haifa_BEN_HSOUNA_1-1724421077821.png

Regarding HAL_NVIC_SystemReset(), it is used to reset the application, allowing us to observe the system repeatedly entering Stop 3 mode. You can remove this function if needed.

 

So CDSTOP gets cleared but the current stays at 3uA? That behaviour is pretty weird.

Regarding HAL_NVIC_SystemReset: If you reset the whole system immediately after wake-up, and if you go to stop3 mode immediately after application start, the MCU will nearly always be in stop3 mode, because it immediately goes to stop3 mode again after waking up. Effectively, the system reset causes your application to go to stop3 mode in a loop. Like this, observing a difference in the current consumption is difficult.

Haifa_BEN_HSOUNA
ST Employee

Exactly, but even after removing this function from my code, the behavior remains unchanged (same current value).