Lightweight USB device Stack for STM32 microcontrollers logo

Lightweight USB device Stack for STM32 microcontrollers

Free
FreeFree tier
Type
Open Source

About Lightweight USB device Stack for STM32 microcontrollers

A lightweight and fast event-driven USB device stack for STM32 microcontrollers. It features a completely separated USB hardware driver and core, making it easy to use and port. Supports multiple STM32 series and provides built-in class definitions for HID, DFU, and CDC. Tested on numerous STM32 and compatible MCUs.

Key Features

Lightweight and fast event-driven workflow
Completely separated USB hardware driver and USB core
Easy to use and port across STM32 series
Supports USB HID, DFU, and CDC classes
Compatible with CMSIS V4 or V5
Double-buffered endpoints on supported MCUs
Extensive MCU support: STM32L0, L1, L4, F0, F1, F3, F4, F7, H7, G4, WB55, and GD32F103

Pros & Cons

Pros
  • Lightweight and efficient event-driven architecture
  • Clean separation between hardware driver and core logic
  • Broad support for many STM32 families and compatible MCUs
  • Includes ready-to-use class definitions for HID, DFU, and CDC
  • Open-source and free to use
Cons
  • Requires careful clock configuration (HSI oscillator may not meet USB timing requirements)
  • Not a full USB stack; limited to device mode only
  • Documentation may be sparse beyond the GitHub readme

Best For

Developing USB device firmware for STM32 microcontrollersImplementing USB HID devices (e.g., keyboards, mice)USB DFU (Device Firmware Upgrade) for embedded systemsUSB CDC (Communication Device Class) for virtual COM ports

FAQ

Which STM32 microcontrollers are supported?
The stack supports a wide range of STM32 MCUs including STM32L0x2, L0x3, L1xx, L4x2, L4x3, L4x5, L4x6, F0x2, F0x8, F070, F102, F103, F105, F107, F302, F303, F373, F401, F411, F4x5, F4x7, F4x9, F4x6, F7, H743, G4 series, WB55, and also GD32F103. See hardware.md for details.
Is the stack free to use?
Yes, it is open-source and free to use under the terms of the license included in the repository.