cancel
Showing results for 
Search instead for 
Did you mean: 

Works only after restart.

fwjensen999
Associate
Posted on July 10, 2016 at 05:05

Hi, I am new here so bare with me.

When I start the device it wont run. And then when I hit the restart button it works. It also works perfectly in debugg. So I have no idea why this is happening.

It is a self made PCB, and we are using an STM32F405RG. I am using Keil, and have no idea if it is correctly setup. I also am not sure if the heap(0x00000200) and stack(0x00002000) size are correct. Here is a few pictures that may help:0690X00000605QSQAY.png

0690X00000605BeQAI.png0690X00000605QXQAY.png0690X00000605NPQAY.png0690X00000605KaQAI.png0690X00000605F3QAI.png

Hope any of this makes sence, I have searched online and have no idea why this is happening. Please tell me if you need any more info.

#!stm32 #restart #stm32f405
2 REPLIES 2
Posted on July 10, 2016 at 15:18

May be you want to look more closely at the board design, what external crystal it uses, if this starts properly, and what the start-up code in system_stm32f4xx.c is doing. Especially while() loops waiting for things to start, ie HSE, PLL locking, switching to PLL, etc.

Is BOOT0 pulled low, what is NRST doing, ...

The debugger likely prolongs start up, you might want to consider putting code in the Reset Handler to initialize a GPIO or USART, and provide way-point indicators as you proceed through your code, and work through validating things during this initial board bring-up process.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 10, 2016 at 15:23

If you have a 12 MHz crystal make sure the PLL settings in system_stm32f4xx.c reflect that, and HSE_VALUE too.

Try bringing up the system with the 16 MHz HSI (already started and functioning) and see if that has the restart issue or not.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..