2024-04-23 11:56 AM
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?
Solved! Go to Solution.
2024-04-23 12:40 PM
2024-04-23 12:40 PM
Can you use SWD mode?
2024-05-01 07:45 AM
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.
Thanks!
2024-05-01 07:52 AM
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
2024-05-01 08:05 AM
Interesting...one 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.
Thanks!