cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB Correct approach for low power using BLE sequencer

MichalPesko
Associate III

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!

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @MichalPesko and welcome to the ST Community :smiling_face_with_smiling_eyes:.

If you are looking for the best management for your ble project using an STM32WB MCU, you have to use the sequencer to manage all the tasks of the project. The best example on that as you said is the BLE heart rate example.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
STTwo-32
ST Employee

Hello @MichalPesko and welcome to the ST Community :smiling_face_with_smiling_eyes:.

If you are looking for the best management for your ble project using an STM32WB MCU, you have to use the sequencer to manage all the tasks of the project. The best example on that as you said is the BLE heart rate example.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.