cancel
Showing results for 
Search instead for 
Did you mean: 

Start program from Flash when power on. (Discovery stm32f407)

patrickelectric
Associate
Posted on December 07, 2014 at 22:54

When I program the discovery board with openocd and reset the board I can see the program running.

But when I turn off the board I need to connect with the openocd to run the program.

I Dont know why I need to use the command 'reset' of the openocd to run the code if the program is in the flash and on the address 0x0800.0000.

#discovery #startup #stm32f407
1 REPLY 1
Posted on December 08, 2014 at 13:41

Yes it should start to run directly from flash with BOOT0 low in the default state.

You'll need to examine more carefully your code, and what the linker has generated. Without the debugger you would want to make sure you enable clocks you need, and loops may complete faster, so watch timeout counts. The debugger typically enables clocks and features it needs to work correctly, if your code depends on this there can be problems. Explicitly enable things you need or expect to be working.

Consider using GPIO/LED signalling to understand how far into the code it's getting, or use a USART to output diagnostic information.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..