back to Arduino and ESP32-S2-Saola-1
Adafruit ported TinyUSB to ESP32-S2
for Metro and FeatherS2 products,
mostly with CircuitPython but also the Arduino IDE.
- Adafruit TinyUSB support:
- Adafruit TinyUSB Library
- GitHub releases
- adafruit has https://github.com/adafruit/Adafruit_TinyUSB_Arduino and
TinyUF2 Bootloader
  Their ESP32 port depends on Espressif's esp32-hal-tinyusb.c for building USB descriptors.
adafruit also has a WebUSB guide
ESP32TinyUSB
This appears to be Expressif's "official" USB library implementation
USB cable preparation
USB GND should be connected to ESP32-S2 Board GND
USB signalling is differential, but signal voltages are still relative to device ground.
USB CDC device
- Provided
cdc.ino sketch loaded and ran fine, after re-enabling MSC and DFU devices...
USB HID device
- Provided
gamepad.ino sketch loaded and ran,
joy.cpl detected ESP32S2 arduino device , but Test showed no activity...
- Note:   Windows' Game Controllers > Test only updates while it has focus.
USB MIDI device
- using Midi View to look for EspTinyUSB-2.0.0 MIDI traffic
- midi-test loaded and ran, but no MIDI device was detected
- midi.ino loaded and ran;
MIDI CLASS was detected, but with no traffic, despite serial monitor output:
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x570
load:0x4004c000,len:0xa50
load:0x40050000,len:0x28d8
entry 0x4004c18c
[ 580][D][usb_descriptors.cpp:45] getConfigurationDescriptor(): descriptor length: 101
[ 581][D][esptinyusb.cpp:48] esptinyusbtask(): USB tud_task created
[ 1582][V][midiusb.cpp:88] setSong(): MThd format => 0
MTrk
[ 1583][V][midiusb.cpp:103] setSong(): song => 40, i = 40
invoking midi.playSong()
[ 1593][V][midiusb.cpp:145] playSong(): play
[ 1594][V][midiusb.cpp:151] playSong(): delta => 40, _byte = 90
[ 2106][V][midiusb.cpp:28] noteON(): ON: 65
[ 2107][V][midiusb.cpp:181] playSong(): on
[ 2107][V][midiusb.cpp:151] playSong(): delta => 0, _byte = 90
[ 2109][V][midiusb.cpp:28] noteON(): ON: 60
[ 2113][V][midiusb.cpp:181] playSong(): on
[ 2117][V][midiusb.cpp:151] playSong(): delta => 0, _byte = 90
...
- commented out
log_v 's in midiusb.cpp:ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x570
load:0x4004c000,len:0xa50
load:0x40050000,len:0x28d8
entry 0x4004c18c
[ 558][D][usb_descriptors.cpp:45] getConfigurationDescriptor(): descriptor length: 101
[ 558][D][esptinyusb.cpp:48] esptinyusbtask(): USB tud_task created
[ 1560][V][midiusb.cpp:88] setSong(): MThd format => 0
[ 1561][V][midiusb.cpp:95] setSong(): MTrk
[ 1561][V][midiusb.cpp:103] setSong(): song => 40, i = 40
invoking midi.playSong()
[ 1574][V][midiusb.cpp:145] playSong(): play
[ 94030][V][midiusb.cpp:135] parseMeta(): meta => 2f, n = 2
[ 94031][V][midiusb.cpp:191] playSong(): unknown note: x0
[ 94526][V][midiusb.cpp:191] playSong(): unknown note: x30
[ 95334][V][midiusb.cpp:191] playSong(): unknown note: x0
[ 97702][V][midiusb.cpp:171] playSong(): ctrl x0 x0
[ 97870][V][midiusb.cpp:191] playSong(): unknown note: x14
[ 99886][V][midiusb.cpp:191] playSong(): unknown note: x3f
[101926][V][midiusb.cpp:135] parseMeta(): meta => 3f, n = ffffffff
GitHub:
|