Page 1 of 1
Is it possible to use the ESP32S3 USB JTAG and the other TinyUSB classes simultaneously?
Posted: Fri Aug 19, 2022 12:22 pm
by wuyuanyi
Hi, I found that if I turned on the TinyUSB support in menuconfig, we basically lost the built-in JTAG debugger facilities. Only when I boot with GPIO0 pulled low it shows up the interface that can be used for flashing. I wonder if it is possible to reuse the USB interface for both JTAG and other user-defined classes like HID, CDC, MSD so that they work simultaneously?
Thanks!
Re: Is it possible to use the ESP32S3 USB JTAG and the other TinyUSB classes simultaneously?
Posted: Mon Aug 22, 2022 8:03 am
by Zoltan Janosy
Yes. However, there is only one integrated USB PHY on chip, so you would need an external PHY for the other function. See pp. 942. of the Technical Reference Manual v0.8.
Re: Is it possible to use the ESP32S3 USB JTAG and the other TinyUSB classes simultaneously?
Posted: Mon Aug 22, 2022 8:47 am
by wuyuanyi
Zoltan Janosy wrote: ↑Mon Aug 22, 2022 8:03 am
Yes. However, there is only one integrated USB PHY on chip, so you would need an external PHY for the other function. See pp. 942. of the Technical Reference Manual v0.8.
Thank you for the insights!
Does this mean, if you want to use the USB periph along with the JTAG features, the JTAG can only be accessed from the external PHY interface (MTDI, MTCK, etc.) ? I am not familiar with the USB protocol. Why could the USB interface be multiplexed for multiple CDC, HID, MSD device, but not for the JTAG interface? Is the USB JTAG interface mutually exclusive with other device profiles?
Thanks!
Re: Is it possible to use the ESP32S3 USB JTAG and the other TinyUSB classes simultaneously?
Posted: Mon Aug 22, 2022 10:21 am
by ESP_Sprite
Yes. All the profiles you mention run on the USB-OTG peripheral which is software-configurable to be whatever you want. JTAG needs to work even when software is broken or not there, so it's in its own peripheral which is hardcoded to only be an usb-to-serial-and-jtag thing. Normally, both are there but they use the same USB bus: once you start TinyUSB, the PHY switches out USB-serial-jtag for the USB-OTG. If you add an external PHY, you can have one on the USB bus that provides while having the other on the internal PHY.
Re: Is it possible to use the ESP32S3 USB JTAG and the other TinyUSB classes simultaneously?
Posted: Mon Aug 22, 2022 5:06 pm
by wuyuanyi
ESP_Sprite wrote: ↑Mon Aug 22, 2022 10:21 am
Yes. All the profiles you mention run on the USB-OTG peripheral which is software-configurable to be whatever you want. JTAG needs to work even when software is broken or not there, so it's in its own peripheral which is hardcoded to only be an usb-to-serial-and-jtag thing. Normally, both are there but they use the same USB bus: once you start TinyUSB, the PHY switches out USB-serial-jtag for the USB-OTG. If you add an external PHY, you can have one on the USB bus that provides while having the other on the internal PHY.
Appreciate for the clear explanations!