From 39a052d7da7f1d2de6c73253d8f59dafcb14bbc7 Mon Sep 17 00:00:00 2001 From: Ashley Strahle Date: Tue, 23 Jun 2026 23:51:49 +0000 Subject: [PATCH] Pin Adafruit TinyUSB to <3.0.0 (older TinyUSB compatible with ESP32 core). Remove dcd_stubs. --- extra_script.py | 19 ------------------- platformio.ini | 4 +--- src/dcd_stubs.c | 31 ------------------------------- 3 files changed, 1 insertion(+), 53 deletions(-) delete mode 100644 src/dcd_stubs.c diff --git a/extra_script.py b/extra_script.py index f8d29f8..fda0754 100644 --- a/extra_script.py +++ b/extra_script.py @@ -1,22 +1,3 @@ Import("env") -import os -# Keep allow-multiple-definition for core TinyUSB symbol overlaps env.Append(LINKFLAGS=["-Wl,--allow-multiple-definition"]) - -# Delete the Adafruit library's generic DCD so the ESP32 core's -# patched version from libarduino_tinyusb.a is used instead. -# We provide stubs (src/dcd_stubs.c) for the few ISO/SOF functions -# the ESP32 core's older DCD doesn't implement. -lib_path = os.path.join( - env.subst("$PROJECT_DIR"), - ".pio", "libdeps", env.subst("$PIOENV"), - "Adafruit TinyUSB Library", "src" -) - -dcd_path = os.path.join(lib_path, "portable", "synopsys", "dwc2", "dcd_dwc2.c") -if os.path.exists(dcd_path): - os.remove(dcd_path) - print("[extra_script] Removed dcd_dwc2.c (using ESP32 core DCD + project stubs)") -else: - print("[extra_script] dcd_dwc2.c not found at:", dcd_path) diff --git a/platformio.ini b/platformio.ini index 2fa019e..dbefabc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -5,10 +5,8 @@ platform = espressif32 board = esp32-s3-devkitc-1 framework = arduino -lib_archive = no - lib_deps = - adafruit/Adafruit TinyUSB Library@^3.1.0 + adafruit/Adafruit TinyUSB Library@<3.0.0 fastled/FastLED@^3.9.0 build_unflags = diff --git a/src/dcd_stubs.c b/src/dcd_stubs.c deleted file mode 100644 index 17ab09e..0000000 --- a/src/dcd_stubs.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Stub DCD functions required by Adafruit TinyUSB Library's usbd.c - * but not provided by ESP32 Arduino core's older libarduino_tinyusb.a. - * These are for ISO transfers / SOF interrupt only -- MIDI doesn't use them. - */ -#include "tusb.h" - -//--------------------------------------------------------------------+ -// SOF (Start of Frame) -//--------------------------------------------------------------------+ -void dcd_sof_enable(uint8_t rhport, bool enabled) { - (void)rhport; - (void)enabled; -} - -//--------------------------------------------------------------------+ -// ISO (Isochronous) -//--------------------------------------------------------------------+ -bool dcd_edpt_iso_alloc(uint8_t rhport, uint8_t dir, uint8_t ep_addr, uint16_t packet_size) { - (void)rhport; - (void)dir; - (void)ep_addr; - (void)packet_size; - return true; -} - -bool dcd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const *p_endpoint_desc) { - (void)rhport; - (void)p_endpoint_desc; - return true; -}