Skip to content

USB and CherryUSB

For SF32 devices and boards with supported USB hardware, SiFli-SDK documentation and examples show CherryUSB integration. Confirm the USB roles and classes supported by the exact chip, board, and SDK release, and treat USB as a full software stack rather than only a hardware feature.

USB work crosses firmware, descriptors, host operating systems, power behavior, and factory tooling. A device that enumerates once on a developer laptop is not finished.

Use Cases

  • USB CDC serial.
  • HID devices.
  • MSC storage.
  • USB audio microphone/speaker.
  • MTP.
  • USB host support for CDC, HID, MSC, UVC, and UAC peripherals, where supported by the SDK and board.

Practical Workflow

  1. Confirm the board exposes the required USB connector and power path.
  2. Start from the closest SDK USB example.
  3. Test enumeration on Windows, macOS, and Linux.
  4. Verify suspend/resume and cable reconnect behavior.
  5. Record VID/PID, descriptors, and driver expectations.

What to Test

  • Connect before power-up; connect and disconnect while the device is running.
  • Reset while connected.
  • Host sleep/wake.
  • Cable disconnect during transfer.
  • Windows, macOS, and Linux enumeration.
  • Composite device behavior if multiple classes are enabled.
  • Tell users that charge-only USB cables do not support data communication.

Descriptor Checklist

  • VID/PID ownership is clear.
  • Product string is final or versioned.
  • Serial number behavior is defined.
  • Class/subclass/protocol values match the intended host driver.
  • Composite interfaces are stable across firmware updates.

SDK Examples

The official SiFli-SDK CherryUSB example index separates USB-device and USB-host work. Start with the example that matches the intended USB role and class, then carry its descriptor, power, and host-compatibility checks into the product implementation.

Table: SiFli-SDK CherryUSB examples for SF32LB58x
USB role Example Starting point
Device USB microphone USB Audio Class 1 microphone
Device USB microphone and speaker USB Audio Class 1 duplex audio
Device CDC ACM USB communications device
Device CDC ACM UART USB-to-UART bridge
Device CDC + HID + MSC Composite USB device
Device HID mouse USB HID pointing device
Device MSC with NOR flash Mass storage backed by NOR flash
Device MSC with RAM disk Mass storage backed by RAM
Device MSC with dual RAM disks Two logical units backed by RAM
Device MSC with SD/eMMC Mass storage backed by SD card or eMMC
Device MTP with DFS and RAM disk Media Transfer Protocol device
Host CDC ACM host Communicate with a CDC ACM peripheral
Host HID host Attach and read a HID peripheral
Host MSC host Attach a USB mass-storage peripheral
Host UVC + UAC host USB video and audio-class peripherals

Last updated: