finds.dev

hathach/tinyusb

An open source cross-platform USB stack for embedded system

View on GitHubHomepage ↗

★ 6,863CMITupdated Jun 2026

// the take

TinyUSB is a USB host/device stack for microcontrollers, covering 50+ MCU families from STM32 to RP2040 to ESP32. It handles the full USB protocol stack in C with zero dynamic allocation, making it suitable for constrained embedded targets. If you need to make a microcontroller appear as a HID device, CDC serial port, USB mass storage drive, or audio device, this is the go-to library.

- Zero dynamic allocation — all buffers are statically declared, which means memory usage is deterministic and stack/heap corruption from USB activity is essentially impossible. This matters a lot in embedded contexts.

- ISR deferral design is solid: interrupts just push events into a queue, and all USB protocol processing happens in task context. This makes it genuinely safe to use with FreeRTOS or bare-metal superloops without subtle race conditions biting you.

- MCU coverage is exceptional. The driver table in the README covers DWC2, FSDEV, EHCI, OHCI, MUSB, and a dozen vendor-specific controllers. Porting guide exists and there are real contributed ports, not just stubs.

- CI pipeline is thorough — build matrix across toolchains (GCC, Clang, IAR), static analysis via PVS-Studio, fuzzing via OSS-Fuzz, and hardware-in-loop tests. For a C embedded library this is above average.

- USB Audio (UAC2) and Video (UVC) class drivers are incomplete or marked WIP. If you need isochronous transfer classes beyond basic audio capture, you'll be writing a lot yourself.

- The host stack is significantly less mature than the device stack. Hub support exists but multi-TT hubs and complex host enumeration scenarios have known gaps. Don't assume host mode works as well as device mode.

- Power Delivery (PD3.0) support is explicitly described as 'super early stage, only for testing purpose' and limited to STM32G4. Listing it as a feature is misleading for anyone who actually needs USB-C PD.

- Configuration is done entirely through a user-provided tusb_config.h header with dozens of compile-time defines. There's no Kconfig, no cmake options — you have to read the source to know what all the knobs do, and IDE autocompletion won't help you discover them.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
6,863
Forks
1,438
Language
C
License
MIT
Last commit
5 Jun 2026

// nearby

If tinyusb isn't quite it.

All repos →