AnsweredAssumed Answered

Wrong STM32 clock at startup

Question asked by MarcoM on Mar 31, 2014
Latest reply on Mar 31, 2014 by Jack Peacock
Hello, I have a problem similar to the one discussed in the post named "STM32F103RB - Different Clock Speed Between Reset?" 
https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a%2f%2fmy%2est%2ecom%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fcortex_mx_stm32%2fSTM32F103RB%20-%20Different%20Clock%20Speed%20Between%20Reset&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=29#{740361CE-882E-4684-B4E5-5C31FA23622C}

My board have an STM32F103VET7 and there is an 8MHz xtal for the HSE oscillator.
When I flash a program, the clock speed is correct: all timings are ok (baud retes, ecc) and a GPIO pulse made from the SysTick timer set to 1ms give exactly a pulse of 1ms.
When I power down and up the board, the clock speed is completely wrong: the 1ms pulse becames about 12ms, and so on.
I observe that when I have fresly programmed the board the clock is ALWAYS correct, and on all the following power on the clock is ALWAYS wrong.

The software is developed on the CooCox IDE. I am using the standard ST startup. All things works correctly, except for this big clock problem.

I have a customer with a gun pointing to my head... please I need a good idea to solve the issue.

Thank you very much.

Outcomes