Is it possible to use the ESP32S3 USB JTAG and the other TinyUSB classes simultaneously?

wuyuanyi
Posts: 24
Joined: Wed Mar 09, 2022 11:54 am

Is it possible to use the ESP32S3 USB JTAG and the other TinyUSB classes simultaneously?

Postby wuyuanyi » Fri Aug 19, 2022 12:22 pm

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!

Zoltan Janosy
Posts: 11
Joined: Tue Apr 12, 2022 11:15 am

Re: Is it possible to use the ESP32S3 USB JTAG and the other TinyUSB classes simultaneously?

Postby Zoltan Janosy » 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.

wuyuanyi
Posts: 24
Joined: Wed Mar 09, 2022 11:54 am

Re: Is it possible to use the ESP32S3 USB JTAG and the other TinyUSB classes simultaneously?

Postby wuyuanyi » Mon Aug 22, 2022 8:47 am

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!

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

Re: Is it possible to use the ESP32S3 USB JTAG and the other TinyUSB classes simultaneously?

Postby ESP_Sprite » 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.

wuyuanyi
Posts: 24
Joined: Wed Mar 09, 2022 11:54 am

Re: Is it possible to use the ESP32S3 USB JTAG and the other TinyUSB classes simultaneously?

Postby wuyuanyi » Mon Aug 22, 2022 5:06 pm

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!

Who is online

Users browsing this forum: Majestic-12 [Bot] and 93 guests