Hardware Videos
  • All Technology
  • AI
  • Autonomy
  • B2B Growth
  • Big Data
  • BioTech
  • ClimateTech
  • Consumer Tech
  • Crypto
  • Cybersecurity
  • DevOps
  • Digital Marketing
  • Ecommerce
  • EdTech
  • Enterprise
  • FinTech
  • GovTech
  • Hardware
  • HealthTech
  • HRTech
  • LegalTech
  • Nanotech
  • PropTech
  • Quantum
  • Robotics
  • SaaS
  • SpaceTech
AllNewsDealsSocialBlogsVideosPodcastsDigests

Hardware Pulse

EMAIL DIGESTS

Daily

Every morning

Weekly

Sunday recap

NewsDealsSocialBlogsVideosPodcasts
HardwareVideosSTM32 USB MIDI Controller Tutorial (TinyUSB) - Phil's Lab #169
Hardware

STM32 USB MIDI Controller Tutorial (TinyUSB) - Phil's Lab #169

•February 11, 2026
0
Phil’s Lab
Phil’s Lab•Feb 11, 2026

Why It Matters

By demystifying USB‑MIDI implementation on affordable STM32 hardware, the guide empowers creators to build custom, low‑cost controllers that can streamline music production workflows and inspire new hardware‑software integrations.

Key Takeaways

  • •TinyUSB simplifies building USB MIDI devices on STM32 microcontrollers
  • •Thumb sticks and switches map to MIDI CC and program changes
  • •USB descriptors require correct vendor/product IDs and serial number handling
  • •DMA-driven ADC sampling captures analog controls for real-time MIDI output
  • •LED feedback indicates USB connection status and incoming MIDI messages

Summary

The video walks viewers through constructing a custom USB‑MIDI controller using an STM32H7 (SM3287) MCU and the TinyUSB stack. Phil repurposes a QueenB radio‑control PCB—originally not intended for music—to host thumb‑sticks, switches, and RGB LEDs, turning them into MIDI control‑change and program‑change sources that communicate with a host DAW via USB.

Key technical steps include configuring the STM32CubeIDE project for full‑speed USB, disabling ST middleware, and importing TinyUSB source files. He sets up ADC channels with DMA triggered by a timer to sample the thumb‑stick potentiometers, maps those readings to MIDI CC messages, and uses external interrupts for the switches. USB descriptors are customized with vendor/product IDs and a serial number derived from the MCU’s unique ID to ensure proper enumeration.

Phil highlights practical details such as using LEDs to signal USB mount status and inbound MIDI packets, and references the official USB‑MIDI device class specification for packet structure. He also notes sponsor resources—JLCPCB’s six‑layer boards and Altium Designer—for rapid prototyping and production.

The tutorial demonstrates that a modest hobbyist board can become a fully functional MIDI controller, lowering barriers for musicians and developers to create bespoke control surfaces, integrate hardware feedback, and experiment with USB as a low‑latency data bus for audio applications.

Original Description

How to create your own, custom USB MIDI controller with STM32 microcontrollers and the TinyUSB USB MIDI device stack.
Limited-time: $2 for 6-layer PCBs up to 100×100 mm - grab your $33 coupon now: https://jlcpcb.com/events/6-layer-pcb?from=PhilsLab (Ad)
Altium Develop: http://altium.com/yt/philslab (Ad)
[SUPPORT]
Hardware design courses: https://phils-lab-shop.fedevel.education
Course content: https://www.phils-lab.net/courses
Patreon: https://www.patreon.com/phils94
[LINKS]
TinyUSB: https://docs.tinyusb.org/en/latest/index.html
TinyUSB Git: https://github.com/hathach/tinyusb
TinyUSB CDC Video: https://youtu.be/XgsnJdY8LsY
STM32 ADC DMA TIM Video: https://youtu.be/_K3GvQkyarg
USB MIDI Spec:https://www.usb.org/sites/default/files/midi10.pdf
[TIMESTAMPS]
00:00 Intro
01:58 JLCPCB (Ad)
02:59 Altium Develop (Ad)
03:52 Hardware Overview
06:00 CubeIDE Set-Up
08:37 TinyUSB MIDI Device Class
14:21 Receiving MIDI Messages
18:30 Testing Reception with Python Mido
22:49 Sending MIDI Messages
27:04 Testing with DAW
29:42 Outro
0

Comments

Want to join the conversation?

Loading comments...