cancel
Showing results for 
Search instead for 
Did you mean: 

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

VJani.11
Associate

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();

}

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

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

Best Regards

View solution in original post

8 REPLIES 8
Remy ISSALYS
ST Employee

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
ST Employee

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

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

Hello,

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

Best Regards

The functions PWR_EnterOffMode(), PWR_EnterStopMode() and PWR_EnterSleepMode() still can have potential issues, which are described in my article, to which I gave a link in the other post.

A question about the PWR_ExitOffMode() function. As Standby/Shutdown modes cannot be exited without a reset, is this function implemented because the other CPU core or radio can block entering those modes?

This example will be of great help!

Nonetheless, opening the project in CubeIde it shows an ioc file that isn't in the repository...

Hello,

Indeed, the link to .ioc file will be remove, thanks for your feedback.

Best Regards