Why does BLE stop advertising when STM32WB enters low power mode (STOP2)?
Hello,
I am trying to configure a custom board with STM32WB5MMG in STOP2 low power mode. For that, the program calls the PWR_ExitStopMode() function when a timer reaches 10 seconds and exits when EXTI0 interrupts by calling PWR_ExitStopMode().
The MCU goes into and exits from STOP2 mode correctly, but I need the board remain connectable even when the MCU is in low power mode; however, BLE stops advertising when the board is in STOP2 mode.
If the connection has been established before the board goes into stop mode, then BLE works fine until a disconnection occurs, then I have the same problem.
I also tried using sleep mode and got the same results.
Code:
__weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if(GPIO_Pin == BTN_Pin)
{
PWR_ExitSleepMode();
//SystemClock_Config();
HAL_TIM_Base_Start_IT(&htim2);
printf("WAKE UP FROM EXTI\r\n");
}
}
in main:
if(timer_1s>=10)
{
PWR_EnterStopMode();
printf("GOING INTO STOP2 MODE\r\n");
}
What I'm missing?
Thanks in advance!
