<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinyusb.git/src/portable/raspberrypi, branch worktree-ch569-hydrausb3</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/tinyusb.git/atom/src/portable/raspberrypi?h=worktree-ch569-hydrausb3</id>
<link rel='self' href='http://cgit.235523.xyz/tinyusb.git/atom/src/portable/raspberrypi?h=worktree-ch569-hydrausb3'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/'/>
<updated>2026-07-07T04:21:06Z</updated>
<entry>
<title>usbtest: address Codex re-review (5 findings)</title>
<updated>2026-07-07T04:21:06Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-07T03:54:31Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=9422d113479cfe36a4915690617c15b7bf617806'/>
<id>urn:sha1:9422d113479cfe36a4915690617c15b7bf617806</id>
<content type='text'>
- rp2040 dcd_edpt_clear_stall: the toggle-reset re-issue rewound remaining_len
  only for IN, but bufctrl_prepare16() pre-subtracts it for OUT too, so an OUT
  re-issue was short by the still-armed buffers. Rewind both directions (user_buf
  only for IN, which advances at DPRAM-copy time). Validated: pico usbtest 30/30.

- usb_recover.sh: refuse pci-rebind/reset/bind on a BDF that is not a USB
  controller (class 0x0c03xx), so a stray/mistyped address can't disturb storage
  or NICs on the shared HIL host. Guard tested against real BDFs.

- ip3511 dcd_edpt_open: make it tolerant of reopening a still-armed endpoint
  instead of asserting it disabled -- retire via EPSKIP (UM11126 41.7.6/41.8.3)
  then force disabled. This is the correct ISO_ALLOC reopen contract, since
  usbd_edpt_close() is a no-op there. NOTE: audio/video streaming EPs already use
  usbd_edpt_iso_activate() on ISO_ALLOC, so there is no in-tree trigger; this is
  defensive hardening for a class that reopens a non-iso EP via usbd_edpt_open
  (e.g. a UVC device with a notification EP + VC SET_INTERFACE). Verified on HW:
  lpc11u37 usbtest 30/30 and video_capture SET_INTERFACE cycling both fine.

- vendor_device set_alt: abort the outgoing altsetting's bulk/interrupt endpoints
  before dropping them, so an endpoint absent from the target altsetting can't
  stay armed and hold its usbd claim. (No in-tree trigger: usbtest uses a single
  non-zero altsetting; defensive robustness for multi-alt vendor devices.)

- vendor_device tud_vendor_n_mounted(): count iso endpoints too, so an iso-only
  altsetting reports mounted. (No in-tree trigger: usbtest alt1 always has bulk.)

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01HeF2gZ1M7GWkz6Av4BpKPg
</content>
</entry>
<entry>
<title>address Codex/Copilot review findings (9 fixed, 3 refuted with evidence)</title>
<updated>2026-07-06T17:30:07Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-06T17:30:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=f41c1827b2b59d1a0bdfc28bbe6580e5c44ef961'/>
<id>urn:sha1:f41c1827b2b59d1a0bdfc28bbe6580e5c44ef961</id>
<content type='text'>
- dcd(rp2040): rewind IN staging before the clear-halt re-issue. Staging advances
  user_buf/remaining_len when packets are copied into DPRAM, before the host has
  consumed them; aborting and re-issuing from the advanced pointer silently
  skipped the staged-but-unsent bytes.
- dcd(ip3511): dcd_edpt_iso_activate aborts a transfer still armed from the
  previous altsetting (clear Active on both buffer slots) so the hardware can't
  keep servicing the old descriptor against the class's fresh queueing.
- dcd(rusb2): reuse an endpoint's existing pipe in dcd_edpt_open. usbd_edpt_close
  is a no-op on ISO_ALLOC ports, so a class's close/open across SET_INTERFACE
  would allocate a second pipe with the same EPNUM and leak pipes.
- class(vendor): the buffered-mode free-slot check also tests the interrupt
  endpoints, so an interrupt-only vendor interface isn't clobbered as "free".
- bsp(ch32v30x): board_get_unique_id respects max_len and copies bytes
  (alignment-safe) instead of writing 12 bytes through a uint32_t cast.
- test/hil/usbtest.py: treat same-serial multi-matches as ambiguous and retry
  until the dual-port stale node drops (nanoch32v203/ch32v307 variants); reprobe
  a binding that predates the dynamic-id re-registration so a stale capability
  profile can't survive; skip the remove_id/unbind cleanup after an unrecovered
  kernel-side hang (it would join the D-state convoy and deadlock the bus).
- usbtest skip.txt: add the families whose DCD refuses dcd_edpt_iso_alloc
  (CXD56, FT90X, LPC175X_6X, LPC40XX, NUC100/120/505, PIC32MZ, SAMG, SAMX7X,
  VALENTYUSB_EPTRI) — tier 4 cannot enumerate there.
