cancel
Showing results for 
Search instead for 
Did you mean: 

Any difference between entering shutdown on U585s?

EC.3
Associate III

Hello,

I've successfully used the code below to enter shutdown on a U585CIUx. It wakes up on button press and I can tell it is coming up from reset because of timestamps (based on time since startup) and terminal output that only happens during startup.

Using this same code on a U585QIIx, it seems to behave as if it has entered a low power mode, just not one as low power as shutdown. When it wakes up it picks up where it left off in terms of timestamps and it does not run through startup code as expected. I'm also measuring current draw during the so-called "shutdown" - it only goes 10mA lower, but there may be some interplay with battery backups that muddies up the reading.

While I don't normally test this kind of thing with the debugger, since it affects power, I did make sure that it's reaching the call to LL_PWR_SetPowerMode(LL_PWR_SHUTDOWN_MODE) and not going into some other mode.

Is there something I'm missing here? It only starts drawing 10mA more current (back where it started) when the button is pressed so it doesn't seem to act like it came right out of shutdown because of some interrupt.

Thanks

-------------------------------------------------

void goto_shutdown(void) {
HAL_SuspendTick();
LL_PWR_DisableWakeUpPin(DEEP_SLEEP_WAKEUP_PIN);
LL_PWR_ClearFlag_WU();

LL_PWR_SetWakeUpPinSignal1Selection(DEEP_SLEEP_WAKEUP_PIN);
LL_PWR_SetWakeUpPinPolarityLow(DEEP_SLEEP_WAKEUP_PIN);
while (!LL_PWR_GetWakeUpPinPolarity(DEEP_SLEEP_WAKEUP_PIN)) {}

LL_PWR_EnableWakeUpPin(DEEP_SLEEP_WAKEUP_PIN);
LL_PWR_ClearFlag_WU();

LL_PWR_SetPowerMode(LL_PWR_SHUTDOWN_MODE);
LL_LPM_EnableDeepSleep();

__WFI();
}

1 ACCEPTED SOLUTION

Accepted Solutions
EC.3
Associate III

I had continuous DMA running for ADC so once I stopped that, the shutdown behavior started working as expected.

View solution in original post

4 REPLIES 4
TDK
Guru

There is no difference in shutdown behavior, or low power mode behavior. They're the same chip in a different package. The difference must be due to other code or other hardware differences. Are you meeting all of the other requirements to enter this mode per the reference manual?

TDK_0-1721095384862.png

 

Put a while (1); loop right after the WFI to make sure chip is going into shutdown and is restarting after waking up.

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

I had continuous DMA running for ADC so once I stopped that, the shutdown behavior started working as expected.

EC.3
Associate III

I'm unsure about my last observation, when I temporarily commented out calling HAL_ADC_Start_DMA(). At the time, that seemed to directly correlate to whether shutdown was entered/exited as expected. I don't have either the ADC4 global interrupt or the associated GPDMA1 Channel 0 global interrupt enabled. Do the DMA conversions count as "events" then? Although I'm using WFI not WFE.

Is it really the case that having these conversions active can interfere with entering and remaining in low power modes?

Most chips have ADC and DMA capabilities in some low power mode. But if you have interrupt enabled, it will wake up when those are triggered. Probably this is what was occurring in your original post.

Low power modes are incredibly flexible, but they are also incredibly varied. You will need to determine the behavior you want and then choose a suitable low power mode for that. The reference manual goes into great detail here.

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