JTAG used IOs, how could utilize them when don’t debug?

samsam
Posts: 50
Joined: Sun Jun 04, 2017 5:26 pm

JTAG used IOs, how could utilize them when don’t debug?

Postby samsam » Fri Aug 21, 2020 5:25 am

JTAG interface on ESP32 uses IO12,13,14 and 15. How can utilize easiest way those IOs when don’t debug? Is there some data for minimum impedance that attached components to those IOs need to have so when debugging/using JTAG not to jeopardize JTAG communications?
Also Is there a way to distinguish in my code that JTAG debugging take place so could bypass some part of my code that let say configures and uses same IOs (12,13,14,15) as outputs in regular (not JTAG debugging) mode?
Let say in regular mode will use all or some of those IOs to drive some LEDs and I’m curious what are my options to keep both JTAG capabilities and regular IOs with easy switching between i.e. no solder/desoldering, jumpers, mechanical switches etc?
Is there any reference design / example available?
Thanks

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: JTAG used IOs, how could utilize them when don’t debug?

Postby ESP_igrr » Fri Aug 21, 2020 6:47 am

In the ESP32, IOs 12-15 can not simultaneously be connected to the internal JTAG lines and to the PWM peripheral. So if your application starts up and reconfigures the pins as PWM pins (simply by passing the pin numbers to the ledc driver), then the JTAG interface will no longer work. And if you connect the JTAG adapter to the board, it will not be able to reset the CPU, since this is also done through these 4 JTAG lines (ESP32 doesn't have TRST). I think that the only option to multiplex JTAG and another function is to use and additional input pin to control the program behavior at startup.

samsam
Posts: 50
Joined: Sun Jun 04, 2017 5:26 pm

Re: JTAG used IOs, how could utilize them when don’t debug?

Postby samsam » Mon Aug 24, 2020 3:31 am

Thank you for quick responding.
For my current project I don’t use any PWM. Just I’m short of IOs and had to sacrifice couple indication LEDs in order to preserve JTAG dedicated IOs intact, but my hope was that there is already some study what “redundant” components (impedance, capacitance etc.) are safe to stay connected to the same IO lines (12-15) while in JTAG mode. Regarding the code: it is not so big problem easy to bypass any initializations and assignments of those IOs when will debug, but desoldering/ soldering those tiny SMD parts and easy ripping tracks is a real problem if have to make it every time when will try to debug something.
Regards

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: JTAG used IOs, how could utilize them when don’t debug?

Postby ESP_igrr » Mon Aug 24, 2020 8:08 pm

I think it should be possible to share JTAG TDO pin with an indicator LED, just keep in mind the equivalent RC constant of the LED + series resistor. 15pf typical value for a 0402 LED with a 2kOhm resistor in series works out to 1/RC = 33 MHz. This means it should work with the typical JTAG frequency of 16 MHz which you can get with an FT2232H based adapter.

Who is online

Users browsing this forum: engkhaledeisa and 97 guests