USB Console Snippet (usb-console)
west build -S usb-console [...]
Overview
This snippet redirects serial console output to a CDC ACM UART. The USB device which should be used is configured using Devicetree.
The interface for CDC ACM user is Universal Asynchronous Receiver-Transmitter (UART) driver API. But there are two important differences in behavior to a real UART controller:
Data transfer is only possible after the USB device stack has been initialized and started, until then any data is discarded
If device is connected to the host, it still needs an application on the host side which requests the data
The CDC ACM poll out implementation follows the API and blocks when the TX ring buffer is full only if the hw-flow-control property is enabled and called from a non-ISR context.
The devicetree compatible property for CDC ACM UART is
zephyr,cdc-acm-uart
.
CDC ACM support is automatically selected when USB device support is enabled
and a compatible node in the devicetree sources is present. If necessary,
CDC ACM support can be explicitly disabled by CONFIG_USB_CDC_ACM
.
About four CDC ACM UART instances can be defined and used,
limited by the maximum number of supported endpoints on the controller.
USB Vendor and Product identifiers
The USB Vendor ID for the Zephyr project is 0x2FE3
.
This USB Vendor ID must not be used when a vendor
integrates Zephyr USB device support into its own product.
Each USB sample has its own unique Product ID. The USB maintainer, if one is assigned, or otherwise the Zephyr Technical Steering Committee, may allocate other USB Product IDs based on well-motivated and documented requests.
In the Zephyr documentation you will found a detailed and up to date list of USB Vendor and Product identifiers as they would be used for each single USB sample without manipulation by this snippet. This snippet should only be applied to applications similar to the Console over USB CDC ACM example, no other!
Board specific identifiers
In the basic configuration, the standard Zephyr USB manufacturer and product identification is used. However, manufacturer defined values can also be specified as required.
VID |
PID |
Board |
Manufacturer |
Product |
Specifications and requirements |
Chosen |
---|---|---|---|---|---|---|
|
|
|
STMicroelectronics USB product ID from their Virtual COM Port [10] |
|||
|
|
|
derived VID from part number MIMXRT1011DAE5A |
|||
|
|
mimxrt1060_evk@B/mimxrt1062/qspi mimxrt1060_evk@A/mimxrt1062/qspi mimxrt1060_evk@A/mimxrt1062/hyperflash |
derived VID from part number MIMXRT1062DVL6A |
|||
|
|
|
||||
|
|
|
||||
|
|
|
||||
|
|
|
Seeeduino XIAO
|
|||
|
|
|
Seeeduino XIAO
|
|||
|
|
|
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
|
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
|
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
|
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
|
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
|
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
|
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
|
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
|
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
|
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
waveshare_rp2040_plus waveshare_rp2040_plus@16MB |
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
|
Raspberry Pi Pico SDK CDC UART
|
|||
|
|
How to add support of a new board
add board configuration and devicetree overlay to this snippet;
which overwrites following options:
Requirements
Hardware support for:
A devicetree node with node label zephyr_udc0
that points to an enabled USB
device node with driver support. This should look roughly like this in
your devicetree:
zephyr_udc0: usbd@deadbeef { compatible = "vnd,usb-device"; /* ... */ };