Skip to main content
SWenn.1
Senior III
December 15, 2021
Question

stm32wb using SLEEP mode

  • December 15, 2021
  • 1 reply
  • 505 views

I have the following code:

while (1)
 {
	HAL_SuspendTick();
	HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI);

After this and within the while loop are a bunch of if statements that check flags that are set in IRQ Handlers. These handlers exist OUTSIDE the while loop. My CPU1 is running at 16MHz and CPU2 (radio) is running at 32MHz (both using HSE). I see indications that for the above to work I must move the clock to < 2MHz. Can someone tell me how / where to do this? Is there a good app note for this? ....finally only thru watching videos on youtube would I have known to suspend ticks do I need to then restart these?

Thanks

This topic has been closed for replies.

1 reply

Remy ISSALYS
Technical Moderator
April 4, 2022

Hello,

You can look BLE_HeartRate example which using low power mode, available in STM32CubeWB:

https://www.st.com/en/embedded-software/stm32cubewb.html

Best Regards