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

In moment of power of the board I receive the WKAP interrupt... Ony in turn power off moment...

@AlexandrX​ "Unsolder Winbond, and 4-8uA, supply Flash separately and 956uA."

Sorry, not quite clear what you mean by that?

With just the STM32 chip alone - no Winbond - you get 4-8uA ?

So the STM32 itself is actually going into low-power correctly, and your problem is something to do with the Winbond?

"supply Flash separately and 956uA."

I don't understand that bit - may be easier to describe with a diagram.

Maybe you you have problems with floating lines, leakage, back-feeding, or the like.

You need to be careful to put IO lines into appropriate states...

Change wake-up priority from 5 to 0 and it's works without STOP mode. In stop mode wake-up IT not works...

How do you observe whether wakeup works or not?

Toggle a pin in the ISR and observe it using oscilloscope/LA. If it toggles, wakeup worked, and you have some other problem.

JW

At the moment it is known:

1. WKUP IT works in normal mode (IT priority 0)

2. WKUP IT works in SLEEP mode (IT priority 0)

3. WKUP IT NOT works in STOP mode (IT priority 0)

4. Try to enter in stanby mode leads to immediate reboot...

No need toggle pin, terminal shows data...

Why SLEEP mode WKAP IT works, but in STOP NOT works, ideas?

Solved:

// wait for TIM6 (HAL timebase) complite current IT (if pending)
while (0 != TIM6->SR) { }
// clear WU flag
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
// Go to stop mode
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);

But without works correctly in SLEEP mode...