cancel
Showing results for 
Search instead for 
Did you mean: 

SOLVED - Debugging custom board through ST Link 2 using SWD interface. Fail in launch sequence

VSøby.1
Associate III

I am using v 1.5 of STM32CubeIDE, and an ST link v2 running firmware V2J37S7.

I have chosen the CPU that I have on my custom board (STM32F410R8T6), configured my periphials and written some code. However, I face an issue when trying to debug the program, or run it on the hardware. When I click the debug button, the debug viewer appears shortly, where i can press run and terminate, before it snaps out of it, and shows this error:

The console outputs the following:

0693W000005CljwQAC.png 

I have messed around with my debug configuration settings. They can be seen here:

0693W000005ClmfQAC.png 

My connections from ST link to MCU are:

St link -> Stm32

Pin 1 (MCU VDD) -> VCC (3.3 V)

Pin 7(SWDIO) -> PA13

Pin 9 (SWCLK) ->PA14

Pin 10 (GND) -> (Common GND)

Pin 15(NRST) -> NRST

Listening on onboard testpoints with oscilloscope shows 3.3 V on pin 1 and 7, and 0 V on Pins 9, 10 and 15. When i press debug i can see the datastream on SWDIO and SWCLK. Nothing appears on NRST.

The LED on the ST link shines red when connected to the board. When i press debug it blinks red/green and pauses at green for some time, before going back to red, and the error message pops up. A GDB server logfile is outputted, that can be seen below:

 0693W000005Cln4QAC.png 

19 REPLIES 19

Check my response to KnarfB regarding this :)

Using OpenOCD debugger gives the following output:

0693W000005CmDbQAK.pngAnd console reads:

0693W000005CmD3QAK.png

STm32CubeProgrammer seems to have issues with my ST-link aswell. I don't have any firmware opened, but when i press connect i get the following error:

0693W000005CmGLQA0.png

LaurentL
ST Employee

It seems your reset pin is stuck to 0. Did you connect it to something else ? If not, check the wiring and if there is no solder issue on RST pin.

You can also try to use "software system reset", the reset will be done by software instead of nrst pin.

I have something else connected yes. Here is the schematic:

0693W000005CmQkQAK.pngnRST is the reset pin on the STM32. Debugger Reset is the one from the ST-link and Master_Reset is connected to a pinheader, that is currently not connected. The idea is that the STM32 can be reset by the ST-link when debugging, and by another MCU when it is running in the field. I don't think this should cause problems, as the Master_reset is not connected in my current setup. The soldering looks fine.

I have tested the connecting with STM32CubeProgrammer, please see my response to clive1. I have tried lowering the clock frequency aswell. It still gives the same error :(

KnarfB
Principal III

Q1 gate is floating, hmm...

LaurentL
ST Employee

Maybe the Q1 transistor needs to have the Master_Reset pin not floating but at GND (via a pull-down resistor maybe).

Yess! I just came to that realization aswell! I grounded it, and now I connect. Thanks alot you guys!

Grounded it and now i'm all good. Thanks alot!