<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinyusb.git/src/class, 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/class?h=worktree-ch569-hydrausb3</id>
<link rel='self' href='http://cgit.235523.xyz/tinyusb.git/atom/src/class?h=worktree-ch569-hydrausb3'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/'/>
<updated>2026-07-08T05:26:08Z</updated>
<entry>
<title>Merge branch 'usbtest': Linux kernel usbtest battery support</title>
<updated>2026-07-08T05:26:08Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-08T05:26:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=4ab165639e9eb520329b3c1ba8bd7d45bf2bf44b'/>
<id>urn:sha1:4ab165639e9eb520329b3c1ba8bd7d45bf2bf44b</id>
<content type='text'>
Brings the usbtest device example (gadget-zero source/sink peer for the
kernel's usbtest.ko/testusb), the test/hil/usbtest.py battery runner and
the extended vendor class driver (interrupt/isochronous endpoints, alt
settings) into the CH569 SuperSpeed branch, enabling the battery to run
against both CH56x dcds.

Conflict resolution: test/hil/tinyusb.json keeps this branch's
hydrausb3_v1 fixture entry and adds the usbtest branch's
ch32v307v_r1_1v0 entry.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_019MRGjBT2NBkCoWwyDT4LaE
</content>
</entry>
<entry>
<title>Add SuperSpeed descriptors to all bulk/interrupt class drivers and examples</title>
<updated>2026-07-07T11:12:02Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-07T11:12:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=5418b836d5bd48eb9a7a6418393e6c87d0112f11'/>
<id>urn:sha1:5418b836d5bd48eb9a7a6418393e6c87d0112f11</id>
<content type='text'>
Class drivers: skip and account the SS endpoint companion descriptor in
every descriptor walk (hid, midi, midi2, ecm_rndis, printer, mtp, usbtmc),
via a shared usbd_skip_ss_ep_companion() helper in usbd_pvt.h (cdc/ncm
already handled; vendor/dfu naturally tolerant). usbtmc buffer grows to
1024 at SS to satisfy its packet-multiple assert. bth/audio/video are left
FS/HS-only (ISO-centric; ISO is unsupported on the CH569 dcd).

usbd.h: new SS template macros TUD_HID_SS_DESCRIPTOR(+INOUT),
TUD_MIDI_SS_DESCRIPTOR (+ DESC_EP_SS part), TUD_MIDI2_DESC_ALT1_EP_SS,
TUD_PRINTER_SS_DESCRIPTOR, TUD_MTP_SS_DESCRIPTOR,
TUD_USBTMC_BULK_SS_DESCRIPTORS/INT_SS_DESCRIPTOR, with _SS_DESC_LEN
counterparts (bulk endpoints hardcode 1024, companion after every EP).

Examples: 17 bulk/interrupt examples gain the full SS descriptor set
(EP0 512/64 clamp, SS device descriptor bcdUSB 3.20 mps0=2^9, SS config
with companions, BOS caps, speed-switched callbacks): cdc_dual_ports,
cdc_msc_freertos, dfu, dfu_runtime, dynamic_configuration,
hid_boot_interface, hid_composite(+freertos), hid_generic_inout,
hid_multiple_interface, midi_test(+freertos), midi2_device, msc_dual_lun,
mtp, printer_to_cdc, usbtmc, webusb_serial. msc_dual_lun is un-skipped for
CH569 using read-only flash disks (16KB RAM can't hold two 8KB RAM disks,
same as ch32v10x/v20x boards).

Validation: full example sweep green for hydrausb3_v1 (SPEED=super, 19
device ELFs) and raspberry_pi_pico; wTotalLength == sizeof() verified for
every SS configuration array in the built ELFs; ceedling 65/65;
pre-commit clean; code-size delta +0.0% on rp2040 (SS code folds out on
non-SS builds).

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_019MRGjBT2NBkCoWwyDT4LaE
</content>
</entry>
<entry>
<title>Add SuperSpeed support to CDC-NCM and enable iperf on CH569</title>
<updated>2026-07-07T06:03:25Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-07T06:03:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=149b91c0667eca43d5d5a11aae2d6e1d0c25c17d'/>
<id>urn:sha1:149b91c0667eca43d5d5a11aae2d6e1d0c25c17d</id>
<content type='text'>
- TUD_CDC_NCM_SS_DESCRIPTOR template (bulk 1024 + endpoint companions)
  and companion handling in netd_open (notification endpoint skip,
  bulk pair drv_len)
- net_lwip_webserver: SS device/config/BOS descriptors for the NCM
  build, CH569 added to the LWIP_HIGH_THROUGHPUT tier (builds lwiperf).
  The 16 KB RAMS cannot hold lwIP: heap and pools go to the 32 KB RAMX
  via LWIP_DECLARE_MEMORY_ALIGNED (arch/cc.h), with a 6-pbuf pool /
  6*MSS window and a 3 KB dcd bounce pool to fit (RAMX 92%)
- CH569 dcd fixes found while bringing this up: TMR0 counts only 26
  bits, so the previous 1 s fallback CNT_END (120e6 &gt; 2^26) silently
  never expired - use 0.55 s per phase; make link busy-waits in
  usb30_hw_init best-effort so a stuck-BUSY teardown state cannot
  abort re-initialization half way

Builds clean (full ch56x example sweep); NOT yet hardware-validated:
the rig's WCH-LinkE stopped completing flash writes mid-session (reads
and erases fine), leaving the board without firmware - iperf numbers
pending physical probe/board recovery.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<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>Add core SuperSpeed device support</title>
<updated>2026-07-07T02:46:25Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-07T02:46:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=67818cb975a7634646c314f9ab96ccb3413e565d'/>
<id>urn:sha1:67818cb975a7634646c314f9ab96ccb3413e565d</id>
<content type='text'>
Groundwork for TinyUSB's first SuperSpeed port (WCH CH569):
- TUSB_SPEED_SUPER, OPT_MODE_SUPER_SPEED, TUD_OPT_SUPER_SPEED and
  TUP_RHPORT_SUPERSPEED capability plumbing
