Skip to main content
AM.12
Associate III
February 9, 2023
Question

STM32WB55 Low power mode implementation. I am using STM32WB55UG custom board, I am following PWR_STOP1 and PWR_STOP2_RTC examples to put my device in to STOP1 or STOP2 low power modes

  • February 9, 2023
  • 9 replies
  • 2203 views

After following these examples I am unable to put the device in STOP1/2 low power modes.

Can someone please help with implementing low-power modes

This topic has been closed for replies.

9 replies

ST Employee
February 10, 2023

Hello @Community member​ 

Could you precise what is exactly the issue? or errors u get?

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.
AM.12
AM.12Author
Associate III
February 10, 2023

Hi @Sarra.S​

Thank You, 

I followed examples to implement low power modes, if I try to put the device into STOP2 and STOP1 modes the power consumption should be around 2µA as per the datasheet in STOP2.

But it still consuming 10mA in both cases.

I believe it's not entering into low-power mode.

I followed some post also but no improvements

ST Employee
February 10, 2023

Hello again @Community member​ 

I think you missing something in the configuration

Could you share your .ioc file and your main.c so I can check the problem

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.
AM.12
AM.12Author
Associate III
February 10, 2023

Hi,

I have attached both files, I started with a blank project

AM.12
AM.12Author
Associate III
February 13, 2023

Hi @Sarra.S​ ,

Is there anything I am missing in the configuration?

AM.12
AM.12Author
Associate III
March 2, 2023

Hi @Sarra.S​ ,

Now I am able to put the device to sleep mode perfectly.

But when the button pressed device wakes up but Sequencer not working, even after calling SystemClock_Config();  HAL_ResumeTick(); Sequencer not working.

if I remove the sleep code Sequencer works fine.

please can you help me with this problem?

Thank You,

ST Employee
March 2, 2023

Hello @Community member​ 

Here is a list of resources relating to use of the sequencer with the STM32WB55:

STM BLE Tutorial

Building wireless applications with STM32WB Series microcontrollers

STM32WB Bluetooth® Low Energy (BLE) wireless interface

STM32WB – BLE SW Application Architecture

Hope that helps!

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.
AM.12
AM.12Author
Associate III
March 2, 2023

Hi again @Sarra.S​ ,

Yes, I have followed the same steps from the post, I tried giving priority to my tasks from 15. still, I am facing the same issue. I am not understanding the root cause.

//===================My sleep code =======================

while (1)

 {

  /* USER CODE END WHILE */

  MX_APPE_Process();

  /* USER CODE BEGIN 3 */

  if(Go_TO_SLEEP)

  {

   Go_TO_SLEEP = false;

   HAL_GPIO_WritePin(MY_LED_GPIO_Port, MY_LED_Pin,1);

   HAL_Delay(5000);

   HAL_GPIO_WritePin(MY_LED_GPIO_Port, MY_LED_Pin,0);

    GPIO_InitStructure.Pin = GPIO_PIN_All;

    GPIO_InitStructure.Mode = GPIO_MODE_ANALOG;

    GPIO_InitStructure.Pull = GPIO_NOPULL;

//    HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);

//      HAL_GPIO_Init(GPIOB, &GPIO_InitStructure);

    HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);

    HAL_GPIO_Init(GPIOD, &GPIO_InitStructure);

    HAL_GPIO_Init(GPIOE, &GPIO_InitStructure);

    HAL_GPIO_Init(GPIOH, &GPIO_InitStructure);

//    __HAL_RCC_GPIOA_CLK_DISABLE();

//       __HAL_RCC_GPIOB_CLK_DISABLE();

     __HAL_RCC_GPIOC_CLK_DISABLE();

     __HAL_RCC_GPIOD_CLK_DISABLE();

     __HAL_RCC_GPIOE_CLK_DISABLE();

     __HAL_RCC_GPIOH_CLK_DISABLE();

     DBGMCU->CR = 0;

    HAL_SuspendTick();

    LL_C2_PWR_SetPowerMode(LL_PWR_MODE_STOP2);

    HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

  }

 }

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

//===========Button ISR======================================

 void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)

 {

SystemClock_Config();

  HAL_ResumeTick();

  Current_Button = GPIO_Pin;

  ISR_func();

UTIL_SEQ_SetTask(1 << CFG_TASK_ISR_CALLBACK, 15);

 }

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

ABN
Associate III
June 23, 2023

Hello @AM.12 

We are using a custom board which has stm32wb55 as the MCU. Even I followed the example project and replicated the same on to my project. But the current consumption is around 300uA and unable to get around 3uA as per the datasheet. Were you able to solve the issue on your side?  If yes, can you help me as well??

Thanks