cancel
Showing results for 
Search instead for 
Did you mean: 

High Current Consumption in STOP1 Mode on STM32WB – Despite Peripheral Shutdown

Marco99
Visitor

Hi everyone,
I’m working with the NUCLEO - WB15CC board and I’m trying to enter STOP1 mode to minimize current consumption. However, despite disabling all unnecessary peripherals, the power consumption remains unexpectedly high (much higher than in the PWR_STOP1 example provided by STM32Cube, which works fine on the same board).

What I’ve tried so far:

  • Called HAL_SuspendTick() before entering STOP mode and HAL_ResumeTick() after wakeup

  • Called hci_reset() to reset the BLE stack

  • Configured all GPIOs as analog with no pull (using GPIO_AllAnalog())

  • Disabled clocks for all unused peripherals:

     __HAL_RCC_IPCC_CLK_DISABLE();
    __HAL_RCC_HSEM_CLK_DISABLE();
    __HAL_RCC_ADC_CLK_DISABLE();
    __HAL_RCC_LPTIM1_CLK_DISABLE();
    __HAL_RCC_LPTIM2_CLK_DISABLE();
    __HAL_RCC_TIM1_CLK_DISABLE();
    __HAL_RCC_TIM2_CLK_DISABLE();
  • Disabled all interrupts using __disable_irq() and cleared pending IRQs (RTC, IPCC, etc.)
  • Set both cores (CPU1 and CPU2) to STOP1 using:
    • LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
      LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
      LL_LPM_EnableDeepSleep();
      __WFI();

Despite all of this, I’m still seeing much higher current than expected. Strangely, if I flash the official PWR_STOP1 example from STM32Cube, it works perfectly and the consumption is very low (100 uA).

Also if I set LL_PWR_MODE_STANDBY the consuption is low indeed, but it is ok for me stop mode that should be around 100-200 uA. However using an amperometer I reach 3mA...

My question:

What could be preventing STOP1 mode from reducing the current properly in my application, even though all peripherals and interrupts seem to be handled correctly? Are there hidden wake-up sources or configuration steps I might be missing?

Any insights would be highly appreciated!

9 REPLIES 9
Andrew Neil
Super User

Welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results; in particular:

  • What board are you using? If a custom board, show schematics.
A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Yes sorry,  I updated the post

When measuring consumption, you need to

  • Ensure ST-Link is disconnected
  • Do a power cycle (not just a reset) after using the debugger
A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

I have disconnected the ST-Link, which I noticed contributes only for about 500uA, so does not justify the high consuption. What do you mean for power cycle?


@Marco99 wrote:

 What do you mean for power cycle?


Turn the power off, and then back on again.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

I've already tried that...Moreover in the example that I tried it works fine from the first download of the code.

I think it may be related to the not completely switch off of the BLE, but I did this and doesnt work either.

 

aci_gap_set_non_discoverable();
	HAL_Delay(100);
	hci_reset();
	HAL_Delay(100);
	HAL_SuspendTick();
	LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
	LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1); // Or LL_PWR_MODE_STOP1 or LL_PWR_MODE_STOP0
	SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));

		// Enter Stop mode
		__WFI();
	HAL_ResumeTick();

Doing the same thing in a project without ble works fine...


@Marco99 wrote:

 in the example that I tried it works fine from the first download of the code..


So step through that example using the debugger, and note the current after each step;

Then do the same with your code - and see where it differs.

(Of course, using the debugger will affect the figures - but the effect should be the same in both cases)

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Sorry but I don't get how can help me with my issue... The code where I enter in stop mode is the same and also the preparation, the only difference is that I have enabled BLE in my code

So look into that, then.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.