- Allow CFG_TUD_ENDPOINT0_SIZE 512 on SS builds; EP0 control transfers
  chunk at the runtime link speed (512 at SS, 64 on USB2 fallback)
- Handle SET_SEL, SET_ISOCH_DELAY and U1/U2_ENABLE feature requests
- Tolerate SS endpoint companion descriptors in usbd_open_edpt_pair,
  cdcd_open and mscd_open interface parsing
- SS descriptor types/structs and template macros: endpoint companion,
  BOS USB2-extension + SuperSpeed capability, SS config and
  CDC/MSC/vendor SS variants (bulk fixed at 1024)
- cdc_msc example: SS device/config/BOS descriptors, speed-aware sizes
- Unit tests: SS endpoint validation, companion-tolerant endpoint pair
  open, SET_SEL, SET_ISOCH_DELAY

All SS paths compile out when disabled: verified 0-byte code-size delta
on stm32f407disco (MinSizeRel) vs master; 65/65 unit tests pass.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>address review round 2 (4 fixed, 1 answered)</title>
<updated>2026-07-06T18:23:38Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-06T18:23:38Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=abd8769781e38bb14153dd6f9dedcc5b3c7b7be2'/>
<id>urn:sha1:abd8769781e38bb14153dd6f9dedcc5b3c7b7be2</id>
<content type='text'>
- dcd(nrf5x): dcd_edpt_iso_activate drops a stale armed transfer (started/
  data_received/iso_in_transfer_ready) — there is no dcd close on this port, so
  a transfer armed before SET_INTERFACE would trip TU_ASSERT(!xfer-&gt;started) on
  the class's next arm after usbd reset the endpoint's claim state.
- class(vendor): tud_vendor_n_mounted() counts the interrupt endpoints, so an
  interrupt-only vendor interface (bulk absent) reports mounted.
