<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinyusb.git/src/portable/wch/ch32_usbfs_reg.h, branch codex/class-reference-docs</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/tinyusb.git/atom/src/portable/wch/ch32_usbfs_reg.h?h=codex%2Fclass-reference-docs</id>
<link rel='self' href='http://cgit.235523.xyz/tinyusb.git/atom/src/portable/wch/ch32_usbfs_reg.h?h=codex%2Fclass-reference-docs'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/'/>
<updated>2026-07-09T16:38:45Z</updated>
<entry>
<title>dcd(ch32-usbfs): isochronous support</title>
<updated>2026-07-09T16:38:45Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-09T16:38:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=c97c0a12bc5ab8e79aa3db0a777e0219692b5751'/>
<id>urn:sha1:c97c0a12bc5ab8e79aa3db0a777e0219692b5751</id>
<content type='text'>
Double-buffered iso, EP3 1023-byte packets on V20x/V30x (10-bit
R16_UEP3_T_LEN), CH583 and V103 enabled at 64 B.

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>hw/bsp+wch: rename the CH58x family to ch583 and OPT_MCU_CH58X to OPT_MCU_CH583</title>
<updated>2026-06-22T08:23:08Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-06-22T08:23:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=eda704ca1acef9691b51e17026765f497b1fffbe'/>
<id>urn:sha1:eda704ca1acef9691b51e17026765f497b1fffbe</id>
<content type='text'>
The BSP family and MCU option were named "ch58x"/"CH58X", but the supported part is
the CH583/CH582 (and the SDK repo is openwch/ch583); CH585 is a separate MCU family,
so the CH58x umbrella was misleading. Rename to the specific family:

- hw/bsp/ch58x -&gt; hw/bsp/ch583 (dir), and the BSP-local files ch58x_it.* -&gt;
  ch583_it.*, system_ch58x.* -&gt; system_ch583.* (include guards/refs updated). The
  vendor SDK files (CH58x_common.h, CH58x_*.c in hw/mcu/wch/ch583) keep their names.
- OPT_MCU_CH58X -&gt; OPT_MCU_CH583 in tusb_option.h, tusb_mcu.h, and the shared WCH
  USBFS driver (ch32_usbfs_reg.h, dcd_ch32_usbfs.c). OPT_MCU_CH582 is kept as an
  alias (same value), so either name selects the same code.
- FAMILY_MCUS CH58X -&gt; CH583, CFG_TUSB_MCU=OPT_MCU_CH583, mcu:CH58X -&gt; mcu:CH583 in
  the example skip lists, the CI build matrix (ci_set_matrix.py), the get_deps family
  tag, and docs/reference/boards.rst.

Board names (ch582m_evt, yd-ch582m) are unchanged. Verified: make + cmake build for
ch582m_evt, and ci.lan HIL (all device examples pass).

Co-Authored-By: Claude Opus 4.8 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>dcd/ch58x: report bus resume instead of a second suspend</title>
<updated>2026-06-19T15:58:17Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-06-19T15:58:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=a5292288b20abbfa3990a4dbc3acf8ff650c5e5b'/>
<id>urn:sha1:a5292288b20abbfa3990a4dbc3acf8ff650c5e5b</id>
<content type='text'>
The USBFS SUSPEND interrupt fires on both the suspend and the resume edge, but the
handler unconditionally posted DCD_EVENT_SUSPEND. On CH58x tud_resume_cb() therefore
never ran, and a device that lowered clocks/power in tud_suspend_cb() was never told
to restore them. Read MIS_ST's suspend bit (1 while suspended, 0 once resumed) to emit
DCD_EVENT_RESUME on the wake edge -- what the removed dcd_ch58x_usbfs.c did. Scoped to
CH58x via #if; the CH32 parts keep their existing behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>dcd/ch58x: complete the EP register map and right-size EP buffers</title>
<updated>2026-06-19T14:37:52Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-06-19T14:37:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=dcb060c894713d60ce0ab009733e5d59a32d0d23'/>
<id>urn:sha1:dcb060c894713d60ce0ab009733e5d59a32d0d23</id>
<content type='text'>
Tidy the CH58x register/buffer layout the initial port left rough.

Register map (USBOTG_FS_TypeDef):
- Extend the struct to the full CH583/582 datasheet Table 17-2 map instead of
  stopping at UEP567_MOD (0x0E) with the per-endpoint registers living only in
  raw-address macros.
