Write a Linux USB Device Driver, Step by Step
Learn USB by writing USB drivers: protocol basics, transfers, HID, storage, and a custom data-acquisition device.
Beginner30 lessons
written lessons≈ 15 h
Linux Kernel & Device Drivers · 30 illustrated lessons (text/HTML)
Outcomes
- Explain USB enumeration, endpoints and transfer types
- Write, test and clean up a USB driver safely
- Adapt a USB driver to different kernels and SoCs
Where we teach this
The lessons
Every lesson in this curriculum, in the order we teach it.
- 1Course introduction
- 2Linux USB driver development workshop
- 3USB fundamentals
- 4Kernel module programming
- 5First look at the Linux device model
- 6USB protocol basics (part 1)
- 7The skeleton of your first USB driver
- 8USB driver registration and matching
- 9The device probe() function explained
- 10Device disconnection and cleanup: resource release and reference counting
- 11USB request blocks (URBs) explained
- 12Control transfers
- 13Bulk transfers
- 14Interrupt transfers
- 15Isochronous transfers
- 16Exposing character-device interfaces
- 17User-space to driver communication
- 18Synchronisation and mutual exclusion
- 19Power management: USB suspend and resume callbacks
- 20USB HID device driver
- 21USB serial device driver
- 22USB storage device driver
- 23USB network device drivers (USB-Net)
- 24Introduction to USB gadget drivers
- 25Debugging and logging
- 26Driver porting and adaptation: adapting to different kernel versions and SoC platforms
- 27Project 1: custom USB data-acquisition driver using bulk transfers
- 28Project 2: USB-to-multi-serial adapter driver on the CDC ACM framework
- 29Driver testing and validation
- 30Course summary and next steps
All-access library
Every curriculum on this page, with the labs and lab sequences, for a year.