Open chrysn opened 3 months ago
A few notes from digging further:
A few field notes for anyone who wants to do this:
cargo run --example=blinky
, which calls out to wchisp.
Here's a udev rules file that is serving me well (/etc/udev/rules.d/54-wch-link.rules
):
# WCH-Link debug probe
# 8012 is the default DAP mode, 8010 is when it is switched to RV mode (using `wlink mode-switch --rv` with tool from https://github.com/ch32-rs/wlink)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="801[02]", GROUP="plugdev", MODE="0660"
# WCH devices in bootloader mode
SUBSYSTEMS=="usb", ATTRS{idVendor}=="4348", ATTRS{idProduct}=="55e0", GROUP="plugdev", MODE="0660"
Beware that the referenced ch58x-hal is an older version, nowadays https://github.com/ch32-rs/ch58x-hal provides that crate. Which is nice because it also has BLE support (based on a statically linked library; same goes for their EEPROM access and flash write access), but the blinky example only works half (it flashes the LED and then doesn't do anything further), which I haven't tried to debug yet.
Description
There's a RISC-V (RV32IMAC) chip family called CH58x (sometimes also CH5xx, prominently CH582 and CH583) from Nanjing Qinheng Microelectronics Co., Ltd. (https://www.wch.cn/ / http://www.wch-ic.com/).
The chips runs at 32MHz, feature around 0.5MiB flash, 30KiB RAM, BLE radio and dual USB (host and device), and uses as little as 1.8V at some devices. According to the data sheet, it uses a QingKe implementation of RISC-V.
Applications / boards
The chips are cheap in their category (LCSC has CH582 at 1.11USD single piece / 0.70USD in at 1000pcs).
A prominent example is the BadgeMagic badge also promoted as fossasia badge, which is a board with a 11x44 monochrome LED matrix, battery, and BLE/USB connectivity. The actual manufacturer is rarely ever mentioned, a Python application indicates it could be ShenZen LeSun Electronics Co.Ltd. Beware that there are different versions of what looks like the same badge with completely different hardware. (I have one of those to test with, as do @maribu and @nica-f).
Resources and qualities of implementation
This is what I found when quickly looking around, not comprehensive resources.
s/.o$/.c/
into search engines, there is no source for that one.Next steps
I don't have immediate plans of adding support; gathering data here so that we have a spot to gather data and interest inside RIOT.