USB to serial bridge tool using the USB and UART capabilities of the ESP32-S2/S3 microcontroller. This tool serves as a debugging and downloading utility with the following features:
- Bidirectional transparent data communication between USB and UART.
- Configurable serial port settings (supports baud rates up to 3000000 bps).
- Compatibility with automatic firmware download functionality for
esptool, enabling firmware updates for other ESP SoCs.
/*
* │
* │USB
* │
* ▼
* ┌──────┐
* │ │
* │ O O │
* │ │
* ┌───┴──────┴───┐
* │ │
* ┌───────────┐ │ ESP32-S3-OTG │
* │ │ │ │
* │ │ RX │ ┌──┐ │
* │ │◄─────────┼─┤ │expend IO│
* │ │ TX │ │ │ │
* │Target_MCU │◄─────────┼─┤ │ │
* │ │ IO0 │ │ │ │
* │ │◄─────────┼─┤ │ │
* │ │ EN │ │ │ │
* │ │◄─────────┼─┤ │ │
* │ │ │ └──┘ │
* └───────────┘ │ │
* │ │
* │ │
* └───┬──────┬───┘
* │ [ ] │
* └──────┘
*/The example using ESP32-S3-OTG board by default, the IO configuration is as follows:
| ESP32-Sx IO | Function | Remark |
|---|---|---|
| 20 | USB D+ | Fixed |
| 19 | USB D- | Fixed |
| 46 | UART-RX | Link to target board TX |
| 45 | UART-TX | Link to target board RX |
| 26 | Boot(IO0) | Link to target board Boot(IO0) |
| 3 | EN (RST) | Link to target board EN(RST) |
-
Make sure
ESP-IDFis setup successfully -
Set up the
ESP-IDFenvironment variables, please refer Set-up the environment variables, Linux can use:. $HOME/esp/esp-idf/export.sh
-
Set ESP-IDF build target to
esp32s2oresp32s3idf.py set-target esp32s3
-
Build, Flash, output log
idf.py build flash monitor -D ADAPTER_USB_MANUFACTURER_OVERRIDE="Nabu Casa" -D ADAPTER_USB_PRODUCT_OVERRIDE="ZWA-2"
- The automatic download feature is enabled by default. You can disable this option in
menuconfig → USB UART Bridge Demo → Enable auto download. - When using the automatic download feature, connect the development board's
AUTODLD_EN_PINandAUTODLD_BOOT_PINpins to the target MCU's IO0 (Boot) and EN (RST) pins respectively. - The automatic download feature may not function correctly on certain development boards (due to delays caused by RC circuits). In such cases, please fine-tune the code with gpio_set_level software delays.
Please refer to Wireless USB UART Bridge.