CherryUSB User Guide

CherryUSB is a small, lightweight, portable USB host and device protocol stack for embedded systems. CherryUSB offers the following advantages:

Easy to Learn USB

To facilitate user learning of USB fundamentals, enumeration, driver loading, and IP drivers, the written code has the following advantages:

  • Streamlined code with simple logic and no complex C language syntax

  • Tree-structured programming with progressive code layers

  • Templated and simplified Class drivers and porting drivers

  • Clear API categorization (Device: initialization, class registration, command callbacks, data transmission; Host: initialization, class discovery, data transmission)

Easy to Use USB

To facilitate user interaction with USB interfaces, considering users’ familiarity with UART and DMA, the designed data transmission interface has the following advantages:

  • Equivalent to using UART TX DMA/UART RX DMA

  • No length restrictions on transmission/reception; users don’t need to worry about USB packetization (porting drivers handle packetization)

Easy to Achieve USB Performance

Considering USB performance requirements to reach theoretical USB hardware bandwidth, the designed data transmission interface has the following advantages:

  • Porting drivers directly interface with registers without abstraction layer encapsulation

  • Memory zero copy

  • DMA mode used when IP supports DMA (DMA provides hardware packetization functionality)

  • No length restrictions, facilitating hardware DMA interfacing and maximizing DMA advantages

  • Packetization handled in interrupt context

Device Protocol Stack Overall Execution Flow

_images/usbdev.svg

Host Protocol Stack Overall Execution Flow

_images/usbhost.svg

Other Related Links

Class Guide

Release Notes

Performance Showcase

Commercial Support