2022-11-05 12:07 PM
2022-12-05 11:11 AM
Hi!,
Thanks for your note. The wake up I am using is from the RTC, using this call:
HAL_RTCEx_SetWakeUpTimer_IT ...
But there was no problem in any of that. I found the issue, going in to STOP it turns out that assert line for my FRAM was still high (it's normal state) so I just set it low and the issue was fixed. I also set the FRAM to deep sleep mode and that further reduced it. Now the current is a few uA, where it should be.
2022-11-05 12:17 PM
Hi Everyone,
A bit of a mystery with low power mode STOP2 on this application. My hardware has no peripherals connected so far as configuration except for debug SWD,SCK, and external LVCMOS RTC clock (5uA current) and 3 GPIO pins. I also have an external HSI at 8MHz. All other pins are set as analog. I have the RTC waking every 30 seconds, it works consistently well in any mode. Current test done with debugger pod unplugged.
When I set STANDBY or SHUTDOWN modes, the current is down to 11uA. Given my external components, including the RTC, this is pretty close.
When I try STOP1 or STOP2 the lowest current is 160uA. In STOP0, it's about 257uA.
Here is the configuration to get to any of the modes:
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 30, RTC_WAKEUPCLOCK_CK_SPRE_16BITS);
HAL_SuspendTick();
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWREx_DisableLowPowerRunMode();
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
I have also tried the LL functions, using these 3 lines from the LL library:
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
LL_LPM_EnableDeepSleep();
__WFI();
And they result in the same amount of current at about 160uA.
I've poured through documents including ST's app note on low power modes but found nothing further. I've also tried various things like shutting off clocks, etc. Very little difference. Since STANDBY and SHUTDOWN appear to work, I can only think there is an issue with STOP1/2 ?
Any suggestions appreciated.
Thanks!
2022-11-05 01:49 PM
https://community.st.com/s/question/0D53W00001nYvGgSAK/mc-sdk-not-work-with-mcu-stop-mode
> external HSI
HSI = High Speed Internal oscillator.
2022-11-05 05:58 PM
Hello,
And thanks for taking the time to post a reply.
The HSI was a typo, should have said HSE - I'm using an external RTC LVCMOS SiTime chip, as it says in the body of the problem description.
I do not see how any of those responses are related to my issue? I have no peripherals, no timers, no IWDG, nothing. It's that simple. I have 4 GPIO pins, that's it. The rest are set to analog.
Setting the device to STANDBY results in around 12uA (as expected due to RTC and a couple pull ups)
But - STOP2 results in about 160uA. I looked through those items in the post related to setting the device up for STOP2, I see nothing more than what I am already doing. Stlll do not see the relationship. Here is the call I am using:
void HAL_PWREx_EnterSTOP2Mode(uint8_t STOPEntry)
{
/* Check the parameter */
assert_param(IS_PWR_STOP_ENTRY(STOPEntry));
/* Set Stop mode 2 */
MODIFY_REG(PWR->CR1, PWR_CR1_LPMS, PWR_CR1_LPMS_STOP2);
/* Set SLEEPDEEP bit of Cortex System Control Register */
SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
/* Select Stop mode entry --------------------------------------------------*/
if(STOPEntry == PWR_STOPENTRY_WFI)
{
/* Request Wait For Interrupt */
__WFI();
}
else
{
/* Request Wait For Event */
__SEV();
__WFE();
__WFE();
}
The RTC is using an interrupt. So what in your posted code is different? I can see nothing, or maybe I missed it. Can you be specific?
Thanks,
Gary
2022-11-05 07:22 PM
Those links show:
And those links show how to do it correctly, not like ST's broken code made by incompetent fools. For example, the link 1 shows how to disable the debugger in software and reminds to also disconnect it physically. I'm not going to repeat everything that's already written just because someone doesn't like reading. If you want to get this working properly, you have to read those topics and fix the code. And, if there still are issues, then ask specific questions.
2022-12-05 06:38 AM
Hello @Rogers.Gary,
From my point of view, even the current consumptions in Standby an Shutdown modes are pretty high.
Correct me if am wrong, the wake up from interrupt is made by the external RTC!
the RTC is clocked by LSE ?
how did u configure the clock tree? RTC? in CubeMx
Also, when entering the Stop2 mode, you need to disactive the RTC wakeup timer : HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
You can check this artcicle on how to configure the RTC to wake up the STM32 periodically from Low Power modes.
Waiting for your replies
Thank you!
Sarra
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.
2022-12-05 11:11 AM
Hi!,
Thanks for your note. The wake up I am using is from the RTC, using this call:
HAL_RTCEx_SetWakeUpTimer_IT ...
But there was no problem in any of that. I found the issue, going in to STOP it turns out that assert line for my FRAM was still high (it's normal state) so I just set it low and the issue was fixed. I also set the FRAM to deep sleep mode and that further reduced it. Now the current is a few uA, where it should be.