2016-07-09 08:05 PM
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: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
2016-07-10 06:18 AM
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.2016-07-10 06:23 AM
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.