Skip to main content
DLlan.1
Associate
July 21, 2022
Solved

How to connect STM32F407G-DISC1 by SWD to JTrace Pro / JLink

Hello,

I have an STM32F407G-DISC1 evaluation board which I have been trying to connect to through SWD with a Segger JTrace Pro, but I haven't been able to connect to the board for some reason. I have been following a Segger provided document for the connections and have verified those connections using the user manual for the board. Still, every time I run the JLink commander to connect to the target I get the following message on repeat:

InitTarget() start
Can not attach to CPU. Trying connect under reset.
Connection to CPU via connect under reset failed
InitTarget() end

Followed by "Cannot connect to target"

I have triple-checked the connections to be correct, is there a register I have to write to in order to enable tracing or a solution I'm missing?

I've been trying to get it to work for a while.

This topic has been closed for replies.
DLlan.1
DLlan.1Best answer
Associate
July 22, 2022

I solved it with Segger support, it turns out the pinout on the JTrace Pro was reversed, so all I had to do was reverse my connections this entire time. It wasn't intuitive though since all the diagrams for the pinout have the pins arranged according to where the bump on the connector is, and I was following that, but it wasn't the case in mine.

6 replies

Tesla DeLorean
Guru
July 21, 2022

From the pins on the CHIP, not the SWD header exporting the functionality via the ST-LINK.

The pair of ST-LINK jumpers have SWDIO and SWCLK on one side of the bridge

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
DLlan.1
DLlan.1Author
Associate
July 22, 2022

I got it to work finally, turns out that the pinout on my JTrace Pro was reversed.

Piranha
Principal III
July 21, 2022
DLlan.1
DLlan.1Author
Associate
July 22, 2022

I knew, it was at the bottom of the document I was following, but since it wasn't tested on the STM32F407 I didn't want to mess with the firmware. I solved it with Segger support eventually, turns out the pinout on the JTrace Pro 20 pin connector was reversed.

Piranha
Principal III
July 24, 2022

The STM32F4DISCOVERY (STM32F407G-DISC1) board is in the list of tested boards. ;)

DLlan.1
DLlan.1AuthorBest answer
Associate
July 22, 2022

I solved it with Segger support, it turns out the pinout on the JTrace Pro was reversed, so all I had to do was reverse my connections this entire time. It wasn't intuitive though since all the diagrams for the pinout have the pins arranged according to where the bump on the connector is, and I was following that, but it wasn't the case in mine.