ESP32-S3 USB JTAG and MSD

steaky1212
Posts: 9
Joined: Wed Jul 27, 2022 7:43 am

ESP32-S3 USB JTAG and MSD

Postby steaky1212 » Mon Apr 17, 2023 1:20 pm

Hi everyone,

Is it possible to use the USB port for both JTAG and MassStorageDevice (or CDC)?

This can either be:
  • it enumerates as a composite device
  • for the first 10 seconds of booting it is JTAG, but then switches over to MSD if nothing has connected
I am using the ESP32-S3-Mini and I'm using every pin, so I can't use the external JTAG interface.

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

Re: ESP32-S3 USB JTAG and MSD

Postby ESP_Sprite » Tue Apr 18, 2023 1:20 am

The first option is impossible, as USB-serial-JTAG (which provides the JTAG connection) and USB-OTG (which can provide the mass storage functionality) can't be connected to the USB pins at the same time. The second option is viable.

steaky1212
Posts: 9
Joined: Wed Jul 27, 2022 7:43 am

Re: ESP32-S3 USB JTAG and MSD

Postby steaky1212 » Tue Apr 18, 2023 12:11 pm

It's good to know that option1 is impossible due to silicon!

Regarding switching out JTAG for MSD during run-time, would this just be a case of not running "tinyusb_driver_install" (etc.), or something a lot more involved?
Also, is there a way for the ESP32 to know that it is currently under JTAG and so to not enable the USB?

Thanks

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

Re: ESP32-S3 USB JTAG and MSD

Postby ESP_Sprite » Wed Apr 19, 2023 3:32 am

steaky1212 wrote:
Tue Apr 18, 2023 12:11 pm
Regarding switching out JTAG for MSD during run-time, would this just be a case of not running "tinyusb_driver_install" (etc.), or something a lot more involved?
I think so, yes. Until that call, the usb-serial-jtag should still be available.
Also, is there a way for the ESP32 to know that it is currently under JTAG and so to not enable the USB?
There is: https://docs.espressif.com/projects/esp ... _attachedv

Who is online

Users browsing this forum: top_secret_guy and 92 guests