cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 - Could state of JTDI pin affect switch-over to SWD?

oscarw
Associate

I am using a STM32L471 MCU in a design that may be flashed with new firmware in situ. I'm using SWD as the interface, so the two unneeded JTAG pins (JTDI and JTDO) are used for other purposes. 

According to the reference manual, JTAG is activated by default, then switched to SWD by the debugger:

"By default, the JTAG-Debug Port is active.
If the debugger host wants to switch to the SW-DP, it must provide a dedicated JTAG
sequence on TMS/TCK (respectively mapped to SWDIO and SWCLK) which disables the
JTAG-DP and enables the SW-DP. This way it is possible to activate the SWDP using only
the SWCLK and SWDIO pins." - STM32L4 Reference Manual section 48.3.1

Also according to the manual (and verified on the prototype), the JTDI pin is internally pulled high during programming/reset. Even if switching over to SWD, I verified that the JTDI pin is pulled high for ~6 seconds. 

My question: if this pin (JTDI) is externally pulled down by whatever it is connected to (in my design it is connected to an open-drain sensor output, which may or may not be triggered), will this cause any undesired effects? Namely, could this be interpreted as JTAG data and prevent the switch-over to SWD?

I get the impression that it shouldn't affect anything, and the switch-over to SWD should occur regardless of what is happening on the unneeded JTDI/JTDO pins, but this isn't explicitly stated in the manual.

So, I just want to make sure: if my external sensor is triggered, pulling the JTDI pin low when it is meant to be internally pulled up as required by JTAG, will this cause any issues during SWD programming, or affect the switch-over from default JTAG to SWD?

Thanks for your time.

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @oscarw and welcome to the ST Community 😊.

when you are using SW-DP, you can use both JTAG pins (JTDI and JTDO) for other purpose. That should not effect the SWD programming or the the switch-over from default JTAG to SWD.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
STTwo-32
ST Employee

Hello @oscarw and welcome to the ST Community 😊.

when you are using SW-DP, you can use both JTAG pins (JTDI and JTDO) for other purpose. That should not effect the SWD programming or the the switch-over from default JTAG to SWD.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.