cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F405 SWD and JTAG don't work

Parker
Associate

For some reason I am unable to connect to my custom STF32F405RGT6 board via SWD or JTAG.

I originally had my board wired as this table below:

ST-LINK/V2ST-LINK/V2My BoardMy Board
Pin NumberConnector CN3MCU PinMCU Pin
1Target VCC  
2Target VCC VCC
3TRST  
4GND GND
5TDIPA15TDI
6GND GND
7TMS_SWDIOPA13TMS
8GND GND
9TCK_SWCLKPA14TCK
10GND GND
11Not connected  
12GND  
13TDO_SWOPB3TDO
14GND  
15NRST7nRST
16GND  
17Not connected  
18GND  
19VDD  
20GND  

This is from the ST-LinkV2 documentation Table 4: https://www.st.com/resource/en/user_manual/um1075-stlinkv2-incircuit-debuggerprogrammer-for-stm8-and-stm32-stmicroelectronics.pdf

I have tried both SWD and JTAG with all possible reset methods through the CubeProgrammer and IDEDebug configuration:

Parker_0-1755188289359.png

My schematics look like this:

Parker_1-1755188359888.png

 

Parker_3-1755188548492.png

Parker_4-1755188601896.png

Parker_6-1755188900986.png

 

I have 3V3, 3V3A up and measured as 3.26V on my multimeter, and VCAP is at 1.2V.

I tried both versions (high or low) of the BOOT0 pin and saw no difference.

I kept getting one of these two errors:

Parker_5-1755188801133.png

I then removed R501 and still saw these errors.

I also tried a few variations of pulling nRST high or low, as well as PB4 high or low, or even connecting PB4 to R501 which would allow the nRST from the STLinkV2 to be connected to TRST of the STM32.

Why am I not able to communicate through this interface?

7 REPLIES 7

>>Why am I not able to communicate through this interface?

Part not viable?

Pin header mirrored?

The 1.2V on VCAP suggests the part orientation is good. Schematic look Ok.

Picture of board, with debug header and ST-LINK attached? To see if anything obviously wrong there.

swddebugheader.png

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks for the quick reply,

On your 10-pin JTAG/SWD connector where is your nRESET signal routed? Pin 7 of the STM32 or Pin PB4? Does this matter?

I can confirm that the pin header is not mirrored or rotated improperly:

Parker_0-1755192512615.png

Parker_1-1755192607391.png

The key is on the same side as pin1.

I checked my wiring from ST-LinkV2 through to the board. I am using CN3 on the ST-LinkV2 through an ARM-JTAG-20-10 to my board with no hacks or modifications to those wires.

Any other reasons?

 

Not sure why you're involving PB4  the NRST/NRESET Pin 7 of the STM32F4 looks appropriate

Make sure you've identified Pin 1 correctly, one of you screen shots reports 0.01 V, so no power to buffers there.

SWD20PINSTLINK.jpg

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

With the STLink disconnected, does the nRST line go high?  Does your STLink with the 20-to-10 pin adapter work on other boards?

Double checked that and it is correctly going to pin 1 of the ST-LinkV2.

Thank you for clarifying that PB4 is not necessary to be involved, I was confused.

I will double check the nRST voltage tonight. From my memory it was low but I will double check. With the internal pullup it should be high? Maybe my push button is shorting to GND? I will get back to you if this is not the case.

 

I don't have other boards where I have used this STLink + 20-to-10 pin adapter. This is my first STM32 board.

With the STM32's internal pullup and your external cap the nRST should go high shortly after the main power rail.  If it doesn't, check your switch and/or shorts across the cap (C201) or the STM32 pins.