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.

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

{SDK}/component/soc/amebaxxx/fwlib/include/ameba_usb.h

USB HAL API definition header file, refer to USB硬件抽象层

USB Core Driver

Path

Description

{SDK}/component/component/usb/common/

USB common core driver API definition header file

{SDK}/component/component/usb/device/core/usbd.h

USB device core driver API definition header file

{SDK}/amebadplus_gcc_project/project_km4/asdk/lib/application/lib_usbd.a

USB device core driver static library file

USB Class Driver

Path

Description

{SDK}/component/component/usb/device/cdc_acm/

CDC ACM device class driver

{SDK}/component/component/usb/device/composite/

Composite device class driver

{SDK}/component/component/usb/device/hid/

HID device class driver

{SDK}/component/component/usb/device/inic/

INIC device class driver (non-standard)

{SDK}/component/component/usb/device/msc/

MSC device class driver

{SDK}/component/component/usb/device/uac/

UAC device class driver

{SDK}/component/component/usb/device/vendor/

Vendor-specific device class driver

{SDK}/component/component/usb/host/cdc_acm/

CDC ACM host class driver

{SDK}/component/component/usb/host/cdc_ecm/

CDC ECM host class driver

{SDK}/component/component/usb/host/msc/

MSC host class driver

{SDK}/component/component/usb/host/uvc/

UVC host class driver

{SDK}/component/component/usb/host/vendor/

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

{SDK}/component/component/example/usb/usbd_cdc_acm/

Transparent communication device example based on CDC ACM device class

{SDK}/component/component/example/usb/usbd_cdc_acm_hid/

Composite device example based on CDC ACM and HID device classes

{SDK}/component/component/example/usb/usbd_cdc_acm_uac/

Composite device example based on CDC ACM and UAC device classes

{SDK}/component/component/example/usb/usbd_uac_hid/

Composite device example based on HID and UAC device classes

{SDK}/component/component/example/usb/usbd_hid/

HID device example

{SDK}/component/component/example/usb/usbd_inic/

INIC device example

{SDK}/component/component/example/usb/usbd_msc/

Mass storage device example based on MSC device classes

{SDK}/component/component/example/usb/usbd_uac/

Audio device example based on UAC device classes

{SDK}/component/component/example/usb/usbd_vendor/

Vendor-specific device example

{SDK}/component/component/example/usb/usbh_cdc_acm/

Transparent communication host example based on CDC ACM host class

{SDK}/component/component/example/usb/usbh_cdc_ecm/

Ethernet communication host example based on CDC ECM host class

{SDK}/component/component/example/usb/usbh_msc/

Mass storage host example based on MSC host classe

{SDK}/component/component/example/usb/usbh_uvc/

Video host example based on UVC host classe

{SDK}/component/component/example/usb/usbh_vendor/

Vendor-specific host example

{SDK}/component/component/example/usb/usbh_wifi_bridge/

Ethernet communication bridge example based on CDC ECM host class

{SDK}/component/component/example/usb/usb_drd/

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