
Espressif Community
It is said that ESP chip enthusiasts are paying attention
ESP-USB
With the rapid development of the Internet of Things and smart devices, the role of USB interfaces in embedded systems has become increasingly important. The ESP32-P4/S3/S2 series chips have undergone a comprehensive upgrade in USB functionality, bringing stronger control capabilities, richer application scenarios, and improved debugging and compatibility support. This update includes dual USB-OTG controller optimization, enhanced USB HUB applications, ECM/RNDIS driver support, USB eye diagram testing firmware release, and optimization for self-powered device support, providing developers with a more efficient, stable, and flexible USB solution.
ESP32-P4 Dual USB-OTG Support
The dual USB-OTG controllers built into the ESP32-P4 chip have received full driver support in ESP-IDF (since v5.5.1), offering complete peripheral functionality:
-
It can operate as both a USB Host and a USB Device, supporting various Class Drivers such as UVC (video), UAC (audio), MSC (storage), HID (Human Interface Device), etc.
-
Developers can flexibly configure high-speed or full-speed controllers through the usb_host_install API, choosing between host mode or device mode, thus achieving dual functionality of USB Host and USB Device.

The USB Host/Device example program provided by esp-iot-solution now supports ESP32-P4, for details refer to:
ESP-IDF USB driver example: https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb
esp-iot-solution USB application example: https://github.com/espressif/esp-iot-solution/tree/master/examples/usb
Enhanced USB Hub Applications
After the driver upgrade for the USB-OTG controllers of the ESP32-P4, ESP32-S3, and ESP32-S2 chips, all now support USB Hub (since ESP-IDF v5.4), further improving the adaptability of development scenarios:
-
By adding USB Hub chips, direct connections and centralized management of multiple USB devices can be achieved;
-
Enables concurrent data transmission and communication among multiple devices, avoiding efficiency loss caused by single device occupation, thus enhancing overall interaction efficiency.
The maximum number of supported devices depends on the device type and the number of host endpoints; for example, in host mode, the ESP32-P4 supports up to 16 endpoints and can connect 5-6 devices simultaneously.
Thanks to the support for USB Hub, these chips can easily implement applications with dual USB cameras, providing convenient examples for video capture, image processing, and other scenarios.

Dual USB Camera Application Reference:
https://github.com/espressif/esp-iot-solution/tree/master/examples/usb/host/usb_hub_dual_camera
ECM/RNDIS Driver Support
The ESP32-P4, ESP32-S3, and ESP32-S2 chips have added USB Host ECM/RNDIS standard drivers, enabling the following functionalities:
-
Connect USB Ethernet devices as a host, such as 4G/5G network cards, Ethernet controllers, etc., to achieve USB internet functionality.
-
Compared to the USB PPP driver, ECM/RNDIS offers stronger compatibility, better performance, supporting higher speeds and lower latency.

USB ECM + 4G Module Example
https://github.com/espressif/esp-iot-solution/tree/master/examples/usb/host/usb_ecm_4g_module
USB RNDIS + 4G Module Example
https://github.com/espressif/esp-iot-solution/tree/master/examples/usb/host/usb_rndis_4g_module
USB Eye Diagram Testing Firmware Release
The esp-iot-solution now provides USB eye diagram testing firmware and testing documentation. Users can use Launchpad for online flashing, outputting the USB PHY signals of the ESP32-P4, ESP32-S3, and ESP32-S2 chips to external eye diagram testers or oscilloscopes, facilitating the evaluation of USB signal quality and quickly verifying hardware performance:
-
The testing firmware can be used immediately after online flashing, without complex debugging processes.
-
Quickly verify USB signal quality, improving development efficiency and system reliability.


USB Signal Quality Testing Instructions
https://docs.espressif.com/projects/esp-iot-solution/en/latest/usb/usb_overview/usb_signal_quality.html
Launchpad Eye Diagram Testing Firmware Online Flashing
https://espressif.github.io/esp-launchpad/?flashConfigURL=https://dl.espressif.com/AE/esp-iot-solution/usb_eye_diagram/config.toml
Optimization of Self-Powered Device Support
Several USB Device examples in esp-iot-solution now support VBUS detection, which brings the following improvements:
-
Developers can freely choose VBUS detection pins, enabling USB connection state management.
-
Devices can accurately determine connection status, reducing repeated mounting and connection anomalies.
-
Ensures stable operation of self-powered devices in various application scenarios, enhancing overall system reliability.

Self-Powered USB Device Solutions
https://docs.espressif.com/projects/esp-iot-solution/zh_CN/latest/usb/usb_overview/usb_device_self_power.html
Self-Powered Wireless USB Disk Example
https://github.com/espressif/esp-iot-solution/tree/master/examples/usb/device/usb_msc_wireless_disk
Previous Highlights
Open Source News | New Features Update for Meow Companion ESP-Brookesia and Xiaozhi-ESP32 Dual Platforms
Wi-Fi Beyond Data Transmission: Unveiling CSI, Giving ESP Chips “Perception”
New Product Launch | ESP32-P4-EYE AI Vision Development Board
Meow Companion Launched: An AI Pet that Listens, Moves, and Accompanies

For more exciting applications of ESP32, please follow our official account 💗