examples/device/cdc_dual_ports/README.md
Enumerates as a USB device with two independent CDC virtual serial ports.
| Interface | Class driver |
|---|---|
| 0–1 | CDC (virtual serial port 1) |
| 2–3 | CDC (virtual serial port 2) |
Notable tusb_config.h settings:
#define CFG_TUD_CDC 2 // two CDC ports
#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
CMake:
mkdir build && cd build
cmake -DBOARD=raspberry_pi_pico ..
cmake --build .
Make:
make BOARD=raspberry_pi_pico all
After flashing, two serial ports appear on the host (e.g. /dev/ttyACM0 and /dev/ttyACM1 on Linux). Open either one in a terminal and type: characters come back lower-cased on the first port and upper-cased on the second.