- Express the per-endpoint DMA/length/control registers as arrays of 4-byte
  slots (ch58x_ep_dma_t / ch58x_ep_ctrl_t): EP0-3 DMA at 0x10, EP0-4 ctrl at
  0x20, EP5-7 DMA/ctrl split to 0x54/0x64 (EP4 has no DMA register of its own;
  it shares EP0's). TU_VERIFY_STATIC pins the slot sizes and block offsets, so
  the EP_TX_LEN/EP_CTRL/EP_DMA macros walk each block by the 4-byte stride
  (pointer arithmetic off slot 0, so the unused ternary branch can't trip
  -Warray-bounds).
- Gate the two driver sites on CFG_TUSB_MCU == OPT_MCU_CH58X directly rather
  than the CH32_USBFS_EP_REGS_CUSTOM alias, which was only ever defined in the
  CH58x branch.

EP buffers (the data struct):
- Replace buffer[EP_MAX][2][64] on CH58x with named per-endpoint buffers: EP0/EP4
  use the dedicated 192B ep0_ep4_buffer, so the old array left buffer[0]/buffer[4]
  allocated-but-unused.
- Drop EP3's oversized iso buffer (out[64] + in[1023]); EP3 is bulk-only on CH58x,
  so it uses a plain 128-byte buffer like the others. The data struct shrinks from
  ~2636 to 1292 bytes.
- Keep the now uniformly-64-byte buffers safe: dcd_edpt_iso_alloc()/iso_activate()
  refuse isochronous on CH58x (no iso support; 8-bit T_LEN caps a packet at 255B),
  and update_in()/update_out() additionally cap each packet copy to 64 bytes so a
  class that ignores the iso-alloc result cannot run a memcpy past a buffer into a
  neighbour's.

Non-CH58x parts (e.g. ch32v103) keep the struct-based macros, buffer[EP_MAX], and
the iso buffer unchanged. Verified on ch582m_evt HIL (ci.lan): all device examples
pass; ch32v103 build unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>dcd/ch58x: drive CH582/583 with shared dcd_ch32_usbfs.c</title>
<updated>2026-06-18T10:59:30Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-06-18T10:59:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=ea5b8d677f22f4bd1574f864fd0487dfd329c090'/>
<id>urn:sha1:ea5b8d677f22f4bd1574f864fd0487dfd329c090</id>
<content type='text'>
Replace PR #3515's separate dcd_ch58x_usbfs.c / hcd_ch58x_usbfs.c with the
shared WCH USBFS device driver (combined per-endpoint control, like CH32V103),
adding two CH58x-specific behaviors guarded so CH32V103/V20x/V307 are unchanged:

- CH32_USBFS_EP_MANUAL_TOG: CH58x's hardware AUTO_TOG does not stay in sync, so
  the ISR toggles DATA0/DATA1 manually and discards toggle-mismatched OUT
  packets. Fixes multi-packet bulk-IN (e.g. MSC READ10) that otherwise hung.
- CH32_USBFS_EP4_SHARES_EP0: EP4 has no DMA register and overlays EP0's region
  (EP0[0:63] + EP4 OUT[64:127] + EP4 IN[128:191]); add a 192-byte shared buffer
  and buffer-pointer helpers (transparent for the other parts). Fixes
  cdc_dual_ports (Port1 is on EP4).

Add the ch582m_evt board. Device only on USB0 (rhport 0): the shared
hcd_ch32_usbfs.c is CH32V20x-specific and cannot drive CH58x, so host / USB2
(rhport 1) is left commented out in the BSP for easy re-add.

Verified on ch582m_evt via local HIL: all device examples pass.

Co-Authored-By: Claude Opus 4.8 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>dcd/ch32_usbfs: support CH32V103 combined endpoint control register</title>
<updated>2026-06-18T03:58:58Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-06-18T03:58:58Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=ad8cbc4668ab8d92e2eebb834c230e9d18ad8e57'/>
<id>urn:sha1:ad8cbc4668ab8d92e2eebb834c230e9d18ad8e57</id>
<content type='text'>
CH32V103 uses the older USBFS IP: a single combined UEPn_CTRL register per
endpoint (IN response in bits [1:0], OUT response in [3:2], shared auto-toggle,
separate IN/OUT toggles) instead of the separate UEPn_TX_CTRL/UEPn_RX_CTRL
bytes of the newer IP (CH32V20x/V307). The shared driver was written for the
newer IP, so EP0 control transfers never worked on V103: the OUT response was
written to a reserved byte and the IN write clobbered the OUT bits.

- ch32_usbfs_reg.h: annotate the V103 register struct with byte offsets and add
  a union exposing the combined UEPn_CTRL at the UEPn_TX_CTRL offset; define
  CH32_USBFS_EP_CTRL_COMBINED and the combined-register bit positions.
- dcd_ch32_usbfs.c: abstract EP control access behind ep_tx/rx_ctrl_set() (full
  write) and ep_tx/rx_set_response() (response-only RMW). The newer-IP path is
  unchanged; the combined path read-modify-writes the single register and arms
  the post-SETUP data stage at DATA1.
- bsp/ch32v10x: implement board_get_unique_id() (real chip UID) and drop the
  CSR 0x800 writes that corrupted the QingKe V3 interrupt config and left all
  interrupts disabled (the USB ISR never ran).

Verified on ch32v103r_r1_1v0: enumerates and passes HIL for cdc_msc, hid,
msc, midi, mtp, dfu, etc.

Co-Authored-By: Claude Opus 4.8 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>add ch32v103 bsp support, compile but does not run, probably due to compile/linker issue</title>
<updated>2024-06-14T09:06:37Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2024-06-14T09:06:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=33f5547ed435f33259afc2a8e906eb7a258fbdd6'/>
<id>urn:sha1:33f5547ed435f33259afc2a8e906eb7a258fbdd6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>use stock core_riscv.h for ch32 v2 v3</title>
<updated>2024-06-14T05:51:28Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2024-06-14T05:51:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=2ed027f2bdedae81f20d7417ad7f018a6de9357a'/>
<id>urn:sha1:2ed027f2bdedae81f20d7417ad7f018a6de9357a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>code format</title>
<updated>2024-05-20T10:41:48Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2024-05-20T10:32:40Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=07d879378f052386699aba1eb41f04d4d32fb865'/>
<id>urn:sha1:07d879378f052386699aba1eb41f04d4d32fb865</id>
<content type='text'>
 add missing MIT license
</content>
</entry>
</feed>
