cancel
Showing results for 
Search instead for 
Did you mean: 

What could stop SWD from working?

henrik239955_stm1
Associate II
Posted on December 28, 2012 at 21:18

Im running an application on a STM32F103R8T6. The debug interface works as expected most of the time. But occasionally I can't connect neither with an ST-Link nor IAR I-jet. The code runs normally while trying to connect.

 

I now know that pulling BOOT0 high is the only way I can connect again.

In my code I only disable JTAG:

 GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE);

 

As the board completely powers down before I make a new attempt to connect, there must have been some kind of alternation of the flash memory? Anyone with an idea what is happening and where to start looking to find what is causing this?

Best regards

Henrik Danielsson

#stm32-swd
1 REPLY 1
Posted on December 29, 2012 at 05:56

Flash corruption should be a pretty trivial thing to eliminate as a cause with some simple detection. You should even be able to postmortem a device brought up by the system loader (BOOT0=H). Either way it would provide a sanity check and you could move forward with other causes.

SWD/JTAG commonly fail due to DMA, WFI loops, interference with the GPIO pins being used, and low power modes.

Classic failure for debug interfacing is the absence of NRST, and strategies by the driver software to stop and wrestle control of the processor, and the startup code providing a sufficient window for it to be successful.

The ST-LINK solution is pretty low rent, I'd have a lot more confidence in a Segger pod, both in terms of getting a connection, and providing diagnostics/support if not.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..