- example(usbtest): int/iso write lengths follow the negotiated speed
  (tud_speed_get), not the compile-time capability — a high-speed build
  enumerated at full speed serves the FS descriptor (mps 64/128) and must not
  submit HS-sized packets.
- test/hil: test_example() return annotation matches the (err, status, metric)
  3-tuple it returns.

Verified: feather_nrf52840_express and raspberry_pi_pico 30/30 through the HIL
battery; pico/feather/ch32v307-usbhs builds clean.

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>fix CI: clang/IAR unused helpers, LTO-dropped ISR symbol, LPC11/13 USB RAM overflow</title>
<updated>2026-07-06T10:55:26Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-06T10:55:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=59f15ad44d4121630368e54cf52287f5a814e787'/>
<id>urn:sha1:59f15ad44d4121630368e54cf52287f5a814e787</id>
<content type='text'>
Four PR-CI failures, each with a distinct root cause:

- class/vendor: mark the shared non-buffered transfer helpers TU_ATTR_UNUSED.
  In buffered mode with the int/iso endpoint gates off none is referenced, and
  clang (-Wunused-function -Werror) and IAR (Error[Pe177]) reject an unused
  static — gcc does not, which is why only the clang/IAR matrix failed.
- bsp/ch32v20x: keep dcd_int_handler alive under LTO. The `call` sits inside
  naked asm where LTO cannot see it, so -flto make builds internalized the
  symbol and every ch32v20x device example failed to link (cmake has no LTO,
  which masked it). A TU_ATTR_USED function-pointer reference pins it.
- usbtest: LPC11/13 (ip3511 FS) keep endpoint buffers in a dedicated 2 KB USB
  RAM; the 2048 B bulk epbuf overflowed it (RamUsb2 150%) in make builds. Use
  512 B (= 8 FS packets) on those parts; lpcxpresso11u37 still passes 30/30.
- test/hil: skip device/usbtest on lpcxpresso43s67 (hfp rig) — its ip3511 HS
  port wedges from the first control case (1/30) and needs on-rig debugging.

Verified: make builds link for nanoch32v203 (dfu_runtime + usbtest),
lpcxpresso11u37 and lpcxpresso1347 (RamUsb2 75%); buffered-mode webusb_serial
builds; 61/61 unit tests; lpcxpresso11u37 usbtest 30/30 on hardware with the
smaller epbuf.

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 remaining review findings (rusb2 #11/#12, vendor #15)</title>
<updated>2026-07-06T07:03:10Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-06T07:03:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=3345e80d843a6c13543311bf0eda8cd1bf40604f'/>
<id>urn:sha1:3345e80d843a6c13543311bf0eda8cd1bf40604f</id>
<content type='text'>
#12 dcd(rusb2): key the bulk-OUT clear-stall re-arm on a new per-pipe `queued`
   flag instead of `pipe.buf != NULL`. A zero-length OUT read leaves buf==NULL
   while still armed, so the old test skipped the re-assert and the endpoint
   NAKed forever after CLEAR_FEATURE(HALT). `queued` is set at submit and
   cleared at completion (and on pipe teardown).
#11 dcd(rusb2): retry a zero-length IN packet that couldn't be queued at submit
   (double-buffered pipe full, host not draining). Previously the ZLP was
   dropped and the next BRDY reported a phantom completion for a packet the host
   never received; now it's deferred to BRDY via `zlp_pending` and only
   completes once actually queued and sent.
#15 vendor: collapse the byte-identical bulk/interrupt/isochronous non-buffered
   write / write_available / read_xfer triples into three shared static-inline
   helpers keyed on (endpoint, epbuf, bufsize).

Verified on ra4m1_ek: usbtest tier-4 30/30 (rusb2 + vendor refactor); pre-commit
(format/codespell/unit) clean. The nRF54LM20 DK also passes 30/30 at high speed.

Co-Authored-By: Claude Opus 4.8 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01HeF2gZ1M7GWkz6Av4BpKPg
</content>
</entry>
</feed>
