cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble achieving low current in STOP2 mode on STM32WB55CGU6

r3v1
Associate II

Hi everyone,

I'm facing a frustrating issue and would really appreciate any help or insight you could provide.

I’m trying to get the STM32WB55CGU6 into STOP2 mode, but I consistently see current consumption over 600 µA, both on my custom PCB and on the WeActStudio.STM32WB55CoreBoard. I’ve been stuck here for days and can’t make progress with my project because of this.

Here’s what I’ve done so far:

  • Thoroughly studied AN5071 and AN5289.

  • Read several community posts and blogs from users with similar problems.

  • Ported the official examples PWR_STOP2_RTC and PWR_EnterStopMode to my MCU.

  • Verified that the project builds correctly and behaves as expected, except for the power consumption.

Despite following all the steps I could find, the current remains way too high. I would expect it to be in the range of a few microamps.

Here’s a screenshot from my PPK2 measurements:

ppk-20250508T144338.png

 

(I would expect that when LED is off, the STOP2 mode would be much more evident in terms of consumption)


To be extra sure, I followed a careful MWE (Minimal Working Example) generation process for PWR_STOP2_RTC:

  1. Created a fresh CubeIDE project targeting STM32WB55CGU6.

  2. Matched the .ioc settings as closely as possible, including all clock configurations.

  3. Closed CubeIDE.

  4. Manually transferred all relevant source files from the example project, double-checking for compile errors.

  5. Only minor change: I increased the LED-on delay to 5000 ms to make power transitions more visible.

Here is a comparison of both project structures:

Original example:

.
├── EWARM (skip)
├── Inc
│   ├── main.h
│   ├── stm32wbxx_hal_conf.h
│   ├── stm32wbxx_it.h
│   └── stm32wbxx_nucleo_conf.h
├── MDK-ARM (skip)
├── PWR_STOP2_RTC.ioc
├── readme.txt
└── Src
    ├── main.c
    ├── stm32wbxx_hal_msp.c
    ├── stm32wbxx_it.c
    └── system_stm32wbxx.c

My ported project:

.
├── Core
│   ├── Inc
│   │   ├── main.h
│   │   ├── stm32wbxx_hal_conf.h
│   │   └── stm32wbxx_it.h
│   ├── Src
│   │   ├── main.c
│   │   ├── stm32wbxx_hal_msp.c
│   │   ├── stm32wbxx_it.c
│   │   ├── syscalls.c
│   │   ├── sysmem.c
│   │   └── system_stm32wbxx.c
│   └── Startup
│       └── startup_stm32wb55cgux.s
├── Drivers
│   ├── CMSIS
│   │   ├── Device
│   │   │   └── ST
│   │   │       └── STM32WBxx
│   │   │           ├── Include
│   │   │           │   ├── stm32wb55xx.h
│   │   │           │   ├── stm32wbxx.h
│   │   │           │   └── system_stm32wbxx.h
│   │   │           ├── LICENSE.txt
│   │   │           └── Source
│   │   │               └── Templates
│   │   ├── Include
│   │   │   ├── cmsis_armcc.h
│   │   │   ├── ...
│   │   │   └── tz_context.h
│   │   └── LICENSE.txt
│   └── STM32WBxx_HAL_Driver
│       ├── Inc
│       │   ├── Legacy
│       │   │   └── stm32_hal_legacy.h
│       │   ├── ...
│       │   └── stm32wbxx_ll_utils.h
│       ├── LICENSE.txt
│       └── Src
│           ├── stm32wbxx_hal.c
│           ├── ...
│           └── stm32wbxx_ll_rcc.c
├── Makefile
├── PWR_STOP2_RTC.ioc
├── STM32WB55CGUX_FLASH.ld
└── STM32WB55CGUX_RAM.ld

I've attached my full CubeIDE project in case anyone is willing to take a quick look — maybe I’m missing something obvious.

I’m really stuck here, and the power consumption is a blocker for my battery-powered application. I’d be very grateful for any tips, debugging suggestions, or guidance — even the smallest hint could help!

Thank you very much in advance

1 ACCEPTED SOLUTION

Accepted Solutions
r3v1
Associate II

Hi again,

I have continued testing to find the differences between the two codes, and the problem was not the previously accepted solution, but that once the GPIO clocks were enabled, they would not be disabled again with __HAL_RCC_GPIOX_CLK_DISABLE() at any point. 

Just disabling every GPIO CLK just at the end of MX_GPIO_Init and reenable them only when necessary solves the issue:

void MX_GPIO_Init(void)
{

  GPIO_InitTypeDef GPIO_InitStruct = {0};

  /* GPIO Ports Clock Enable */
  __HAL_RCC_GPIOC_CLK_ENABLE();
  __HAL_RCC_GPIOH_CLK_ENABLE();
  __HAL_RCC_GPIOB_CLK_ENABLE();
  __HAL_RCC_GPIOA_CLK_ENABLE();
  __HAL_RCC_GPIOE_CLK_ENABLE();

  /*Configure GPIO pins */
  ...

  // e.g. disable here CLKs to save energy
  __HAL_RCC_GPIOC_CLK_DISABLE();
  __HAL_RCC_GPIOH_CLK_DISABLE();
  __HAL_RCC_GPIOB_CLK_DISABLE();
  __HAL_RCC_GPIOA_CLK_DISABLE();
  __HAL_RCC_GPIOE_CLK_DISABLE();
}

I'm marking this response as the Accepted Solution because examples were OK, my code was not 100% complete.

 

View solution in original post

7 REPLIES 7
FilipKremen
ST Employee

Hello,

can you please try the original examples from WB package? (it should work without any changes)

Also, do you have a Nucleo kit? If so, can you please try it with Nucleo?

Thank you.

 

Best regards,

ST support

Hi,

I tried importing P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC example into CubeIDE directly but it messes up compeltly entire file system creating new directories like Core:

r3v1_0-1747156823259.png

So instead spending time fixing those errors (unresolved dependencies, implicit declarations, undeclared stuff...), I started from scratch. Also, the example is prepared for the RGV6 package and mine is CGU6.

I have not any Nucleo boards, just some custom PCBs and WeAct I mentioned earlier.

 

FilipKremen
ST Employee

Hello,

it should work even though the packages are different. 

Please try to add the file (stm32wbxx_nucleo.h) from STM32Cube\Repository\STM32Cube_FW_WB_V1.22.1\Drivers\BSP\P-NUCLEO-WB55.Nucleo to the project or you can try to download the package again.

 

Best regards,

ST support

r3v1
Associate II

Thanks for the suggestion,

I copied the BSP and works in a newly created PWR_STOP2_RTC project, now I can see the cosumption has been reduced to ~600uA in the WeAct board:

ppk-20250514T101719.png

 

And to ~16uA in my custom board!!

ppk-20250514T104340.png

 

Just to recap, should I avoid the code generated by CubeIDE and go with the BSP? Or what are the main differences between the original Nucleo PWR_STOP2_RTC project code and the one generated by CubeIDE? It seems a bit *** to me to have the same code, but only work with the Nucleo headers and the RGV6 RAM and boot files? could it be that the CGU6 files have some bug?

Hello @r3v1 

The PWR_STOP2_RTC example generated using the STM32CubeIDE it is the same available on the SMT32CubeWB. Just make sure to use the last STM32CubeWB V1.22.1 and the last STM32CubeIDE V1.18.1.

Best Regards.

STTwo-32

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.

r3v1
Associate II

Hi @STTwo-32 ,

I'm using those versions right now, but I see confusing not including stm32wbxx_nucleo.h in the repository example. Maybe I didn't understand CubeIDE globally and the way it manages dependencies because I was compiling everything myself with a Makefile.

Thanks

r3v1
Associate II

Hi again,

I have continued testing to find the differences between the two codes, and the problem was not the previously accepted solution, but that once the GPIO clocks were enabled, they would not be disabled again with __HAL_RCC_GPIOX_CLK_DISABLE() at any point. 

Just disabling every GPIO CLK just at the end of MX_GPIO_Init and reenable them only when necessary solves the issue:

void MX_GPIO_Init(void)
{

  GPIO_InitTypeDef GPIO_InitStruct = {0};

  /* GPIO Ports Clock Enable */
  __HAL_RCC_GPIOC_CLK_ENABLE();
  __HAL_RCC_GPIOH_CLK_ENABLE();
  __HAL_RCC_GPIOB_CLK_ENABLE();
  __HAL_RCC_GPIOA_CLK_ENABLE();
  __HAL_RCC_GPIOE_CLK_ENABLE();

  /*Configure GPIO pins */
  ...

  // e.g. disable here CLKs to save energy
  __HAL_RCC_GPIOC_CLK_DISABLE();
  __HAL_RCC_GPIOH_CLK_DISABLE();
  __HAL_RCC_GPIOB_CLK_DISABLE();
  __HAL_RCC_GPIOA_CLK_DISABLE();
  __HAL_RCC_GPIOE_CLK_DISABLE();
}

I'm marking this response as the Accepted Solution because examples were OK, my code was not 100% complete.