- test/hil/tinyusb-sudoer: note that '#1000' is a sudoers UID specifier, not a
  comment (the review misread the grants as commented out).

Refuted in review threads: nrf5x ISOSPLIT keeps reserve-max per-configuration
allocation semantics (iso_alloc is per-config, not per-alt); the LPC EP-number
claim (default descriptor uses EP1-3; lpcxpresso11u37 passes 30/30 on HW); the
vendor alt-0 "abort" concern (host cannot address endpoints outside the active
altsetting; usbd_edpt_iso_activate resets state on re-entry).

Verified on hardware: raspberry_pi_pico, lpcxpresso11u37, ra4m1_ek all 30/30
through the HIL battery after the changes; builds clean incl. buffered-mode
vendor (webusb_serial).

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01HeF2gZ1M7GWkz6Av4BpKPg
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'origin/master' into usbtest</title>
<updated>2026-07-06T09:17:17Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-06T09:17:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=2d73cf58de9a41278a9c6e1e3c9e5c6626bf95b7'/>
<id>urn:sha1:2d73cf58de9a41278a9c6e1e3c9e5c6626bf95b7</id>
<content type='text'>
# Conflicts:
#	lib/rt-thread/port/msc_device_port.c
#	src/device/usbd.c
</content>
</entry>
<entry>
<title>usbtest: address code-review findings (EP3 iso regression + 9 more)</title>
<updated>2026-07-06T04:53:40Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-06T04:53:40Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=24be2499839538b377927d30d4ab43122f337dff'/>
<id>urn:sha1:24be2499839538b377927d30d4ab43122f337dff</id>
<content type='text'>
Cross-checking the branch against the MCU datasheets surfaced a regression and
several latent defects. Fixes (finding # from the review):

#1 dcd_ch32_usbfs: restore EP3's enlarged iso buffer. CH32V20x/V30x/F20x USBFS
   give endpoint 3 a 1023-byte iso packet (CH32FV2x_V3xRM ch23; 16-bit
   R16_UEP3_T_LEN), unlike every other 64 B endpoint. Commit c05e9313e removed
   that buffer and capped iso at 64 B, breaking &gt;64 B FS iso (UVC/UAC) on EP3.
   Re-add it via CFG_TUD_WCH_USBFS_EP3_BUFSIZE, defaulted to 1023 on those parts
   (CH32_USBFS_EP3_1023_BUFSIZE in ch32_usbfs_reg.h) and 64 elsewhere.
#3 dcd_ch32_usbfs: make data.isochronous[] per-direction and clear it on
   endpoint (re)open, so a reused ep number can't inherit a stale iso response.
#7 dcd_ch32_usbfs: exempt iso from the PID_OUT data-toggle handling too (was
   only done for PID_IN); iso is DATA0-only in both directions.
#13 dcd_ch32_usbfs: bounds-assert ep &lt; EP_MAX in dcd_edpt_iso_alloc.
#2/#6 usbtest descriptors: TUD_OPT_HIGH_SPEED is a compile-time capability, not
   the live speed, so the full-speed config (and OTHER_SPEED) advertised int/iso
   mps 512 on HS boards — illegal at FS / over the 1023 B/frame iso budget. Split
   into FS-legal / HS descriptor sizes; the plain macro tracks operating speed.
#10 vendor: non-alt free-slot detection also checks the int endpoints (a vendor
   interface may now be interrupt-only, no bulk ep).
#14 vendor: replace the order-coupled ITF_MEM_RESET_SIZE ladder (2 unreachable
   branches) with offsetof(vendord_interface_t, tx_stream).
#5 rp2040: clear_stall re-issue preserves the already-transferred count so a
   mid-transfer clear-halt reports the full length, not just the remainder.
#8 rp2040: force single-buffering for iso (only BULK gets a double DPRAM buffer),
   so a multi-packet iso xfer can't spill buffer 1 into the next ep's DPRAM.

Verified: CH32V203 usbfs and CH583 still pass usbtest tier-4 30/30; all board
families build; pre-commit (format/codespell/unit) clean.

