Skip to main content
WBian.1
Associate
December 14, 2022
Question

STM32G070: How to wakeup from STOP1 using RTC? Any example? Does anybody can help me, please?

  • December 14, 2022
  • 4 replies
  • 3513 views

Hi all,

I'm trying to periodically wakeup from STOP1 using RTC, but it is not working...

 SystemClock_Decrease();
 
 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF);
 
 /* De-init LED4 */
 BSP_LED_DeInit(LED4);
 
 HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 5, RTC_WAKEUPCLOCK_CK_SPRE_16BITS);
 
 /* Suspend Tick increment to prevent wakeup by Systick interrupt. */
 /* Otherwise the Systick interrupt will wake up the device within 1ms */
 /* (HAL time base). */
 HAL_SuspendTick();
 
 /* Enter Sleep Mode, wake up is done once User push-button is pressed */
 HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI);

This topic has been closed for replies.

4 replies

Technical Moderator
December 14, 2022

Hello @WBian.1​ and welcome to the Community :)

I advise you to review the PWR examples available within STM32CubeG0 MCU package.

How to configure the RTC to wake up the STM32 periodically from Low Power modes

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Piranha
Principal III
December 15, 2022

Of course, the code in that article and all of the ST examples showing how to enter Stop modes for all series are broken. The following topic explains how to do it correctly:

https://community.st.com/s/question/0D53W00001nYvGgSAK/mc-sdk-not-work-with-mcu-stop-mode

Post edited by moderation team for it to adhere to community guidelines.

WBian.1
WBian.1Author
Associate
December 15, 2022

Hi Imen,

Thanks for your promptly reply. I don't know if you **** a read in my code (the attached one), but this was made using the link you sent...This is the reason I asked for support...it never wakes up through RTC, just using the button on NUCLEO's board....

As Piranha said, it is broken....it have to be a way to do it...the datasheet says it is possible, but it is not working at all.

Could you please sugest me something tested and working code?

WBian.1
WBian.1Author
Associate
December 15, 2022

Piranha, I'll try your sugestion, tks.

WBian.1
WBian.1Author
Associate
December 15, 2022

Piranha, unfortunately your suggestion just say how to enter in stop mode....this is working to me. The problem is the G070 can't wakeup using RTC....do you have any idea on how to fix this?

Piranha
Principal III
December 22, 2022

Read that link carefully - ST's code also seems to work, but it actually is broken.

Regarding wake-up by RTC, this could be related:

https://community.st.com/s/question/0D53W00000NY28FSAT/clearing-the-rtc-wutf-saving-your-sanity-by-sharing-my-hard-lesson-learned-

WBian.1
WBian.1Author
Associate
December 22, 2022

Thank you for replying me! I just started to read that link...and this makes a lot of sense to me.