USBX Example list

List of USBX device and host application examples provided by ST, with short descriptions

The STM32Cube MCU firmware packages deliver a rich set of USBX-based examples. They cover both USB device and USB host applications, showing how to integrate USBX with STM32 HAL, FreeRTOS, FileX.

USB device application examples

Example

Role / Class

Short Description

USBX examples Pack

HID

USB Device - HID (Human Interface Device)

Implements standard HID devices. Demonstrates report descriptor setup and periodic report transmission.

device_hid_mouse_freertos
device_hid_mouse_no_os

CDC ACM

USB Device - CDC ACM (Communications Device Class - Abstract Control Model)

STM32 enumerates as a USB virtual COM port. Shows full-duplex serial communication between the MCU and a PC terminal using the USBX CDC ACM device class.

device_cdc_acm_uart_freertos

USB host application examples

Example

Role / Class

Short Description

USBX examples Pack

HID

USB Host - HID (Human Interface Device)

Enumerates and uses HID peripherals. Demonstrates interrupt IN transfers and HID report parsing.

host_hid_no_os

MSC

USB Host - MSC (Mass Storage Class)

STM32 acts as USB host and accesses USB flash drives. Demonstrates mounting a FileX volume, reading/writing files, and safe media removal.

host_msc_freertos

HUB

USB Host - Hub

Demonstrates USB hub support, managing multiple devices behind a hub (for example MSC + HID through a single upstream port).

host_hub_msc_hid_freertos