Co-Authored-By: Claude Opus 4.8 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01HeF2gZ1M7GWkz6Av4BpKPg
</content>
</entry>
<entry>
<title>dcd(rp2040): re-issue in-flight transfer on clear-halt data-toggle reset</title>
<updated>2026-07-03T05:34:12Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-03T05:34:12Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=ff5068f84127bc5502830129050c4c3b2cbd3a9b'/>
<id>urn:sha1:ff5068f84127bc5502830129050c4c3b2cbd3a9b</id>
<content type='text'>
usbtest case 29 clears the endpoint halt on a NON-stalled bulk endpoint to
reset the data toggle, then keeps streaming. rp2040's dcd_edpt_clear_stall
disarmed the buffer (*buf_reg = 0) with no completion event, so the usbd
claim leaked and the sink never re-armed -&gt; toggle desync (EINVAL). (dwc2
passes because its clear-stall re-toggles the surviving transfer in place;
rp2040 bakes the PID into the armed buffer and can't retoggle without
re-arming.)

Distinguish the two uses of clear-stall by the endpoint state: a real stall
leaves it IDLE (dcd_edpt_stall aborts), whereas a toggle-reset finds it
ACTIVE. In the ACTIVE case, abort (the RP2040-E2-safe way) and re-issue the
transfer with the toggle reset to DATA0 so it still completes and releases
the claim; the stall-recovery path is unchanged.

Full usbtest battery now 30/30 on raspberry_pi_pico (rp2040) and
adafruit_fruit_jam (rp2350), up from 29/30; dwc2 boards and test 13
(ep halt) unaffected.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01HeF2gZ1M7GWkz6Av4BpKPg
</content>
</entry>
<entry>
<title>license: use SPDX identifiers for src/ headers (#3749)</title>
<updated>2026-07-02T14:55:45Z</updated>
<author>
<name>Ha Thach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-02T14:55:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=7a4111b96ef6279e75579f9a18443834f6a0871d'/>
<id>urn:sha1:7a4111b96ef6279e75579f9a18443834f6a0871d</id>
<content type='text'>
* license: use SPDX identifiers for src/ headers

Replace the full ~20-line MIT license boilerplate on every src/ file with a
two-line SPDX tag (SPDX-FileCopyrightText + SPDX-License-Identifier), following
the REUSE convention used by CircuitPython and the Linux kernel. Removes ~3500
lines of duplicated boilerplate.</content>
</entry>
<entry>
<title>rp2040: fix host SET_REPORT (and any OUT-data control xfer) sending DATA0 instead of DATA1</title>
<updated>2026-05-15T19:28:21Z</updated>
<author>
<name>Boris Dolgov</name>
<email>boris@dolgov.name</email>
</author>
<published>2026-05-15T19:28:21Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=72e09788e46a8ffaaae8009a316915838927af90'/>
<id>urn:sha1:72e09788e46a8ffaaae8009a316915838927af90</id>
<content type='text'>
hcd_edpt_xfer() previously reset ep-&gt;next_pid to 1 only when the control
endpoint direction changed between stages. That handled IN-data control
transfers (e.g. GET_REPORT, GET_DESCRIPTOR) where SETUP is OUT and DATA is
IN, but not OUT-data class requests like SET_REPORT, where SETUP and DATA
are both OUT and the direction-change check is false. ep-&gt;next_pid was
left at 0 from hcd_edpt_open(), so the DATA stage went on the wire as
DATA0 when the device expected DATA1. Strict devices (observed: Elgato
Stream Deck) treat this as a protocol violation and disconnect.

Key off "endpoint 0" instead of "direction changed", restoring the
previous behavior. Interrupt/bulk endpoints take the ep-&gt;interrupt_num &gt; 0
branch above and never reach this code, so they are unaffected.
</content>
</entry>
<entry>
<title>Apply suggestion from @Copilot</title>
<updated>2026-04-02T16:55:12Z</updated>
<author>
<name>Ha Thach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-04-02T16:55:12Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=9515ba8e795a582f4e62955b8d4398066e2acbb1'/>
<id>urn:sha1:9515ba8e795a582f4e62955b8d4398066e2acbb1</id>
<content type='text'>
Co-authored-by: Copilot &lt;175728472+Copilot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>rp2040: fix RP2350 hard fault in unaligned_memcpy to USB DPRAM</title>
<updated>2026-04-02T16:50:12Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-04-02T16:50:12Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=c0c1566bea34419a8b165a489278114363de5a5e'/>
<id>urn:sha1:c0c1566bea34419a8b165a489278114363de5a5e</id>
<content type='text'>
Use volatile byte accesses to prevent the compiler from widening
the byte-by-byte copy loop into 16/32-bit accesses, which cause
a hard fault on RP2350 when targeting USB DPRAM (device memory).

Closes #3554
</content>
</entry>
<entry>
<title>fix issue caused by merging active + pending state</title>
<updated>2026-04-01T16:50:26Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-04-01T16:50:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=087ceb7417e6c1d72701ae491407490cfe5c6558'/>
<id>urn:sha1:087ceb7417e6c1d72701ae491407490cfe5c6558</id>
<content type='text'>
</content>
</entry>
</feed>
