2016-09-22 11:33 AM
I have the development board for the STM32L073 and have been testing the functionality of the board regarding waking up from STANDBY mode. I have been able to get it to wakeup only use the IWTG funcitonality. I have NOT been able to get it to wakeup from a WKUP pin rising edge or an RTC wakeup event. I believe that I have it configured properly:
- System Wakeup 1 is being used (pin PA0) - RTC Wakeup clock is set to RTCCLK / 16 (using 37k LSI oscillator) --> Wakeup counter set to 11563 (approx. 5 seconds) --> RTC global interrupt enabled Am I missing something in the configuration using CubeMX? Is there some code that I need to write in addition to what is generated? The only code the I have in the USER CODE BEGIN 2 section is the following: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET); HAL_Delay(2000u); HAL_PWR_EnterSTANDBYMode(); So I am expecting the green LED to come on for 2 seconds, off for 3 seconds, and keep repeating, but the green LED just stays off. IOC file attached. #!stm32-!cubemx-!rtcSolved! Go to Solution.
2016-10-03 08:32 AM
--------------!!!!!UPDATE WITH FIX!!!!!------------------
So I think the issue I was having was related to having the RVU and PVU flags set in the IWDG Status Register before going into STANDBY mode. For some reason this was causing issues with waking up from GPIO or RTC. When initializing the IWDG peripheral, these flags remain set until you call the HAL_IWDG_Start() function. In my 'problem' code, I did not call this function before going into STANDBY mode. I can see this problem affecting more than just myself as it is not readily apparent that low-power modes and the IWDG have this contingency in order to wake up from a low power mode.2016-09-23 01:05 AM
Hi howell.conner,
I suggest you to have a look to these examples under the STM32L0 cube firmware package:2016-09-26 01:45 PM
Thanks for the initial help Syrine.
I have done some further debugging into this issue and it seems that something in the generated code for the MX_IWDG_Init(); function is causing issues with the RTC waking up from Standby mode. When this piece of code is commented out, the RTC wakeup function works as expected. Any thoughts as to why initializing the IWDG peripheral would cause this issue?2016-09-27 07:20 AM
It also looks like the MX_IWDG_Init() function blocks System Wake-up 1 from working properly as well. As long as the IWDG peripheral is initialized, both the RTC Wake-up and GPIO Wake-up functionalities do not work properly in getting the system from going from STANDBY mode to RUN mode.
2016-10-03 08:32 AM
--------------!!!!!UPDATE WITH FIX!!!!!------------------
So I think the issue I was having was related to having the RVU and PVU flags set in the IWDG Status Register before going into STANDBY mode. For some reason this was causing issues with waking up from GPIO or RTC. When initializing the IWDG peripheral, these flags remain set until you call the HAL_IWDG_Start() function. In my 'problem' code, I did not call this function before going into STANDBY mode. I can see this problem affecting more than just myself as it is not readily apparent that low-power modes and the IWDG have this contingency in order to wake up from a low power mode.