Skip to main content

XRUSB

XRUSB is the USB device stack inside LibXR. It is built from platform-side USB device/endpoint implementations plus upper-layer USB device classes, and it is mainly oriented toward device-side development.

Main Characteristics​

  • modern C++ implementation
  • lock-free data structures where appropriate
  • double-buffer and DMA-oriented transfer paths
  • endpoint numbers set by each class's constructor; endpoints taken from the endpoint pool when a configuration is selected
  • one-shot construction-time memory allocation
  • interrupt-driven and ISR-safe design

Supported Device Classes​

ProtocolStatusNotes
CDC-ACMsupportedexposed as LibXR UART adapters
HIDsupportedkeyboard / mouse / gamepad paths are ready to use; other HID types should derive their own class
UACsupportedUAC1 microphone
GSUSBsupported (CAN/FDCAN)oriented toward Linux SocketCAN
DAPLinkV1supported (SWD; JTAG once a backend is set with SetJtag())oriented toward CMSIS-DAP v1 HID host tooling
DFU Runtimesupportedhandles runtime DETACH and deferred jump to bootloader
DFU Bootloadersupportedsupports DNLOAD / UPLOAD / GETSTATUS / ABORT / CLRSTATUS / manifest flows
DAPLinkV2supported (SWD; JTAG once a backend is set with SetJtag())oriented toward CMSIS-DAP v2 bulk host tooling

BOS / Platform Capability Support​

CapabilityStatusNotes
WebUSBsupportedmainly used by DFU runtime / bootloader paths
WinUSB MS OS 2.0supportedused by DAPLinkV2 and current DFU runtime / bootloader paths on Windows

Additional notes:

  • The tables list the capabilities present in the device-class and BOS code.
  • Whether a specific BOS capability is actually published by a device instance still depends on constructor choices such as WebUSB landing-page parameters or the selected/default WinUSB metadata scope.

Platform Support​

PlatformDevice class / controllerStatusTested hardware
STM32STM32USBDeviceDevFs / FSDEVsupportedSTM32F103 / STM32G431
STM32STM32USBDeviceOtgFS / USB_OTG_FSsupported (Device)STM32F401 / STM32F407
STM32STM32USBDeviceOtgHS / USB_OTG_HSsupported (Device)STM32F407 / STM32H750
ESP32-S3ESP32USBDevice / USB_OTG_FSsupported (Device)ESP32-S3
CH32CH32USBDeviceFS / USB_DEVICE_FSsupportedCH32V203
CH32CH32USBOtgFS / USBFSsupported (Device)CH32V307 / CH32V203 / CH32V208
CH32CH32USBOtgHS / USBHSsupported (Device)CH32V305 / CH32V307

Contents​

Notes​

  • the platform-specific pages focus on how USB device and endpoint implementations are realized on different MCU / SoC targets;
  • the device-class pages focus on the behavior and interfaces of each USB device class;
  • the VID/PID page covers the default XRUSB conventions, not every special identification strategy such as CMSIS-DAP compatibility choices.
  • This section covers the device-side (Device) stack only.