2025-06-20
4:41 AM
- last edited on
2025-08-05
6:52 AM
by
Maxime_MARCHETT
Hi everyone,
I'm stuck on the transition from my low-power mode versus my power consumption.
I already have a “sleep.c” code that is capable of putting the device to sleep at 2uA power consumption (which is my goal, everything's fine here).
This code exits the low-power mode on RTC alarm.
I now wanted to introduce another piece of “run.c” code.
“run.c” and “sleep.c” can switch to each other via a soft reset (this logic works fine).
But when I run “run.c” once and switch to “sleep.c”, my current consumption in STANDBY is now ~4mA.
My clocks in RUN: HSI16MHz, LSI32kHz, PLL64MHz, SYS=PLL64MHz
My clocks in SLEEP: HSI16MHz, LSI32kHz, SYS=HSI16MHz
After some research, I noticed that if I align all configurations to HSI16MHz, LSI32kHz, PLL64MHz, SYS=PLL64MHz, I still have a current consumption of ~4mA.
But if I align all configurations to HSI16MHz, LSI32kHz, SYS=HSI16MHz, then I reach my goal of ~2uA.
I would like to use the PLL anyway in RUN and not in SLEEP for project reasons.
It seems that the PLL is always being used by something, but I expected that after a soft reset, most clocks would be reset (maybe not?).
Does anyone know what I'm doing wrong?
I attach my two clocks configurations.
2025-08-15 8:52 AM
Dear @Nadreoh ,
"But when I run “run.c” once and switch to “sleep.c”, my current consumption in STANDBY is now ~4mA."
I assume in this sentence here STANDBY means "SLEEP" mode as in Sleep mode, all clocks are Enable including the PLL if already set to get the 64MHz or 56MHz. in this mode only the CPU/Cortex-M0 is in halt mode and waiting an IRQ to fire to start executing a code. Such value of current seems normal, instead you can use STOP mode where we reach few uA. Upon exit from STOP, to configure again the PLL and set clocks right RUN mode with peripherals.
Let us know if you are able to fix the behavior.
Ciao
STOne-32.
2025-08-18 1:23 AM - edited 2025-08-18 1:26 AM
Hi @STOne-32 ,
I apologize for the confusion. Please replace all my "sleep" term by "low-power".
When I wrote STANDBY, I explicitly spoke about the STANDBY mode. This is why I am confused because in that mode, I expected all the power sources to be off except for the WDT and the RTC...
I did not investigate much more about the STOP mode because they seemed out of scope for my project purpose (looks like the STANDBY is able to reach the lowest current consumption, am I wrong?).
From RM0454, I am trying to reach this STANDBY mode (which is working if I am only using my "sleep.c" file and reaches the target of ~2uA. Not working anymore if I first execute the piece of code "run.c" before "sleep.c"):