Skip to main content
Jtron.11
Senior
November 26, 2025
Solved

STM32WBA52 Standby Mode Example

  • November 26, 2025
  • 6 replies
  • 424 views

Hello all,

Anyone successfully implemented the Standby Mode for STM32WBA52/55?  I am struggling going thru the examples and I wouldn't be able to enter the standby mode level.  My board still consume about 70mA when I enter the standby mode.  From the datasheet, it should be under 1uA with SRAM.

Thank you.

Best answer by grohmano

Hello @Jtron.11,

yes, I tried your example code STM32WBA52_PWR_STANDBY_RTC.zip and measured 2,5 uA when using CubeIDE

 

Speaking of the SMPS, the HAL_PWREx_ConfigSupply function has to possible arguments, in your case, you want to use PWR_LDO_SUPPLY

/**
 * @brief Configure the system Power Supply.
 * @param SupplySource : Specifies the Power Supply source.
 * This parameter can be one of the following values :
 * @arg PWR_LDO_SUPPLY : The LDO regulator supplies the Vcore Power Domains.
 * @arg PWR_SMPS_SUPPLY : The SMPS regulator supplies the Vcore Power Domains.
 * @retval HAL status.
 */
HAL_StatusTypeDef HAL_PWREx_ConfigSupply(uint32_t SupplySource)

 

The migrating itself is not described in any AN, but I have never met some major issues. The most important thing you need to pay more attention is that some peripherals may be on different pins of the MCU

6 replies

ST Employee
November 27, 2025

Hello @Jtron.11,

that is really weird. Can you give me your code or something, so I can look at it?

 

Else, you can find some useful on Wiki:

Getting_started_with_PWR 
STM32CubeWBA_Low_Power_Management 

 

If you have any further questions, please do not hesitate to ask

Best Regards

Jtron.11
Jtron.11Author
Senior
November 28, 2025

Hello grohmano,

I started with RTC working go to sleep and wake up blink LED, the power consumption still 66mA after enter standby.

I back track and start the basic project, by just  blink LED at power up, set up the clocks, and went to standby right after; pure simple to make sure my board is actually in Standby mode to see if I can achive 1uA but it still take 55mA.  Before I went deep sleep, I make sure there is no Interrupt pending, if there is I will clear it.

Here is the code snippet 

 /* MCU Configuration--------------------------------------------------------*/

 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
 HAL_Init();

 /* USER CODE BEGIN Init */

 /* USER CODE END Init */

 /* Configure the system clock */
 SystemClock_Config();

 /* USER CODE BEGIN SysInit */

 /* USER CODE END SysInit */

 /* Initialize all configured peripherals */
 MX_GPIO_Init();
 MX_ICACHE_Init();
 /* USER CODE BEGIN 2 */
 /** Blink the LED **/
 for (int i=0; i<20; i++)
 {
	 HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_4);
	 HAL_Delay(200);
 }

 LL_PWR_ClearFlag_STOP();
 LL_PWR_ClearFlag_SB();

 /* As default User push-button (SW1) state is high level, need to clear all wake up Flag again */
 LL_PWR_ClearFlag_WU();


 for (int i = 0; i < (sizeof(NVIC->ISPR) / sizeof(NVIC->ISPR[0])); i++) {
 if (NVIC->ISPR[i] != 0) {
 any_interrupt_pending = NVIC->ISPR[i];
 break;
 }
 }

 if (any_interrupt_pending) {
 // At least one interrupt is pending
 // You may want to clear them all, or handle them individually
	 HAL_NVIC_ClearPendingIRQ(any_interrupt_pending);
 }

 /* Finally enter the standby mode */
 HAL_PWR_EnterSTANDBYMode();

I also attached the whole project. 

ST Employee
December 1, 2025

Hello @Jtron.11,

I have built your project and flash to the STM32WBA52. Before entering standby mode, I have measured current consumption 6 mA and 2 uA after entering. 

Maybe you have some issues with the board as I also tried to measure the current when the ST-Link is not turned off and the consumption was about 2 mA.

 

I am also confused about the intended purpose. You mentioned you wanted to go to standby, wakeup and blink the LED. Instead of that, you blink the LED 10 times and then you fall asleep and nothing else happens.

If your intention was the first option, I would recommend you using sequencer and timer with interrupt.

 

If you have any further questions, please do not hesitate to ask

Best Regards

Jtron.11
Jtron.11Author
Senior
December 1, 2025

Hi @grohmano ,

Thank you for your helps to confirm my code.  The intention was having the firmware to enter and wake up, but I couldn't confirm the level of the power consumption so I remove everything just enter the standby right away, nothing else fancy to see what exactly the base line; hence I sent you the power up, blink led then go back to standby only.

Whenever I measure, I always remove the ST-Link debugger to prevent another power consumption item.

I have another project attached here.  Can you please help me to run on your board?  I am successfully implemented the RTC to wake up the system every ~33s and stay on for 5s.  It is exactly the example for STM32WBA55.

The weird thing is when the system is awake for 5s, the measure is ~20mA and when the system is in standby the system consumed about ~50mA.

 

ST Employee
December 3, 2025

Hello @Jtron.11,

I have successfully flashed your code and measured the same consumption as before. I am using the Nucleo-STM32WBA52CG board, which is not recommended for new design, but I do not have any other WBA52 to use. 

I assume that you have some custom board. Do you measure power consumption of the whole board or only micro? When measuring the whole board, it is possible that some parts are active, e.g. LDO, external memory, etc.

 

If you want Nucleo board for development and testing, you can use Nucleo STM32WBA55 without SMPS and then port it to your board, it should work same. However, SMPS is generally better in terms of power consumption, so if you want ultra-low power project, the WBA55 should be better (but slightly more expensive) option for you

 

