Showing results for 
Search instead for 
Did you mean: 

Debug Connection Lost if NJTRST Set to Output

Brian H
Associate III

Developing on an STM32H563ZI chip with Cube IDE and ST-Link V2.  DEBUG is configured as JTAG with Trace Syncro (4 bits), which is 4-wire JTAG (JTMS, JTCK, JTDI, and JTDO).  

My project has allocated pin PB4(NJTRST) as a GPIO.  If left unconfigured, debugging is possible.  If configured as an output, the debugger loses its connection to the core with the execution of the line of code that configures the pin as an output.

Why does this happen, when I'm using 4-wire JTAG?  The NJTRST line doesn't even go to the JTAG header, so it's not like the ST-Link is "secretly" using that wire.

Is there maybe some option bit I need to set to make the chip happy in debug mode with NJTRST configured as a general-purpose output?



Accepted Solutions
Pavel A.
Evangelist III

Can you use SWD mode?


View solution in original post

Pavel A.
Evangelist III

Can you use SWD mode?


Hi Pavel,

It looks like I can debug normally in SWD mode; I hadn't thought to try that before.

I'd still like to understand why having NJTRST set as an output, when it's not assigned to JTAG, causes JTAG debugging to fail.


Uwe Bonnes
Principal II

This is a long standing errata: Even on U5 in es0499 you find

2.2.20: Full JTAG configuration without NJTRST pin cannot be used might think that CubeMX, with all its wealth of device-specific knowledge, would know that and not let a developer choose that option.  But one might also think that a developer should read the errata, which I obviously failed to do here. 😅