Skip to main content
EC.3
Associate III
September 11, 2023
Question

How to shorten wakeup time from STOP mode

  • September 11, 2023
  • 2 replies
  • 4660 views

Hello,

Is there any specific guidance regarding how to improve wakeup time from the various STOP modes? The U5 Reference Manual mentions that configuring STOPWUCK = 0 will use the MSIS up to 24 MHz, which would be faster than HSI16. I've used that already but am wondering if there is anything else.

I notice that when running inside the debugger STOP0 wakeup times improve by roughly 100-150us. I'm targeting 100us. Presumably that has something to do with how the DBGMCU is configured. So the MCU seems capable of waking up faster in this modified STOP0, although with lesser power savings. Still, power savings using STOP0 from within the debugger is substantially better than SLEEP outside of the debugger (meaning normal device operation). Are there other options to shorten the time, outside of DBGMCU configuration?

Thanks

This topic has been closed for replies.

2 replies

Issamos
Lead III
September 11, 2023

Hello @EC.3 

I suggest you to disable all unnecessary peripheral before entering stop1 mode. Also, is better to reduce to the maximum the lines of code.

Best regards.

II

MikaelM
ST Employee
September 11, 2023

Hello @EC.3 

I recommend you to look at the datasheet of your device here you can find the u585 data information. If you go to chapter 5.3.7 Wake-up time from low-power modes and voltage scaling transition times 

you will find the data corresponding to twu wake up time :

MikaelM_0-1694453885733.png

So 100µs can be reach in stop 0.

note: consumption in stop0 with "debugger" is not the consumption of U5, please report as well to datasheet to know the target you can achieve according to IPs enabled.

Best regards,

Mikael

here the web site of all U5 documentation : https://www.st.com/en/microcontrollers-microprocessors/stm32u5-series/documentation.html

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.

If you feel a post has answered your question, please click Accept as Solution.
EC.3
EC.3Author
Associate III
September 11, 2023

Thanks for the reference to that table, @MikaelM . After looking at the listed conditions, I tried adding these lines of code:

LL_PWR_EnableFastSoftStart();
LL_PWR_EnableFlashFastWakeUp();
LL_PWR_EnableSRAM4FastWakeUp();

I used these lines 2 different ways: 1. before calling HAL_PWR_EnterSTOPMode() or 2. after it returns. Either which way, the wakeup time actually increased by about 50us. I also tried combining this with HAL_ICACHE_Disable() with similar results.

Is there a working example somewhere? If I hack it using LL_DBGMCU_EnableDBGStopMode() the time decreases by roughly 100us, which at least is going in the right direction although it's still not close to the times listed in the table.

MikaelM
ST Employee
September 12, 2023

Hello @EC.3 

You can look at the example in to Repository\STM32Cube_FW_U5_V1.3.0\Projects\NUCLEO-U575ZI-Q\Examples_LL\PWR\PWR_EnterStopMode\STM32CubeIDE

to enter stop mode 0 with LL driver.

Then you can add a simple button gpio to exit from stop mode 0 and do your time measurement (i.e. twu).

Be careful with your debugger :  this is not a "real" stop mode; prefer to do the measure outside the debugger (disconnect it), to do real measure don't use "hack" with LL_DBGMCU_EnableDBGStopMode().

Be careful in your measure, twu is the delay needed to go from a stop mode 0 state to a run mode state. It is not the delay between entering stop mode 0 and exiting stop mode 0.

One method consist in measuring power consumption (you can use a power shield board for example : https://www.st.com/en/evaluation-tools/x-nucleo-lpm01a.html 

or an stlink V3 power :https://www.st.com/en/development-tools/stlink-v3pwr.html

then you can have a good measure.

And if you just have an oscilloscope I recommend to do the following :

1/one probe on your wake up signal (gpio preferred)

2/program one gpio as ALTERNATE 15 to have access EVENTOUT signal (second probe here)

MikaelM_0-1694511023109.png

3/if you use WFE => then the first instruction executed after is SEV ==> you will have the time twu between your 2 oscilloscope probes.

4/If you use WFI => you can toggle a gpio in your ISR (but some delays added)

5/ or do the following :

disable all irq

WFI()

enable irq

==> the SEV will be executed just after the WFI

I recommend you to also have a look at : https://wiki.st.com/stm32mcu/wiki/Getting_started_with_PWR

best regards

Mikael

If you feel a post has answered your question, please click Accept as Solution.