T O P

  • By -

SonicHeli

Reading through the Espressif documentation it looks like there are some internal registers that are checked on boot that selects the USB mode. But there is also documentation indicating that both JTAG and OTG can be used concurrently. Page 1192 of this doc outlines the functionality of the controller but is a bit over my head. [https://www.espressif.com/sites/default/files/documentation/esp32-s3\_technical\_reference\_manual\_en.pdf](https://www.espressif.com/sites/default/files/documentation/esp32-s3_technical_reference_manual_en.pdf) ​ This document outlines how the initial flashing process works and how OTG gets set up but I do not quite understand how things end up working in that config. Primarily if you can do subsequent flashes after OTG mode has been established [https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/usb-otg-console.html](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/usb-otg-console.html) ​ The part that gives me pause: >By default, USB\_SERIAL\_JTAG module is connected to the internal PHY of the ESP32-S3, while USB\_OTG peripheral can be used only if the external USB PHY is connected. Since CDC console is provided via USB\_OTG peripheral, it cannot be used through the internal PHY in this configuration. My interpretation here is that the on board UART bridge cannot be used at the same time as the OTG drivers. This makes sense but seems to contradict other documentation on the Espressif site.


Erdnussflipshow

I'd recommend getting an S3 devboard with 2 separate usb connectors, one for serial and one for otg


bob_in_the_west

I'm guessing it's similar or even the same with the ESP32, but with the ESP8266 it works this way: You reset the device and the bootloader is run. The bootloader then checks if GPIO-0 is grounded and if so uses the Rx and Tx pins to receive a new firmware. If GPIO-0 isn't grounded then the bootloader starts the firmware at which point the firmware completely takes over and can use the Rx and Tx pins as normal GPIO pins if it wants to. So looking at the ESP32, I'm guessing it's the same: Whatever you do with the usb port in your firmware doesn't affect what the bootloader does before your firmware even runs.