examples/device/cdc_msc/README.md
A composite USB device that exposes two interfaces at once:
/dev/ttyACMx, or a COM port on Windows) that echoes back everything it receives.This is the canonical TinyUSB example for a multi-interface (composite) device.
TinyUSB MSC, containing a single README.TXT. The disk lives in RAM, so changes are not persistent.| Interface | Class driver |
|---|---|
| 0–1 | CDC (virtual serial) |
| 2 | MSC (mass storage) |
Notable tusb_config.h settings:
#define CFG_TUD_CDC 1
#define CFG_TUD_MSC 1
#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
#define CFG_TUD_MSC_EP_BUFSIZE 512
CMake:
mkdir build && cd build
cmake -DBOARD=raspberry_pi_pico ..
cmake --build .
Make:
make BOARD=raspberry_pi_pico all
A FreeRTOS build is in examples/device/cdc_msc_freertos — identical CDC + MSC behavior, with the device, CDC, and LED-blink work split across FreeRTOS tasks.
screen /dev/ttyACM0, PuTTY, …) and type — characters are echoed back.TinyUSB MSC drive appears; open README.TXT to confirm it mounted.