mcci-catena / Catena-Arduino-Platform

Arduino platform library for MCCI Catena IoT Systems

Repository from Github https://github.commcci-catena/Catena-Arduino-PlatformRepository from Github https://github.commcci-catena/Catena-Arduino-Platform

CatenaStm32L0Rtc::SleepForAlarm() calls __HAL_PWR_CLEAR_FLAG w/o clocking

terrillmoore opened this issue · comments

CatenaStm32L0Rtc::SleepForAlarm() calls __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU), but doesn't ensure that the clock to the PWR register is turned on. In fact, by default, it's off. This makes this call useless. There is a new API in future BSPs, but testing indicates that this API is not needed -- the system still sleeps.

E.g.

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnterSTOPMode(

Solution: remove calls.