Skip to content

Initial CH32H41X support#3642

Open
rhgndf wants to merge 7 commits into
hathach:masterfrom
rhgndf:ch32h41x
Open

Initial CH32H41X support#3642
rhgndf wants to merge 7 commits into
hathach:masterfrom
rhgndf:ch32h41x

Conversation

@rhgndf

@rhgndf rhgndf commented May 14, 2026

Copy link
Copy Markdown
Contributor

USB2 for CH32H41X, have not tested for all the possible firmwares yet. cdc_msc and uac2 seems to work. There is USB3 on the chip but this PR doesn't include it, I couldn't get it working.

Modified the dcd_ch32_usbhs driver by adding chip specific includes, inspired by the dwc2_* files. Maybe #3515 might be able to follow the same pattern.

The SWD pins and the USBHS DP/DM pins are the same, no way to remap away the SWD pins, only disable them. No idea why. For reliability, disconnect the debugger before plugging in the USB.

More usb weirdness: The usb isp is only accessible through the USBFS side, and it is triggered by some pull-up/down on the usb pins themselves and removed after boot.

@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

Top 10 targets by memory change (%) (out of 2345 targets) View Project Dashboard →

target .text .rodata .data .bss total % diff
ch32v307v_r1_1v0/hid_multiple_interface 11,324 → 11,336 (+12) 11,820 → 11,832 (+12) +0.1%
ch32v307v_r1_1v0/hid_boot_interface 11,348 → 11,360 (+12) 11,844 → 11,856 (+12) +0.1%
ch32v307v_r1_1v0/hid_composite 11,696 → 11,708 (+12) 12,192 → 12,204 (+12) +0.1%
ch32v307v_r1_1v0/midi_test 11,832 → 11,844 (+12) 12,328 → 12,340 (+12) +0.1%
ch32v307v_r1_1v0/audio_test 12,992 → 13,004 (+12) 13,504 → 13,516 (+12) +0.1%
ch32v307v_r1_1v0/cdc_dual_ports 13,100 → 13,112 (+12) 13,596 → 13,608 (+12) +0.1%
ch32v307v_r1_1v0/printer_to_cdc 13,292 → 13,304 (+12) 13,780 → 13,792 (+12) +0.1%
ch32v307v_r1_1v0/webusb_serial 13,512 → 13,524 (+12) 14,056 → 14,068 (+12) +0.1%
ch32v307v_r1_1v0/usbtmc 13,960 → 13,972 (+12) 14,576 → 14,588 (+12) +0.1%
ch32v307v_r1_1v0/audio_test_multi_rate 14,116 → 14,128 (+12) 14,632 → 14,644 (+12) +0.1%

@rhgndf rhgndf force-pushed the ch32h41x branch 2 times, most recently from da4d03d to 4168a12 Compare May 26, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants