Skip to content

Host_ch32v3xx

mean00 edited this page Apr 2, 2024 · 1 revision

Using a CH32V3xx (RISCV) to debug

You'll need a CH32V3x with 256kB flash and 64 kB RAM. I personnaly use CH32V303RCT6, it is cheap and works well You can use an evaluation board or the PCB given in the kicad folder

Building

You'll need

  • a recent RISCV-Clang (see https://github.com/mean00/LLVM-embedded-toolchain-for-rv32

  • rust nightly + arm toolchain

  • update platformConfig.Cmake to point to your toolchain location

  • Edit build_default.make , just leave SET(USE_CLANG True CACHE INTERNAL "") SET(USE_CH32V3x True CACHE INTERNAL "") SET(USE_CH32v3x_HW_IRQ_STACK TRUE CACHE INTERNAL "") SET(USE_HW_FPU TRUE CACHE INTERNAL "")

  • make build && cd build && cmake .. && make -j 4, you 'll end up with a .elf, .bin and .ck_bin

Pinout

  • SWDIO : PB8
  • SWDCLK : PB9
  • RESET : PB6
  • Uart : PB10 (Tx), PB11 (RX)

Rebooting to fw update

You can then upload the .ck_bin through DFU sudo dfu-util -d 1d50:6030 -s 0x0004000:leave -D swindle_default_pinout_CH32V3x_144M_CLANG.elf.ck _bin

If you are running an older version : do it once, the led will blink quickly and it will fail wait 5s and do it again

Clone this wiki locally