cancel
Showing results for 
Search instead for 
Did you mean: 

Program doesn't run with Debug detached

jdcowpland
Associate II
Posted on January 16, 2014 at 16:40

I have a STM32F415VG which I have on my own board. The program code all runs when I have my SW debug adapter hooked up, but if I try to run the program without the adapter connected, nothing works. My oscillator doesn't even start up. Feels like there should be pull-ups or pull-downs on some of my debug pins, but the documentation all says that they're all done internally. Anyone know what might be the issue?

Cheers!
5 REPLIES 5
trevor23
Associate III
Posted on January 16, 2014 at 16:57

What tool chain, SWD adaptor etc. are you using?

chen
Associate II
Posted on January 16, 2014 at 17:03

Hi

Are you running in RAM?

When you debug - check the program counter. If it is in 0x2000000 region - you are loading and running your code in RAM

Posted on January 16, 2014 at 18:24

I guess you'd want to check what BOOTx are set too.

Then you might want to look at the startup code, perhaps setting some GPIO to represent where you are, or output characters from a USART. These things can be done in assembler, if required.

Have some sort of indicator in the Hard Fault routine so you can see if it ends up there. Ideally outputting diagnostic info via a serial port.

Have some check-points within SystemInit(), to see if it's stuck in a loop waiting for a clock to start, or PLL to lock.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
dibs
Associate II
Posted on January 17, 2014 at 22:21

I have seen something similar with a JTAG programmer on a board that I was working on. The programmer would assert the reset if it was not powered (plugged into USB), and prevent the MCU from booting. The board was designed to use the JTAG hardware reset, so it was a problem. The solution was to disconnect the JTAG HW reset line and rely on the JTAG SW reset functionality.

jdcowpland
Associate II
Posted on January 20, 2014 at 09:42

Putting a 47k pull down resistor on the SWCLK line fixed the issue!