cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F205RBT6 does not start sometimes on power up

aamirali641989
Associate II
Posted on May 18, 2014 at 14:46

I am using STM205RBT^ & I have noticed that it does not start executing first instruction sometimes.

I am using HSI oscillator & used pll to make 120Mhz.

My first line in code is to toggle a pin.

Only two possibilities I think: (if other plz let me know)

1. Before main there is systeminit() which set PLL to 120Mhz. Systeminit file is created from excel utility provided by ST. I am using HSI. 

There is one while loop in it.

I have still to check this condition by placing toggle code before this while loop.

2. Something is making controller reset on power up (it happens sometimes only). So what could be reason???

I have reposted this question seems that older question gets deletd

2 REPLIES 2
Posted on May 18, 2014 at 17:51

I am using STM205RBT6 & I have noticed that it does not start executing first instruction sometimes.

 

I am using HSI oscillator & used pll to make 120Mhz.

 

My first line in code is to toggle a pin.

 

 

Only two possibilities I think: (if other plz let me know)

 

 

1. Before main there is systeminit() which set PLL to 120Mhz. Systeminit file is created from excel utility provided by ST. I am using HSI. 

 

 

There is one while loop in it.

 

I have still to check this condition by placing toggle code before this while loop.

 

 

 

2. Something is making controller reset on power up (it happens sometimes only). So what could be reason???

 

 

I have re-posted this question seems that older question gets deleted

Well I seriously doubt it got deleted, you just can't find it. The forum doesn't make it easy to find ones own posts.

The  code in main() clearly isn't the first code to get executed, to make that assertion you'd need code in the Reset_Handler. You could add some assembler code in there to toggle a GPIO or send a character via a USART.

Two most probable issues with code called in SystemInit() are loops waiting for HSE, HSI or PLL to come up, and the validity of the Flash Wait State configuration.

So if you comment the call to SystemInit() does it work then?

Can you track progress through the code with GPIO waypoint indications?

What kind of reset circuit do you have? The ones using R-C networks are particularly poor at dealing with power supply ramps, and meeting minimum assertion requirements. Consider the use of a proper POR circuit.

Does the code end up in the HardFault_Handler? Do have any useful code in there to help troubleshoot the situation?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
os_kopernika
Associate II
Posted on May 19, 2014 at 13:16

''I have noticed that it does not start executing first instruction sometimes.''

Your post suggests that you believe first instruction is the one from main()..

First instruction is the one pointed by 0x4.

''Something is making controller reset on power up (it happens sometimes only). So what could be reason???''

RCC->CSR