Skip to content

meta: CH32V bench-readiness sweep - deployment-strategy audit + 13 findings (post-#1102) #1130

Description

@zackees

Follow-up sweep to #1102 (closed today by PRs #1110#1116), run against main @ 69b51cf ahead of the CH32V hardware bench test in two days (2026-07-23). Two questions: (1) what bugs remain in the CH32V pipeline, and (2) is the deployment strategy right, or do we need a different one / several? Cross-checked against the pinned OpenWCH core (arduino_core_ch32 @ d767162), WCH datasheets (wch-ic.com; mirrors cited below — FastLED/datasheets has no WCH docs yet, see FastLED/datasheets#6), the WCH-Link User Manual V2.3, and the wlink/wchisp/minichlink/probe-rs/Community-PIO sources.

TL;DR in plain terms

Sub-issues (work top-down; one PR per issue)

Blocks the bench (fix before 2026-07-23):

Deployment strategy (decision above; implementation):

Hygiene / follow-ups:

Deployment strategy — the audit in full

Why not one strategy? The chips split into two hardware classes:

Class Chips Flash paths that exist Probe-free possible?
SDI-only CH32V003, CH32V006 1/2-wire SDI (WCH-LinkE only — old WCH-Link can't do it); UART bootloader exists but is software-entry-only (no BOOT pin) → unreachable on a blank chip No
USB-bootloader V103, V203, V208, V303, V307, X035, L103 SWD/SDI probe; factory USB+UART ISP via BOOT0 (X035: PC16/PC17 power-on trick, no BOOT pin) Yes (wchisp)

Tool ranking for fbuild (full matrix + sources in #1123/#1124):

  1. wlink v0.1.2 (primary): all 9 series, one code path, Rust, MIT/Apache-2.0, per-OS release assets → fits our pinned-flasher model exactly. Gaps: no linux-aarch64/macos-x64 assets; "not production ready" disclaimer → smoke-test per family before bench day.
  2. wchisp v0.3.0 (fallback): probe-free for the USB class; needs user BOOT0 entry + WinUSB driver on Windows; stable release does NOT support V00x.
  3. probe-rs (fast-follow): native WCH-Link driver + released CH32V0/V2/V3 flash algorithms in v0.31.0; V103/X035/L103/V006 targets master-only. Cheap for us later since we already pin probe-rs — not for bench day.
  4. minichlink: keep as the manual fallback it already is in our error message; no release binaries of its own.
  5. WCH OpenOCD fork (PlatformIO's default wch-link protocol): no license file, source by email — do not pin or redistribute. Our board JSONs keep the wch-link protocol name for PIO parity, but fbuild should never ship that binary.

Board-JSON parity check: our protocols: ["wch-link","minichlink","isp","wlink"] matches Community-PIO exactly — correct except the isp entry on V003/V006 (#1125, PIO's list is equally wrong there).

Bench-day recipe that works on current main (once #1117 lands)

  1. soldr cargo run -p fbuild-cli -- build tests/platform/<env> -e <env> (on Windows, non-V003 targets also need fix(toolchain): riscv g++ -isystem set misses the default multilib dir - rv32imac CH32V C++ builds fail on Windows #1118).
  2. Flash: wlink flash <project>/.fbuild/build/<env>/firmware.bin with a WCH-LinkE (firmware ≥ 2.15, RV mode — if it enumerates as 1a86:8012 run wlink mode-switch). Old CH549 WCH-Link cannot flash V003/V006/X035/L103.
  3. Monitor: fbuild serial probe listfbuild serial probe read --port COMx --baud 115200 --seconds N (NOT bare fbuild monitorfix(monitor): fbuild monitor never streams serial lines; bare invocation returns immediately; default port is /dev/ttyUSB0 on Windows #1122), or Python fbuild.api.SerialMonitor.
  4. Pre-install Windows drivers before the bench: WCH-LinkE RV mode WinUSB (via WCH-LinkUtility/MounRiver); Zadig WinUSB for 55e0 if trying ISP.
  5. Expect under-clocked firmware until fix(ch32v): no SYSCLK_FREQ_* define injected - all CH32V firmware runs at reset-default HSI (2-18x under-clocked) #1119 lands — LED protocol tests will fail even on a good flash; X035 blink runs visibly ~6× slow.

Verified reference facts

Sweep run 2026-07-21 with four independent audit passes (build pipeline, board data, deploy/serial, deployment-strategy research); every CRITICAL/HIGH was re-verified by hand before filing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions