Skip to content

Commit dd830f1

Browse files
mikeysklarclaude
andcommitted
Bump tinyusb to include MAX3421E host startup-hang fix (#3748)
Advance lib/tinyusb c1bf19ed6 -> fcd5a0603 to pull in hathach/tinyusb#3748 (#10053), and adapt to its API drift: XFER_RESULT_ABORTED enum, usbd_control.c merged into usbd.c, TUD_AUDIO_EP_SIZE is_highspeed arg, and CFG_TUD_CDC_EP_BUFSIZE -> RX_EPSIZE. Builds clean on espressif and atmel-samd; nordic still needs a usb_audio descriptor macro migration (see PR). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 105e79a commit dd830f1

5 files changed

Lines changed: 6 additions & 5 deletions

File tree

lib/tinyusb

Submodule tinyusb updated 1534 files

shared-module/usb/core/Device.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ static bool _wait_for_callback(void) {
135135
switch (result) {
136136
case XFER_RESULT_SUCCESS:
137137
return true;
138+
case XFER_RESULT_ABORTED:
138139
case XFER_RESULT_FAILED:
139140
mp_raise_usb_core_USBError(NULL);
140141
break;
@@ -201,6 +202,7 @@ static size_t _handle_timed_transfer_callback(tuh_xfer_t *xfer, mp_int_t timeout
201202
switch (result) {
202203
case XFER_RESULT_SUCCESS:
203204
return _actual_len;
205+
case XFER_RESULT_ABORTED:
204206
case XFER_RESULT_FAILED:
205207
mp_raise_usb_core_USBError(NULL);
206208
break;

supervisor/shared/usb/tusb_config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ extern "C" {
144144
#define CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX USB_AUDIO_N_BYTES_PER_SAMPLE
145145
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX USB_AUDIO_N_CHANNELS
146146
// wMaxPacketSize, sized for the highest supported sample rate.
147-
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX TUD_AUDIO_EP_SIZE(USB_AUDIO_MAX_SAMPLE_RATE, USB_AUDIO_N_BYTES_PER_SAMPLE, USB_AUDIO_N_CHANNELS)
147+
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX TUD_AUDIO_EP_SIZE(false, USB_AUDIO_MAX_SAMPLE_RATE, USB_AUDIO_N_BYTES_PER_SAMPLE, USB_AUDIO_N_CHANNELS)
148148
// Deep software FIFO so the 1 ms refill keeps clear of the underrun floor.
149149
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ (16 * CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX)
150150

@@ -156,7 +156,7 @@ extern "C" {
156156
#define CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_RX USB_AUDIO_N_BYTES_PER_SAMPLE
157157
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX USB_AUDIO_N_CHANNELS
158158
// wMaxPacketSize, sized for the highest supported sample rate.
159-
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX TUD_AUDIO_EP_SIZE(USB_AUDIO_MAX_SAMPLE_RATE, USB_AUDIO_N_BYTES_PER_SAMPLE, USB_AUDIO_N_CHANNELS)
159+
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX TUD_AUDIO_EP_SIZE(false, USB_AUDIO_MAX_SAMPLE_RATE, USB_AUDIO_N_BYTES_PER_SAMPLE, USB_AUDIO_N_CHANNELS)
160160
// Deep software FIFO so the 1 ms drain keeps clear of the overrun ceiling.
161161
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ (16 * CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX)
162162
#endif

supervisor/shared/usb/usb_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ
156156
// size. Setting CFG_TUD_CDC_RX_BUFSIZE to the endpoint size and then sending
157157
// any character will prevent ctrl-c from working. Require at least a 64
158158
// character buffer.
159-
#if CFG_TUD_CDC_RX_BUFSIZE < CFG_TUD_CDC_EP_BUFSIZE + 64
159+
#if CFG_TUD_CDC_RX_BUFSIZE < CFG_TUD_CDC_RX_EPSIZE + 64
160160
#error "CFG_TUD_CDC_RX_BUFSIZE must be 64 bytes bigger than endpoint size."
161161
#endif
162162

supervisor/supervisor.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ ifeq ($(CIRCUITPY_TINYUSB),1)
127127
SRC_SUPERVISOR += \
128128
lib/tinyusb/src/class/cdc/cdc_device.c \
129129
lib/tinyusb/src/device/usbd.c \
130-
lib/tinyusb/src/device/usbd_control.c \
131130
supervisor/shared/usb/usb_desc.c \
132131
supervisor/shared/usb/usb_device.c \
133132

0 commit comments

Comments
 (0)