This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to wake quickly from standby on STM32F103

Hi,

I'm trying to run an STM32F103 on as little power as possible. Most of the time, the processor is in Standby, waking up occasionally on a RTC alarm interrupt.

When the processor wakes, from the current consumption, it appears that it takes approximately 2ms before I get to the start of my c main() function - which seems like a long time to me.

The processor is fitted with an 8MHz external xtal, but I'm hoping to start up on the HSI clock (which appears to be the case if I check with the debugger).

I'm using the Keil microlib; I know it will take some time to initialise memory etc. - but 2ms seems rather long. According to the hardware manual, the HCI startup time is 2us.

Can anyone give me an idea about what I'm missing? What is the processor doing for 2ms before it gets to main()?

Thanks in advance,

Jon.

Parents
  • How much RAM does it has to zero-fill?

    How much RAM does it has to initialize from flash data?

    Do you switch to the crystal in the startup file or after reaching main? Some processors might take maybe 20000 crystal periods to spin up the crystal and get a PLL lock. 8000 crystal periods would be 1 ms.

    Isn't it feasible to run the processor in a mode where it has RAM retention so it just needs to power up the processor and can then directly jump to an ISR?

Reply
  • How much RAM does it has to zero-fill?

    How much RAM does it has to initialize from flash data?

    Do you switch to the crystal in the startup file or after reaching main? Some processors might take maybe 20000 crystal periods to spin up the crystal and get a PLL lock. 8000 crystal periods would be 1 ms.

    Isn't it feasible to run the processor in a mode where it has RAM retention so it just needs to power up the processor and can then directly jump to an ISR?

Children