Connecting JTAG?

Scalpel78
Posts: 51
Joined: Sun Feb 26, 2017 7:31 am

Connecting JTAG?

Postby Scalpel78 » Mon May 15, 2017 10:04 pm

Hi, I'm working on the third revision of my ESP-WROOM-32 based board. This time around I want to add support for JTAG debugging. I haven't used JTAG before, so I wanted to run this by you guys before I produce the new board.

My googling has led me to believe these are the pins that are used by JTAG;
GPIO14 => JTAG TMS
GPIO12 => JTAG TDI
GPIO13 => JTAG TCK
GPIO15 =>JTAG TDO

I found the above by looking at https://hydrabus.com/wp-content/uploads ... _Debug.jpg

Addtionaly I need to include GND and VCC.

I see they also mention GPIOL0, GPIOL1, GPIOL2, GPIOL3, but I don't know what those pins are?

When looking at the JTAG wikipedia page there also seems to be several variants of connectors. 10-, 14- and 20 pins. I assume the 10-pin variant will work?

Any input here is appreciated, since I'm so unfamiliar with JTAG.

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: Connecting JTAG?

Postby ESP_Sprite » Tue May 16, 2017 1:29 am

That matches http://www.espressif.com/sites/default/ ... ist_en.pdf so it should be correct.

GPIOL0-3 seem to be pins of the FT2232-based cable they use; they're not JTAG-related and can be ignored.

As a connector, anything will work, even something that you architect yourself. The important bit is that you have an easy way to connect it to your JTAG-adapter. If you have room to spare, you may want to pick a 20-pin interface because they're fairly common; if you have less room an 10-pin or maybe even something uncommon like a FPC-connector may be more useful.

BuddyCasino
Posts: 263
Joined: Sun Jun 19, 2016 12:00 am

Re: Connecting JTAG?

Postby BuddyCasino » Tue May 16, 2017 1:21 pm

Or you can go the SWD route if you want a small footprint using these adapters, thats what I use:

https://www.adafruit.com/product/2094
https://www.adafruit.com/product/2743
https://www.adafruit.com/product/1675

SWD signal to ESP32 pin routing would then be:
SWIO 14
CLK 13
SWO 15
NC 12

KEY and RST are unconnected.

Scalpel78
Posts: 51
Joined: Sun Feb 26, 2017 7:31 am

Re: Connecting JTAG?

Postby Scalpel78 » Tue May 16, 2017 2:09 pm

Fantastic! SWD sounds like a nice plan, since I'm creating a tiny board. I'll try that.

Thanks!

rsimpsonbusa
Posts: 131
Joined: Tue May 17, 2016 8:12 pm

Re: Connecting JTAG?

Postby rsimpsonbusa » Tue May 16, 2017 2:40 pm

Sorry to intrude.

Does SWD work in the ESP32? I read that it did not. Could you later please confirm this.

br

Robert

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

Re: Connecting JTAG?

Postby ESP_igrr » Tue May 16, 2017 2:54 pm

BuddyCasino: where did you get information that ESP32 supports SWD?

SWD is very much an ARM thing; ESP32 uses JTAG as a debugging interface. It does not support SWD.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Connecting JTAG?

Postby WiFive » Tue May 16, 2017 3:12 pm

I think he is saying use the smaller connectors traditionally used for SWD because they take up less board space than a full JTAG header. But still use JTAG signals.

BuddyCasino
Posts: 263
Joined: Sun Jun 19, 2016 12:00 am

Re: Connecting JTAG?

Postby BuddyCasino » Tue May 16, 2017 3:15 pm

Guess I could have worded that differently - the protocol SWD is of course not supported, but the connector works nicely. Comes in handy on a space-constrained breadboard - why waste space for unused pins?

Edit: WiFive got the idea

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

Re: Connecting JTAG?

Postby ESP_igrr » Tue May 16, 2017 3:24 pm

That would work, just make sure pin 12 is not left NC ;)

BuddyCasino
Posts: 263
Joined: Sun Jun 19, 2016 12:00 am

Re: Connecting JTAG?

Postby BuddyCasino » Tue May 16, 2017 3:44 pm

OK NC might be confusing, it actually is connected, to be more clear the mapping is as follows:

SWD / JTAG / GPIO
SWDIO / TMS / 14
SWDCLK / TCLK / 13
SWO / TDO / 15
NC / TDI / 12

Who is online

Users browsing this forum: No registered users and 112 guests