RTC alarm / wakeup from Stop mode, STM32L4
Posted: Fri Jan 04, 2019 7:40 pm
Hello!
I am experiencing issues with waking up from the STOP MODE on STM32L476 with ChibiOS 18.2 and ChibiOS HAL. I would like to use RTC and an IMU (interrupt on a pin) to wake up the MCU from the STOP 2 Mode.
The general procedure seems to be:
- initialize the RTC, set the time if it's not available
- enable the RTC interrupt
- set up RTC Alarm/Wakeup
- go to the stop mode
We have already written the code for going to sleep and waking up using the IMU and it is working fine. However, we have troubles with enabling the interrupt of the RTC, and configuring the RTC Alarm/Wakeup.
I have read in other threads recommendations to use EXT driver to enable the RTC interrupt. However, ChibiOS 18.2. replaces the EXT driver with PAL driver and I have hard times finding the right function to enable it. Could you please help me?
Is it sufficient to set the Alarm using rtcSetAlarm() function?
Thank you very much!
I am experiencing issues with waking up from the STOP MODE on STM32L476 with ChibiOS 18.2 and ChibiOS HAL. I would like to use RTC and an IMU (interrupt on a pin) to wake up the MCU from the STOP 2 Mode.
The general procedure seems to be:
- initialize the RTC, set the time if it's not available
- enable the RTC interrupt
- set up RTC Alarm/Wakeup
- go to the stop mode
We have already written the code for going to sleep and waking up using the IMU and it is working fine. However, we have troubles with enabling the interrupt of the RTC, and configuring the RTC Alarm/Wakeup.
I have read in other threads recommendations to use EXT driver to enable the RTC interrupt. However, ChibiOS 18.2. replaces the EXT driver with PAL driver and I have hard times finding the right function to enable it. Could you please help me?
Is it sufficient to set the Alarm using rtcSetAlarm() function?
Thank you very much!