Supported SoCs
USB Overview
USB (Universal Serial Bus) is a standard serial communication interface designed to interconnect host controllers and peripheral devices.
The complete USB specification suite, including electrical, mechanical, and protocol layer documentation, is accessible at http://www.usb.org/developers.
Features
Supports USB2.0 high-speed (480 Mbps) and full-speed (12 Mbps) modes
Supports following USB IF standard host class drivers:
CDC ACM: Used for transparent communication
CDC ECM: Connected to CDC ECM devices for basic communication, or serve as a bridge to support network communication between CDC ECM devices and routers
MSC: Support mounting large capacity storage devices such as USB drives to the FatFS file system to implement file reading and writing
UVC: Connected to cameras, support MJPEG, H264, YUV format image capture and video stream forwarding
Supports following USB IF standard device class drivers:
CDC ACM: Used for data transparent transmission or as a virtual serial port
HID: Used as USB keyboard, mouse and other devices to achieve human-computer interaction functions
MSC: Supports SD card or SRAM as storage medium for data storage
UAC: Used as USB audio device, it supports audio recording and playback
Supports following USB composite device class drivers:
CDC ACM + HID
CDC ACM + UAC
HID + UAC
Supports run-time host/device role switch
Provides reference design for vendor-specific USB host/device drivers
Full descriptor customization:
VID and PID
String descriptors
Endpoint mapping
Configurable host/device core driver parameters
Speed mode
Data FIFO depth (only for dedicated FIFO mode)
Core ISR/thread priority
Note
RTL8721Dx only supports full-speed device mode
Hardware Features
Supports device mode
Supports USB 2.0 full-speed (12 Mbps) mode
Supports DMA/slave mode
Endpoint configurations:
EP0: INOUT (for Control transfer only)
EP1: IN
EP2: OUT
EP3: IN
EP4: OUT
EP5: INOUT
Note
One and only one periodic IN endpoint is supported.
Shared FIFO with following configurations:
Total FIFO depth: 768 DWORD
Shared receive FIFO: 472 DWORD (max)
Shared non-periodic transmit FIFO: 32 DWORD (max)
Dedicated periodic transmit FIFO: 256 DWORD (max)
Note
8 DWORD FIFO shall be reserved for DMA registers in DMA mode.
Supports host, device and OTG modes
Supports USB 2.0 high-speed (480 Mbps) and full-speed (12 Mbps) modes
Supports DMA/slave mode
Endpoint configurations in device mode:
EP0: INOUT (for Control transfer only)
EP1: IN
EP2: OUT
EP3: IN
EP4: OUT
EP5: INOUT
Note
One and only one periodic IN endpoint is supported.
Supports 8 channels/pipes in host mode
Shared FIFO with following configurations:
Total FIFO depth: 1024 DWORD
Host mode:
Shared receive FIFO: 512 DWORD (max)
Shared non-periodic transmit FIFO: 256 DWORD (max)
Shared periodic transmit FIFO: 256 DWORD (max)
Device mode:
Shared RX FIFO: 512 DWORD (max)
Shared non-periodic transmit FIFO: 256 DWORD (max)
Dedicated periodic transmit FIFO: 256 DWORD (max)
Note
8 DWORD FIFO shall be reserved for DMA registers in DMA mode.
Integrated UTMI+ PHY
External hub connection support in host mode
Automatic ping in host mode
Supports host and device modes
Supports USB 2.0 high-speed (480 Mbps) and full-speed (12 Mbps) modes
Supports DMA/slave mode
Endpoint configurations in device mode:
EP0: INOUT (for Control transfer only)
EP1: IN
EP2: INOUT
EP3: INOUT
EP4: IN
EP5: OUT
EP6: INOUT
EP7: OUT
Supports 12 channels/pipes in host mode
Shared FIFO with following configurations:
Total FIFO depth: 1024 DWORD
Host mode:
Shared receive FIFO: 1024 DWORD (max)
Shared non-periodic transmit FIFO: 1024 DWORD (max)
Shared periodic transmit FIFO: 1024 DWORD (max)
Device mode:
Shared RX FIFO: 1024 DWORD (max)
6 dedicated transmit FIFOs for device IN transfers, max depth of each Tx FIFO:
Tx FIFO 0: 32
Tx FIFO 1: 16
Tx FIFO 2: 256
Tx FIFO 3: 32
Tx FIFO 4: 256
Tx FIFO 5: 128
Note
12 DWORD FIFO shall be reserved for DMA registers in DMA mode.
Integrated UTMI+ PHY
External hub connection support in host mode
Automatic ping in host mode
Software Stack Overview
Software Architecture
The architecture of USB software stack:
Where:
USB HAL driver: Implements SoC-specific hardware driver for power management and phy calibration, exposing unified HAL API to upper-layer core drivers.
USB host/device core drivers: Integrates USB IP-specific hardware driver, host/device controller driver, enumeration state machine and transfer scheduling algorithms, exposing unified core API for designers to develop classes and applications.
USB host/device class drivers: Delivers USB-IF class-compliant drivers via class-specific API, enabling rapid deployment of standard USB solutions
USB host/device applications: Provides reference designs for USB solutions
File Organization
USB HAL Driver
Path |
Description |
---|---|
|
USB HAL API definition header file, refer to USB硬件抽象层 |
USB Core Driver
Path |
Description |
|
USB common core driver API definition header file |
|
USB device core driver API definition header file |
|
USB device core driver static library file |
Path |
Description |
|
USB common core driver API definition header file |
|
USB device core driver API definition header file |
|
USB host core driver API definition header file |
|
USB DRD core driver static library file for DRD solution |
|
USB device core driver static library file for device solution |
|
USB host core driver static library file for host solution |
Path |
Description |
|
USB common core driver API definition header file |
|
USB device core driver API definition header file |
|
USB host core driver API definition header file |
|
USB DRD core driver static library file for DRD solution |
|
USB device core driver static library file for device solution |
|
USB host core driver static library file for host solution |
USB Class Driver
Path |
Description |
---|---|
|
CDC ACM device class driver |
|
Composite device class driver |
|
HID device class driver |
|
INIC device class driver (non-standard) |
|
MSC device class driver |
|
UAC device class driver |
|
Vendor-specific device class driver |
|
CDC ACM host class driver |
|
CDC ECM host class driver |
|
MSC host class driver |
|
UVC host class driver |
|
Vendor-specific host class driver |
Host Class driver, refer to Host Class driver
Device Class driver, refer to Device Class driver
USB Application
Path |
Description |
---|---|
|
Transparent communication device example based on CDC ACM device class |
|
Composite device example based on CDC ACM and HID device classes |
|
Composite device example based on CDC ACM and UAC device classes |
|
Composite device example based on HID and UAC device classes |
|
HID device example |
|
INIC device example |
|
Mass storage device example based on MSC device classes |
|
Audio device example based on UAC device classes |
|
Vendor-specific device example |
|
Transparent communication host example based on CDC ACM host class |
|
Ethernet communication host example based on CDC ECM host class |
|
Mass storage host example based on MSC host classe |
|
Video host example based on UVC host classe |
|
Vendor-specific host example |
|
Ethernet communication bridge example based on CDC ECM host class |
|
DRD example based on MSC host class and MSC device classe |
Host Solutions, refer to Host Solutions
Device Solutions, refer to Device Solutions
USB Certification
USB certification generally refers to USB-IF certification, i.e. USB-IF compliance testing, which validates devices against USB-IF electrical, protocol and functional requirements to ensure interoperability, security and reliability. Certified devices are authorized to use USB logos.
While USB-IF certification is not mandatory, it is required when:
Products intend to use USB logos
Marketing materials claim USB specification compliance or certification
For certification procedures and requirements, refer to https://www.usb.org documentation or contact USB-IF authorized test labs.
Additional Compliance Requirements for USB Devices:
FCC/CE: Mandatory for USB devices sold in EU/US markets
ISO 26262: Required for automotive USB devices (functional safety)
Windows Logo Program: Necessary for “Certified for Windows” branding
MFi: Mandatory for Apple-specific USB accessories