Page 1 of 1
JTAG USB Confusion
Posted: Tue Nov 12, 2024 4:46 am
by ignisuti
I am confused by the many online resources in regards to debugging the ESP32-S3
Many resources that show how to use the ESP-PROG show to connect it to the ESP32-S3's TDO, TDI, TCK, TMS signals.
However, other resources say that all that is needed is to connect the USB D- & D+ to IO19 and IO20.
So, which is it?
Re: JTAG USB Confusion
Posted: Wed Nov 13, 2024 12:03 am
by ESP_Sprite
The answer is 'either'. The default is to debug over the integrated USB-serial-JTAG device by connecting to GPIO19&20. This is cheapest as it doesn't need an ESP-Prog and also you a serial communication channel as well (so you don't need an USB-serial chip or something). If you need to debug sleep issues or if you want to use the USB-OTG peripheral of the ESP32S3, you cannot use this method. In that case, you can blow a fuse in the ESP32S3 and it'll switch to the more traditional TCK/TDI/TDO/TMS signals, to which you can connect using e.g. an ESP-Prog.
Re: JTAG USB Confusion
Posted: Wed Nov 13, 2024 1:06 am
by ignisuti
Thanks! I've been reading through the documentation today and think I have a rough idea of what's needed after reading through the chip datasheet, the module datasheet, the Hardware Design guidelines, and the Technical Reference Manual. That's a LOT!
It looks like I'll need to consider the strapping pins IO0, IO3, IO45 & IO46, AND also the fuses. Once I get those configured properly, then connect D- & D+ and make sure my Windows driver is installed correctly.
Is that a decent summary? Or, is there something else I'm missing?
Re: JTAG USB Confusion
Posted: Wed Nov 13, 2024 6:59 am
by ESP_Sprite
ignisuti wrote: ↑Wed Nov 13, 2024 1:06 am
It looks like I'll need to consider the strapping pins IO0, IO3, IO45 & IO46, AND also the fuses. Once I get those configured properly, then connect D- & D+ and make sure my Windows driver is installed correctly.
If you're using GPIO19&20 for USB, you shouldn't have to worry about fuses. With the default fuse setting, the bootup level for GPIO3 also does not matter.
Re: JTAG USB Confusion
Posted: Thu Nov 14, 2024 7:42 am
by ignisuti
Thank you again! I now have line-by-line debugging working through Eclipse IDE (Espressif IDE) using the D- & D+ pins connected to IO19 and IO20.
Here are some notes to anyone else reading this thread:
-Note: Many examples I see online don't mention connecting the USB gnd to PCB gnd, but that was necessary in my case. Note that I'm currently powering my MCU through a different method (Not from USB).
-Note: A lot of the documentation had me thinking I'd needed to hold IO0 LOW at boot to allow Flashing and Debugging with this method, but it appears to NOT be needed.
-Note: This part is likely obvious, but you can not have any pullup or pulldown on the D- & D+ signals. The hardware I was trying to accomplish this on had these issues and I wasn't successful until I removed those.
I'm still confused regarding the 5V USB signals. I've read many times that none of the ESP32's signals are 5V tolerant. Is the ESP32-S3 special for the IO19 and IO20 pins and can handle the signals? If so, can you please point me to documentation that confirms this so I can feel confident in moving forward with my design?
Re: JTAG USB Confusion
Posted: Thu Nov 14, 2024 8:05 am
by ESP_Sprite
ignisuti wrote: ↑Thu Nov 14, 2024 7:42 am
Here are some notes to anyone else reading this thread:
-Note: Many examples I see online don't mention connecting the USB gnd to PCB gnd, but that was necessary in my case. Note that I'm currently powering my MCU through a different method (Not from USB).
This is generally true: unless it's very clear the particular application doesn't need it (e.g. when optocouplers or relays are involved), you should always connect grounds together.
-Note: A lot of the documentation had me thinking I'd needed to hold IO0 LOW at boot to allow Flashing and Debugging with this method, but it appears to NOT be needed.
Generally, you don't need this. If you manage to disable the USB-serial-JTAG (e.g. by accidentally reconfiguring the GPIOs, or because of some bootloop) you may need to use IO0 to get the ESP32-S3 back into download mode.
I'm still confused regarding the 5V USB signals. I've read many times that none of the ESP32's signals are 5V tolerant. Is the ESP32-S3 special for the IO19 and IO20 pins and can handle the signals? If so, can you please point me to documentation that confirms this so I can feel confident in moving forward with my design?
According to the USB spec, power is 5V, but the USB datalines are 3.3V. In general, GPIO19&20 are designed to be compatible with USB.
Re: JTAG USB Confusion
Posted: Thu Nov 14, 2024 8:18 am
by ignisuti
I'm learning lots of new things today.
Thanks again!