2024-06-17 11:13 PM
i am using STM32C011F6P6 and try to enter stop mode by
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
LL_LPM_EnableDeepSleep();
__WFE();
the current is little bit more than not entering the shutdown mode
and the clock is not stopping
is there any thing I should do first?
and i want to monitor the adc input for wake from sleep mode
is that possible?
i search for some example on web, most of them are using __WFI and use GPIO or TIMER to wake up
i think it maybe possible on __WFE? but i can't find much example on web
Solved! Go to Solution.
2024-06-20 02:22 AM
Hello again @uveuvenouve,
To enter shutdown mode, you can follow this sequence
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN;
LL_LPM_EnableDeepSleep();
LL_PWR_ClearFlag_WU(); //clear any pending wake-up flags that might inadvertently wake up the MCU immediately after entering shutdown mode
__WFI(); // In shutdown mode, the __WFE(); instruction is typically not used because most peripherals, including the event system, are powered down.
You can use either the __WFE(); or __WFI(); instruction to enter sleep mode
the note "Unchanged" in Sleep mode means that the peripheral retains its state or configuration and continues to operate as it did before entering Sleep mode so it is possible to use it.
You can find low-layer power examples here: STM32CubeC0/Projects/STM32C0116-DK/Examples_LL/PWR at main · STMicroelectronics/STM32CubeC0 · GitHub
Unfortunately, there is no ready-to-use example using ADC, you'll need to configure it, but you can always ask separate questions while doing it!
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.
2024-06-18 12:43 AM
Hello @uveuvenouve,
Waking up from shutdown mode using ADC events is not typically supported because the ADC is already powered down in shutdown mode, Please check this table in RM0490:
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.
2024-06-18 01:11 AM
Hi Sarra,
Thanks for your information.
The problem is i cannot enter shutdown mode with that 3 line of code.
I saw some information for shutdown mode and I know the clock will be suspended which mean ADC will not be able to work
So I wonder whether sleep mode can do such a thing
On the table ,it state "U" in sleep mode for ADC, which is unchanged.
The point is i want to deploy a function that adc wake the mcu from sleep mode with low layer lib, but I can't find examples.
1. enter sleep mode and shutdown mode
2. set up WFE/WFI with ADC
2024-06-20 02:22 AM
Hello again @uveuvenouve,
To enter shutdown mode, you can follow this sequence
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN;
LL_LPM_EnableDeepSleep();
LL_PWR_ClearFlag_WU(); //clear any pending wake-up flags that might inadvertently wake up the MCU immediately after entering shutdown mode
__WFI(); // In shutdown mode, the __WFE(); instruction is typically not used because most peripherals, including the event system, are powered down.
You can use either the __WFE(); or __WFI(); instruction to enter sleep mode
the note "Unchanged" in Sleep mode means that the peripheral retains its state or configuration and continues to operate as it did before entering Sleep mode so it is possible to use it.
You can find low-layer power examples here: STM32CubeC0/Projects/STM32C0116-DK/Examples_LL/PWR at main · STMicroelectronics/STM32CubeC0 · GitHub
Unfortunately, there is no ready-to-use example using ADC, you'll need to configure it, but you can always ask separate questions while doing it!
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.