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.
If you are using CMSIS it's probably dinking around in SystemInit() (system_stm32f10x.c) starting the HSE and waiting for the PLL to lock.
It usually calls this before calling __main, which initializes (zeros,copies) all your statics before calling your main() routine.