December 08, 2024, 07:27:48 AM

ESP32-POE JTAG

Started by dparrnd, December 05, 2018, 09:10:49 PM

Previous topic - Next topic

dparrnd

Hello,
How can i debug using JTAG on ESP32-POE ?

MTDI / GPIO12 seems to be alreadu sed for Ethernet !
Any advises ?


   ESP32 Pin   JTAG Signal
1   CHIP_PU   TRST_N
2   MTDO / GPIO15   TDO ->UEXT
3   MTDI / GPIO12   TDI  -> PHY_PWR
4   MTCK / GPIO13   TCK ->UEXT
5   MTMS / GPIO14   TMS ->UEXT
6   GND   GND

Thanks
Denis

LubOlimex

In short, you can't easily use the JTAG with ESP32-PoE since one of the signals is not routed to either the GPIO headers, nor to the UEXT connector. Accessing it would be impractical. Something more, the same pin is used for bootstrapping and to enable the powering of the LAN8710A Ethernet chip (but I believe this multiplexing wouldn't matter in production environment). It is recommended to debug and program the ESP32-PoE via USB. More details below.

As far as I'm aware the JTAG requres pins:

Pin #13 – GPIO12 – MTDI = TDI

Pin #14 - GPIO13 – MTCK = TCK

Pin #15 – GPIO14 – MTMS = TMS

Pin #16 – GPIO15 – MTDO = TDO

Pin #34 – GND

If you take a look at the schematic you'd notice that GPIO13, GPIO14, GPIO15, GND are free and routed to UEXT header for easier access. However, GPIO12 is a bootstraping pin but it is also used as PHY_PWR and it enables or disables the Ethernet chip via software means. Still this multiplexing wouldn't be a problem in production environment, where while programming the board you don't need Ethernet. Please, take a look at the schematic. You can find an export of the schematic here: https://github.com/OLIMEX/ESP32-POE/raw/master/HARDWARE/ESP32-PoE-hardware-revision-B2/ESP32-PoE_Rev_B2_Color.pdf and the KiCAD sources are available here: https://github.com/OLIMEX/ESP32-POE

The only ways to use GPIO12 for JTAG would be impractical in my option – it would require adding a wire to the GPIO12 (probably by soldering). If you decide to do so (even if only for testing purposes) – probably the best place to do it would be near transistor T1 (located at the bottom near pin 1 of EXT1). GPIO12 goes to the base of the transistor T1 (pin1, at the side with two pins it is the top one closer to EXT1 connector).
Technical support and documentation manager at Olimex

datkins47

LubOlimex, you mentioned using usb to debug, is the single step debug and can et work with plaformio?

LubOlimex

There is no way to perform the hardware debug only via the USB but you can perform software debug and "empirical" debug (e.g. if the code goes there, light the LED).

Hardware debug via JTAG is possible on some boards but requires a third-party tool. If the ESP32 board supports hardware debug you can get ARM-USB-TINY-H and follow this guide:

https://docs.platformio.org/en/latest/tutorials/espressif32/arduino_debugging_unit_testing.html
Technical support and documentation manager at Olimex