#有奖活动# #申请原创# @21ic小喇叭 @21ic小可爱 @21小跑堂这段时间准备做一个基于stm32C031的低功耗的温湿度采集项目。
【开发板】NUCLEO-C031C6
【开发环境】stm32CubeIDE 1.11.0 13638_20221122_1308 (UTC)
【遇到的问题】
在配置好RTC、PWR后,通过RTC的Alarm事件可以唤醒sleep、stop状态,不能唤醒standby、shutdown模式。
【问题排查】
最起先我查到RTC进入standby、shtudown模式下,HSI、LSI、HSE时钟是停止了的,只能使用LSE来为RTC提供时钟源。开发板上的LSE默认是不能使用的。需要把SB3、SB4短接,去掉R31、R34(见文档UM2953)
- 6.7.1 LSE clock reference
- There are three ways to configure the pins corresponding to the low-speed clock (LSE):
- 1. LSE on-board X2 crystal (Default configuration). Refer to the application note Oscillator design guide for
- STM8AF/AL/S, STM32 MCUs and MPUs (AN2867) for crystal design guide for STM32 microcontrollers.
- 2. Oscillator from external to PC14 input, from external oscillator through pin 25 of the CN7 connector. The
- following configuration is needed:
- – SB3 ON
- – R31 and R32 OFF
- 3. LSE not used. PC14 and PC15 are used as GPIOs instead of low‑speed clocks. The following configuration
- is needed:
- – SB3 and SB4 ON
- – R31 and R32 OFF
我按照文档连接了SB3、SB4,以及把R31、R32去掉之后,LSE是可以正常开启了的。但是进入HAL_PWR_EnterSTANDBYMode或HAL_PWREx_EnterSHUTDOWNMode时,RTC是不是能唤醒的。
【RTC唤醒文档支持】
做项目论证时我是阅读的文档UM3029《Description of STM32C0 HAL and low-layer drivers》,在文档的第274页的文档中,明确的写明了standby、shutdown是可以通过RTC的事件来唤醒的:
【RTC不能唤醒的文档支持】
我在阅读RM0429时,在PWR的文档中确显示不能用RTC来唤醒处于standby以及shutdown模式:
由RTC唤醒只能唤醒处于stop模式:
【疑问】
两篇官方文档在低功耗状态下对唤醒的摸述各不相同,经过实验,RTC目前不能唤醒standby、shutdown。
【需求】
经实验,standby状态下可以实现9uA,shutdown状态下可以实现纳安级的待机。但是不能从RTC唤醒,还是有遗憾的。希望解答一下能否真的从standby、shutdown模式下能用RTC唤醒,那就完美了。
|