Skip to main content
VJani.11
Associate
September 28, 2022
Solved

STM32wb55 - SHUTDOWN MODE / STANDBY MODE wake up with SYSWKUP pin

  • September 28, 2022
  • 3 replies
  • 7271 views

Hi,

I am currently using stm32wb 55 and I want to achive the shutdown/standby mode with WKUP pin functionality, I tried Several ways but it seems its not working, also there is not any example for the same,Below code is for your reference ....

 BSP_LED_Init(LED2);

 BSP_LED_Init(LED3);

 SystemClock_Config();

 WkupPin1_Config();

 if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)

 {

  __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);

 }

 HAL_Delay(5000);

 BSP_LED_DeInit(LED2);

 BSP_LED_DeInit(LED3);

 /* Enable WakeUp Pin PWR_WAKEUP_PIN1 connected to PA0 */

 HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1_LOW);

 /* Clear all related wakeup flags*/

 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF1);

 /* Enter the Standby mode */

 HAL_PWR_EnterSTANDBYMode();

======================================

/* USER CODE BEGIN 4 */

static void WkupPin1_Config(void)

{

 /* Configure Button pin and unmask Wakeup with Interrupt request from line 0.*/

 BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);

 /* Enable wake-up pin pull-up state in Standby mode.*/

 HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_A, PWR_GPIO_BIT_0);

 HAL_PWREx_EnablePullUpPullDownConfig();

}

Best answer by Remy ISSALYS

Hello,

Issue fixed in STM32WB-BLE-standby example available on STM32 HotSpot Github.

Best Regards

3 replies

Remy ISSALYS
Technical Moderator
October 7, 2022

Hello,

An example of WKUP pin functionality to wake up the system from standby will be available soon on STM32 Hotspot GitHub with a dedicated wiki page.

Maybe you can try with this code:

BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
 
SystemClock_Config();
 
WkupPin1_Config();
 
if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)
{
 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
}
 
HAL_Delay(5000);
 
BSP_LED_DeInit(LED2);
BSP_LED_DeInit(LED3);
 
/* Disable all used wakeup sources */
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1_LOW);
 
/* Clear all wake up Flag */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF1);
 
/* Enable pull up on wakeup pin PA0 */
HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_A, PWR_GPIO_BIT_0);
	
 /* Enable pull-up and pull-down configuration for CPU1 */
HAL_PWREx_EnablePullUpPullDownConfig();
 
/* Enable WakeUp Pin PWR_WAKEUP_PIN1 connected to PA0 */
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1_LOW);
 
/* Clear all related wakeup flags*/
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF1);
 
/* Enter the Standby mode */
HAL_PWR_EnterSTANDBYMode();
 
======================================
/* USER CODE BEGIN 4 */
static void WkupPin1_Config(void)
{
 /* Configure Button pin and unmask Wakeup with Interrupt request from line 0.*/
 BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
 /* Enable wake-up pin pull-up state in Standby mode.*/
 HAL_PWREx_DisableGPIOPullUp(PWR_GPIO_A, PWR_GPIO_BIT_0);
 HAL_PWREx_EnablePullUpPullDownConfig();
}
 
 

Best Regards

Remy ISSALYS
Technical Moderator
October 17, 2022

Hello,

A new example is available on STM32 HotSpot Github STM32WB-BLE-standby which allow to wake up the system from standby from wake-up pin.

Best Regards

VJani.11
VJani.11Author
Associate
October 17, 2022

Hi Remy,

Thanks for the reply,

I have downloaded the project and loaded it as it is in P-Nucleo Board, It's advertising the ble, I am also able to discover and connect it through the ST Ble sensor app, furthormore its also able to connect and led blue is also operating as it is expected. When I disconnect the ble its going to Standby mode.....

Now.....

when I am trying to wake it up through the WKUP5 pin (PC5) by grounded it , its not able to wake-up the system.

one more obervation is LED2 is continously flickering when I upload BLE P2P Server Example (It's happning since past couple of days). Is there any anything wrong ???

Thanks in advance

Remy ISSALYS
Remy ISSALYSBest answer
Technical Moderator
November 7, 2022

Hello,

Issue fixed in STM32WB-BLE-standby example available on STM32 HotSpot Github.

Best Regards