Repository navigation
Platforms
| Platform | USB stack | Board settings |
|---|---|---|
| ESP32-S2 / S3 / P4 | TinyUSB of the arduino-esp32 core (3.x) | USB Mode: USB-OTG (TinyUSB), USB CDC On Boot: Disabled |
| RP2040 / RP2350 (arduino-pico) | Pico SDK (default) or Adafruit TinyUSB | USB Stack: Pico SDK or Adafruit TinyUSB; not with Upload Method "Picotool" |
| STM32 with USB OTG FS (e.g. F4, F7, H7) | Adafruit TinyUSB Library | USB support: None |
| SAMD, nRF52 | Adafruit TinyUSB Library | (untested) |
| Linux / macOS / Windows | simulated host (UVCHostSimulator) |
CMake, see Desktop |
Verified on hardware with a Linux host (ffmpeg/V4L2, VLC, Cheese and guvcview):
-
ESP32-S3 + OV5640: YUY2 test pattern, MJPEG from
MJPEGEncoder, the camera as MJPEG at 320x240 and 640x480 (15 fps), repeated stream start/stop - Raspberry Pi Pico (RP2040), both USB stacks (Pico SDK and Adafruit TinyUSB): YUY2 test pattern at 15 fps next to the USB serial port, repeated stream start/stop; a one hour soak test (Adafruit TinyUSB) of 48600 frames and 540 open/close cycles without a single error
RP2350, STM32, ESP32-S2 and ESP32-P4 compile (see test_compile.sh) but
are not yet verified on hardware; Windows and macOS hosts are not yet
tested.
The core builds its USB descriptor when USB starts, and uvc.begin()
starts it. With "USB CDC On Boot: Enabled" USB is already running before
setup(), and begin() fails. To still have a USB serial port, declare a
USBCDC USBSerial; object as in the examples: it shares the OTG port with
the camera and supports the 1200 baud reset into the bootloader
(stty -F /dev/ttyACM0 1200, then upload).
The Upload Method "Picotool" defines its own TinyUSB application driver and cannot be combined with TinyUVC: select "Default (UF2)".
The video classes of arduino-audio-tools need FreeRTOS: select
Tools > Operating System > "FreeRTOS SMP" and add
#include "AudioTools/Concurrency/RTOS.h" after AudioTools.h.
Install the Adafruit TinyUSB Library and set "USB support" to "None". The video classes of arduino-audio-tools need the STM32FreeRTOS library.
All supported MCUs except the ESP32-P4 have a full speed USB port (12
Mbit/s). A bulk endpoint delivers roughly 1 MB/s there. An uncompressed
YUY2 frame needs 2 bytes per pixel: 160x120 at 15 fps (576 KB/s) works,
320x240 only at about 5 fps. Use MJPEG for bigger pictures: with a
JPEG capable sensor (ESP32 cameras), or with the software MJPEGEncoder
of arduino-audio-tools.