Jtron.11
Jtron.11Author
Senior
December 3, 2025

Hi @grohmano ,

Thank you for your confirmation,  I will get the Nucleo-STM32WBA52CG board for my testing confirmation.  I understand the NRND, but since we are having a size and pricing restriction due to a very high volume once the product is going to mass production and once the product is successfully implement and the STM32WBA52KG is still active so I want to move forward with WBA52KG.

May I confirm with you that you actually test my example code STM32WBA52_PWR_STANDBY_RTC.zip with Nucleo-STM32WBA52CG board and you found at the standby time you see the power consumption is 2uA?

When I measure on my own board, it is only MCU itself.

Since you mentioned porting without SMPS, can you please help me to point me to the app note or any example to port the BLE code from WBA55 to WBA52?

In the BLE example for WBA55, I stuck at this configured SMPS_SUPPLY since WBA52 doesn't have one.

I have 32KHz for LSE and 32MHz for HSE on my board.

void SystemClock_Config(void)
{
 RCC_OscInitTypeDef RCC_OscInitStruct = {0};
 RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

 /** Supply configuration update enable
 */
 HAL_PWREx_ConfigSupply(PWR_SMPS_SUPPLY);

 /** Configure the main internal regulator output voltage
 */
 if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE2) != HAL_OK)
 {
 Error_Handler();
 }

 

 
grohmanoBest answer
ST Employee
December 3, 2025

Hello @Jtron.11,

yes, I tried your example code STM32WBA52_PWR_STANDBY_RTC.zip and measured 2,5 uA when using CubeIDE

 

Speaking of the SMPS, the HAL_PWREx_ConfigSupply function has to possible arguments, in your case, you want to use PWR_LDO_SUPPLY

/**
 * @brief Configure the system Power Supply.
 * @param SupplySource : Specifies the Power Supply source.
 * This parameter can be one of the following values :
 * @arg PWR_LDO_SUPPLY : The LDO regulator supplies the Vcore Power Domains.
 * @arg PWR_SMPS_SUPPLY : The SMPS regulator supplies the Vcore Power Domains.
 * @retval HAL status.
 */
HAL_StatusTypeDef HAL_PWREx_ConfigSupply(uint32_t SupplySource)

 

The migrating itself is not described in any AN, but I have never met some major issues. The most important thing you need to pay more attention is that some peripherals may be on different pins of the MCU

Jtron.11
Jtron.11Author
Senior
December 3, 2025

Hi @grohmano ,

Can you please help to confirm in  your set up how do you provide power to your MCU and how did you measure the current either from external PS or using the onboard PS, which method "Current measurement with an ammeter" or "Current measurement with an external power supply" from UM3103 document?

2. My example STM32WBA52_PWR_STANDBY_RTC is ported from WBA v 1.8.0 and CubeMX V6.16 for my board, and when I try to buy the NUCLEO-WBA52CG, I saw the note this board is only supported by CubeWBA version up to v1.1.0 and CubeMX v6.9.2.

You don't see any problem for your board when you ran my example code?

ST Employee
December 8, 2025

Hello @Jtron.11,

so, from the beginning:

1) I use X-NUCLEO-LPM01A and STM32CubeMonitor-Power for the consumption measurement. You can also use STLINK-V3PWR or any other measuring method. The results should be the same.

2) Yes, even CubeWBA 1.8. works on WBA52CG and on the KG version will certainly work too. 

3) With the Sequencer_gpio_toggle_lowpower example, there is a problem that LPTIM does not work in standby mode, but you can modify it to RTC as the wakeup source. For that you can use the STANDBY_RTC example (modified project attached with measured consumption)

 

However, the very basic sequencer examples are not able to show you the best the sequencer can do. For using the sequencer optimally, I would recommend you some example application from the CubeWBA projects. Choose the one that fits best your intended functionality and build it on top of that. With that you can achieve the lowest power consumption and the least effort. If you could share your intended functionality, I would be able to recommend you some example project and give you few advice on how to progress further.

 

Best Regards

Jtron.11
Jtron.11Author
Senior
December 8, 2025

Hi @grohmano ,

My final goal is an BLE Heart Rate application that will be able to enter standby mode and wake up to send data through BLE every minute.

The first priority is still standby mode implementation.

I have been using BLE Heart Rate and twist here and there but I couldn't make the standby mode working at all starting from BLE Heart Rate example.

I have been trying to play with the #define from the example but the application will never enter standby mode.

Please advice which examples should I have started.

ST Employee
January 5, 2026

Hello @Jtron.11

Thank you for your patience, and apologies for the delayed response as I was out of the office.

As you can find in the errata sheet, there are two revisions of STM32WBA5xxx - older rev A and up to date rev B. Rev A, which is assembled on the Nucleo-WBA52 (NRND), is supported by only by older STM32Cube_FW_WBA packages. You should not be able to obtain rev A samples for your mass production - it is recommended to use rev B of STM32WBA5xxx and up to date drivers/middleware for your development.

Regarding your inquiry, you have a few options to proceed:

1) You may start by flashing the WBA55 1.8.0 Heart Rate example into your custom board. Please remember to use the LDO regulator instead of the SMPS. Afterward, you can share the results or any observations and logs you encounter. 

2) Alternatively, you can use the Nucleo-WBA55 board to develop the project initially and then port the solution to your custom board.

3) If you prefer, you can also open a case through our Online Support Center where you could find more personalized help.

Regarding your note about the HR example 1.1.0 working without standby mode, this is because standby mode was not yet implemented at that time. The first and last fully functional HR example with standby compatible with the Nucleo-WBA52 board, without requiring any modifications, is version 1.2.0.

Please let me know if you need any further clarification or assistance.

Best regards,