STM32WB Correct approach for low power using BLE sequencer
Hello,
I am developing a custom BLE app on a custom STM32WB55CEU6 board.
I need it to periodically (every x seconds) wake up from stop2 mode, read FIFO of a sensor, process the data, go back to stop2 (CPU2 is advertising in the meantime). When a user connects via phone app, the processed data will be sent.
I am not finished yet, but right now, my main() while loop looks something like this (pseudocode):
while() {
readSensor();
processData();
MX_APPE_Process();
}Forcing CPU1 into stop2 two the way it is implemented in the PWR_STOP2_RTC ( HAL_RTCEx_SetWakeUpTimer_IT(...) and HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI) in the main while loop) seems to break the LPM, probably bacause WPAN itself requires RTC internal wakeup.
So the question is, is registering and then managing (setting,...) the readSensor() and processData() functions in the sequencer as tasks a good approach to achieve lower power (?), since the sequencer then manages the power states autonomously if the LPM is enabled in app_conf.h (I assume). For periodical wakeup, a timer server could be used. The Heart Rate example seems to be managed completely by sequencer as tasks (please correct me if I am wrong).
I am not aware of any other (better) way to achieve lowest power so far, as there are no similar posts I feel.
Thanks so much!
