8167 views|1 replies

1

Posts

0

Resources
The OP
 

After entering stopmode, stm32L476 will periodically wake up through RTC interrupt. After running once, it cannot enter stopmode anymore. [Copy link]

The effect that rt hopes to achieve is to execute business logic once every 12 hours, and enter sleep mode at other times. Therefore, stopmode+HAL_RTCEx_SetWakeUpTimer_IT is used here to achieve this. Two problems are encountered: (1) It is found that the timer wake-up time setting is greater than 30s, which will not take effect. Setting it to 300s actually only takes about 20s. I don’t know what is going on. Please ask everyone. (2) After waking up from sleep mode, it is impossible to enter sleep mode again. Once it wakes up for the first time, calling the same logic again will not enter sleep mode, and the logic after sleep mode will start again. I would like to ask all the experts for help with the above issues. Thank you very much! void enterStopMode(int seconds){ GPIO_InitTypeDef GPIO_InitStruct; HAL_RTCEx_DeactivateWakeUpTimer(&hrtc); //Turn on RTC timer wakeup. RTC uses external clock 32768, divided by 16. The corresponding parameter for 300 seconds is 300*32768/16 if (HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0x8FFF, RTC_WAKEUPCLOCK_RTCCLK_DIV16) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); SERIAL_PRINTF("set wakeup timer error! %d\r\n",i); } SERIAL_PRINTF("enter stopmode! %d\r\n",i); HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFE); SystemClock_Config();//Recover the clock //SERIAL_PRINTF("stop loop index is %d\r\n",i); } }
This post is from stm32/stm8

Latest reply

If you only wake up once every 12 hours, you might as well use the RTC alarm function WUT, which is suitable for waking up in seconds.  Details Published on 2018-8-27 19:44
 

15

Posts

0

Resources
2
 
If you only wake up once every 12 hours, you might as well use the RTC alarm function WUT, which is suitable for waking up in seconds.
This post is from stm32/stm8
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list