tinyusb logo

tinyusb

Free

An open source USB stack for a variety of Embedded Systems.

FreeFree tier
Type
Open Source

About tinyusb

TinyUSB is an open-source cross-platform USB Host/Device stack for embedded systems. It is designed with a focus on memory safety (no dynamic allocation) and thread safety (all interrupts deferred to non-ISR task functions). The stack emphasizes portability, small footprint, and real-time performance, supporting over 50 MCU families. It includes comprehensive device class support such as CDC, HID, MSC, Audio (UAC1/UAC2), and Bluetooth HCI, as well as host capabilities. TinyUSB works with bare metal, FreeRTOS, RT-Thread, and Mynewt, making it RTOS-friendly.

Key Features

Thread-safe: USB interrupts deferred to task context
Memory-safe: No dynamic allocation, all buffers static
Portable: Supports over 50 MCU families
Comprehensive device class support: CDC, HID, MSC, Audio (UAC1/UAC2), Bluetooth HCI, DFU
Host support for various USB classes
RTOS-friendly: Works with bare metal, FreeRTOS, RT-Thread, and Mynewt
Small footprint and real-time performance
Supports multiple device configurations and low-power functions (suspend, resume, remote wakeup)

Pros & Cons

Pros
  • Open source and free to use
  • Designed for safety: thread-safe and memory-safe (no dynamic allocation)
  • Highly portable across a wide range of MCU families (50+)
  • Comprehensive USB class support covering common device types
  • RTOS-friendly with support for multiple real-time operating systems
  • Small code footprint suitable for resource-constrained devices
  • Active community and sponsorship (e.g., Adafruit)

Best For

Implementing USB device firmware for microcontrollersAdding USB host capabilities to embedded systems (e.g., reading USB keyboards, mass storage)Developing USB audio devices (speakers, microphones) using UACCreating USB serial communication (CDC) for data transferBuilding USB Human Interface Devices (HID) like mice or game controllersEnabling USB Mass Storage (MSC) for data logging or firmware updatesIntegrating USB Bluetooth HCI for wireless communication in embedded projects

FAQ

What is TinyUSB?
TinyUSB is an open-source cross-platform USB Host/Device stack for embedded systems. It is designed for memory safety (no dynamic allocation) and thread safety, supporting over 50 MCU families and various USB device classes.
Which MCU families are supported?
TinyUSB supports over 50 MCU families, including popular ones from manufacturers such as NXP, STMicroelectronics, Microchip, and others. A full list is available in the repository's documentation.