cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L151CBT6A MCU, Enter stop mode have biggest power consumption - above 960uA, but datasheet is ~2..10uA ? And MCU not wake up from STOP by RTC WKUP

AlexandrX
Associate III

Code of main cycle:

// Some "works"...
ipf("Works 5 sec\n\r");
HAL_Delay(5000);
 
// Prepare...
ipf("Power save STOP mode 5 sec\n\r");
double CounterVal = 5000 * 2.3125;
if (HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, (uint32_t)CounterVal, RTC_WAKEUPCLOCK_RTCCLK_DIV16) != HAL_OK)
{
	Error_Handler();
}
HAL_SuspendTick();
 
// Enter STOP
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
 
// Exit, reconfig clocks & resume tick timer
SystemClock_Config();
HAL_ResumeTick();

LSI used by 37.0 KHz.

1. After HAL_PWR_EnterSTOPMode CPU goes to STOP, but POWER consumption ~960uA, why??

2. Why MCU not wakeup from RTC WKUP? Interrupt does not works...

15 REPLIES 15

If you have debugger connected, the processor core continues to run, consuming power, see DBGMCU_CR.

For wakeup, make sure you follow all these steps:

0693W00000NpvQZQAZ.pngi.e. read out and check all relevant RTC and EXTI registers content.

JW

If debugger connected power 960uA, after disconnect debugger - 810uA, bot not 2..10uA

RTC wake-up EXTI line 20 is Enabled.

RTC CR->WUTIE setted

RTC CR->WUTE setted

But not works...

And RTC Wake-up configured time to to wake-up by HAL_RTCEx_SetWakeUpTimer_IT

Do you have peripherals still active?

Are you sure that's all coming from the STM32 chip?

What else is on your board?

AlexandrX
Associate III

SPI Flash Winbond W25Q127 onboard, and its all..

so what current is that drawing?

AlexandrX
Associate III

Unsolder Winbond, and 4-8uA, supply Flash separately and 956uA...

> If debugger connected power 960uA, after disconnect debugger - 810uA, bot not 2..10uA

Did you power-reset after disconnecting debugger?

> And RTC Wake-up configured time to to wake-up by HAL_RTCEx_SetWakeUpTimer_IT

It's irrelevant that you've used some "library" function - since you've used it, it's part of your code thus your responsibility. Cube/HAL is open source so you can look at it, and you can check the registers content it changes.

Does the wakeup interrupt work without going to sleep?

JW

I now check this...

Interesting, I set, for example 5 sec for WKUP, 5 sec power consumption is 4.5uA, after 5 sec some thing happens and current up to 145uA, but MCU not wake-up. If set 10 sec, then 10 sec 4.5uA and after 145uA, but, MCU not wake up...

Without STOP WKAP still not works. REGs cheked all OK :(, ideas?