AnsweredAssumed Answered

Standby mode in Cube project.  Is SRAM really lost (STM32F042K6)

Question asked by Jim Seymour on Jun 14, 2018
Latest reply on Jun 15, 2018 by Jim Seymour

I have a project (built using CubeMX) that puts the STM32F042K6 in Standby mode by calling HAL_PWR_EnterSTANDBYMode().

It behaves well and does what I expect.  However, the documentation says "SRAM and register contents are lost" in this mode.

I only noticed this after I'd written my code - and now I don't understand how it's working.  Does the HAL function somehow take care of this for me?  Or is SRAM really being preserved?  Or am I just getting lucky?

If I read that warning right, I'd need to re-run all the initialization routines when I come out of standby mode to make sure my ADC/UART/GPIO/etc. are set properly.  Is that right?

Outcomes