From 53524905fb093fce046df5cf20e629443762954a Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 19 Mar 2024 14:01:26 +0000 Subject: [PATCH] Update USB library (#2737) This PR fixes USB support for ESP IDF 5.2. Note that host mode is still not yet supported for esp32sx. Improvements: - Update to tinyusb master - Move initialisation code into separate Arch source file, patch to support ESP32 IDF 5.2 (not yet in tinyusb upstream) - Add CI support (speeds up library testing) Fixes: - Lazy-initialise flush timer: Causes problems with static Device objects and esp32sx as timer's aren't yet initialised - Enable python UTF8 mode for usbconfig tool (Windows) - UsbSerial conditional on CDC - Don't implement descriptor callbacks unless building for device - Ensure HID device is ready when sendReport called: get div-by-zero exception on esp32s2 otherwise - Fix `Basic_IFS` sample with `ENABLE_USB_STORAGE`: only for rp2040, no host support yet for esp32sx Tested with rp2040, esp32s2. --- Sming/Libraries/USB | 2 +- samples/Basic_IFS/basic_ifs.usbcfg | 7 ++++++- samples/Basic_IFS/component.mk | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Sming/Libraries/USB b/Sming/Libraries/USB index 8df168d42a..2e3e524172 160000 --- a/Sming/Libraries/USB +++ b/Sming/Libraries/USB @@ -1 +1 @@ -Subproject commit 8df168d42ad4e595398541255e4a0b791f04fda9 +Subproject commit 2e3e524172505835bca270dc7f198034bab01a10 diff --git a/samples/Basic_IFS/basic_ifs.usbcfg b/samples/Basic_IFS/basic_ifs.usbcfg index 60dfe5cc7e..bb6d4a335e 100644 --- a/samples/Basic_IFS/basic_ifs.usbcfg +++ b/samples/Basic_IFS/basic_ifs.usbcfg @@ -1,5 +1,10 @@ { "host": { - "msc": 1 + "hub": { + "port-count": 4 + }, + "msc": { + "maxlun": 4 + } } } \ No newline at end of file diff --git a/samples/Basic_IFS/component.mk b/samples/Basic_IFS/component.mk index 33da075365..f14a80567c 100644 --- a/samples/Basic_IFS/component.mk +++ b/samples/Basic_IFS/component.mk @@ -24,7 +24,7 @@ endif CONFIG_VARS += ENABLE_USB_STORAGE ifeq ($(ENABLE_USB_STORAGE),1) COMPONENT_CXXFLAGS += -DENABLE_USB_STORAGE -COMPONENT_DEPENDS += USB +COMPONENT_DEPENDS += USB FatIFS USB_CONFIG := basic_ifs.usbcfg endif