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.
There is what looks like a functional firmware replacement for the BadgeMagic at https://github.com/fossasia/badgemagic-firmware, which includes the BLE functionality and has basic USB support in a PR.
Data sheets and further docs are available in English. It's not too verbose, but appears to be complete enough on the system side (interrupt description etc) and small peripherals. The USB documentation is terse (mostly registers), but that might suffice for users who have used a few USB hardware implementations already. The BLE part is not documented in detail (see below)
The BLE radio is supported only through a vendor header file and a precompiled static library.
I don't know the authoritative source of that one -- but it is included in the badgemagic repository.
For the other peripherals, there is a nonfree but source-available implementation provided.
I don't know the authoritative source of that one -- but it is included in the badgemagic repository.
From putting the names of the object files in the static libraries with s/.o$/.c/ into search engines, there is no source for that one.
There is a Rust hardware abstraction crate that provides a hardware abstraction layer, including embassy support. That one llinks in a lot of shipped precompiled static libraries. I didn't check whether there is source available for them.
Debugging does not use standard JTAG/SWD techniques, but some custom protocol (WLINK/WLINKE?) that is loosely SWD based for which there are custom hardware and software tools. At least for the software there is a wlink command line tool that also has a good references section, and some work around making it available in OpenOCD.
There exists a USB bootloader, at least in the badgemagic devices. I can't tell yet whether that is custom to the board manufacturer, provided by the chip manufacturer or even part of its ROM.
Peculiarities
Perusing the badgemagic code shows that there are some BLE interrupt handler functions loaded as "high code" which are copied into and executed from RAM. I can't tell yet whether that is just a speed / power optimization, whether all interrupt code has to be executed from RAM, or whether something else is going on.
I didn't find any documentation on flash ROM writing / erasing outside the firmware update process.
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.
Apart from vendor Windows tools, there are two that support that hardware: a dedicated wlink implementation and probe-rs. Generally be careful around the hardware and software, because the programmer comes in variants, the CHxxx devices are all but homogenous, and not every device is supported by every programmer. The wlink implementation docs contain an overview sheet.
On the long run I'd hope that tools such as probe-rs or the blackmagic probe will also speak the protocol, at least big-banging through the host (IDC how slow it is if it means I don't have to go through AliExpress again).
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.