Skip to content

meta: CH32V003 bring-up — fbuild hardware validation + FastLED platform port #1209

Open

Description

@zackees

Goal

Get a WCH CH32V003 driving WS2812s under FastLED, built and flashed by fbuild. Hardware is on the bench. This is the tracking issue; all work happens in the two children.

Children

# Repo Scope Blocked by
#1208 fbuild Validate the existing CH32V pipeline on real silicon; close hardware-visible gaps —
FastLED/FastLED#3755 FastLED src/platforms/wch/ platform port (detection, fastpin, clockless, CI) Phase 2 needs #1208

Target

CH32V003F4P6 — RV32EC @ 48 MHz, 16 KB flash / 2 KB SRAM, no hardware multiply, 16 registers (ilp32e), single-wire debug (SWIO), no USB peripheral. Programmer: WCH-LinkE (1A86:8010 RV mode). wchisp is not usable — V003 has no factory USB-ISP bootloader.

State of play

fbuild is ~90% done but 0% proven. Toolchain (xPack riscv-none-elf-gcc 14.2.0-3), orchestrator, 17 CH32 board JSONs, wlink deployer, and green CI all landed across #1102–#1130. None of it has ever executed on silicon — it is entirely compile-verified. #1208 is validation, not implementation.

FastLED has nothing. No src/platforms/wch/. The only artifact is ci/boards/package_ch32v_index.json (commit 5cf16c9157, 2025-10-24) — a board-manager index snapshot, never wired to anything. #3755 is a from-scratch port.

Critical path

#1208 Phase 0  probe enumerates            ── hardware gate
#1208 Phase 1  build → .bin under 16 KB
#1208 Phase 2  flash → measured blink      ── BRING-UP MILESTONE
      │
      ├─ #3755 Phase 0  multiply-free feasibility spike  (can start now, no HW)
      ├─ #3755 Phase 1  platform skeleton, GPIO toggle
      └─ #3755 Phase 2  clockless driver → WS2812 on a scope   ── needs #1208 P2
         #3755 Phase 3  CI integration

#3755 Phase 0 and #1208 Phase 0/1 are independent — run them in parallel.

Risks

  1. No hardware multiply is the project risk. scale8, nscale8x3, hsv2rgb_rainbow all become libgcc softmul calls inside a 16 KB budget. #3755 Phase 0 measures this before any platform code is written. If it doesn't fit, the port needs multiply-free variants and the plan changes shape.
  2. 2 KB SRAM is below every supported FastLED part. The tiny memory class is documented <=1KB and holds the ATtinys; 16 KB flash is smaller than anything in the tree. Tiering in sketch_macros.h and ci/boards.py needs extending.
  3. Toolchain split-brain. fbuild uses xPack GCC 14 + -march=rv32ec_zicsr; FastLED's ci/boards.py assumes framework="arduino", which pulls PlatformIO's GCC 8.2.0 + rv32ecxw (WCH's proprietary extension). Same chip, two toolchains, two CI paths. Unresolved — tracked in #3755.
  4. __riscv gates assume ESP-IDF. FastLED treats RISC-V as a sub-branch of ESP. This bit us in #2576/#2577 (fast_isr.S re-gated on __riscv_atomic because C3 lacks A). RV32EC lacks A and M.
  5. platforms.h's final #else is AVR, not #error — an unrecognized CH32V003 silently compiles against AVR headers.

Decisions taken

  • Toolchain: what fbuild already ships (xPack riscv-none-elf-gcc 14.2.0-3, -march=rv32ec_zicsr -mabi=ilp32e). Lowest risk, already wired end-to-end, matches ch32fun. Not the OpenWCH GCC 8.2.0 / rv32ecxw path. Revisit only if bring-up surfaces a codegen problem.
  • Framework: arduino. framework = ch32v003fun is rejected by validate_ch32v_framework() today and stays out of scope (fbuild#1108).
  • WCH-LinkE USB IDs go to the FastLED/boards registry, not fbuild. Per CLAUDE.md, VID/PID must never be embedded in this repo.

Out of scope

minichlink deployer · GDB / fbuild debug for CH32V · QEMU rv32 emulation · probe-rs (upstream doesn't support CH32 — probe-rs#28) · framework = ch32v003fun (fbuild#1108)

Done when

A CH32V003 runs a FastLED sketch driving a physical WS2812 strip, built and flashed end-to-end by fbuild deploy, with CI compile coverage in both repos.

Activity

  1. zackees commented on Dec 4, 2026

    @zackees
    MemberAuthor

    Steward triage — hardware-gated; no software-reachable cell remains in fbuild

    Re-verified 2026-12-04T17:5xZ on origin/main c34febb5.

    The host has no CH32V003 programmer. USB inventory read from /sys/bus/usb/devices: 303a:1001 (ESP32-C6 USB-JTAG, ttyACM1) and 1fc9:0132 (NXP LPC11U3x CMSIS-DAP, ttyACM0). Zero 1a86:* nodes — no WCH-LinkE in RV mode (1a86:8010) and none in DAP mode (1a86:8012), so #1208 Phase 0 ("probe enumerates") and therefore Phase 2 ("flash -> measured blink") cannot be attempted at all.

    Everything software-reachable is green on current main (drift check, not a five-month-old claim):

    1. build-ch32v003.yml nightly run 47322741605 on 6d8670e6 (ancestor of today's main) — SUCCESS. Quick build: 12,260 B flash / 1,276 B RAM. Release firmware.bin: 8,892 / 16,384 B flash (54.3 %), 1,176 / 2,048 B RAM (57.4 %), with [email protected] and [email protected]+d767162.ch32l103 resolved by URL + sha256, and the "no stray files" guard clean.
    2. The no-hardware rot test try_install_wlink_from_pinned_release passes on c34febb5: the pinned wlink-v0.1.2-linux-x64.tar.gz downloads, SHA-256 verifies, extracts, and wlink --version prints wlink 0.1.2. The pinned release URL + checksum are not rotted (test result: 1 passed; 0 failed; 344 filtered out).
    3. CH32V003 hardware bring-up: validate the existing CH32V pipeline on real silicon #1208's own status record (2026-07-29) already closes every software phase: Phase 1 ✅ (built on the real xPack toolchain, RVE in the ELF flags), Phase 3 ✅, Phase 4 ✅ except BOARD_STATUS.md, which is deliberately left at compile-verified because claiming hardware-verified would be false.

    What is left cannot be done from this repo:

    Recording a hardware block on this tracking issue so the steward stops re-topping it every tick. Re-verify (--unblock-issue 1209) when a 1a86:8010 / 1a86:8012 device enumerates on the bench host, or when this issue body is edited to add a cell that does not need silicon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions