Skip to main content
Visitor II
July 15, 2024
Solved

Any difference between entering shutdown on U585s?

  • July 15, 2024
  • 1 reply
  • 1340 views

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();
}

    This topic has been closed for replies.
    Best answer by EC.3

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

    1 reply

    Super User
    July 16, 2024

    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.

    EC.3AuthorAnswer
    Visitor II
    July 16, 2024

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

    EC.3Author
    Visitor II
    July 31, 2024

    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?