CH32 RISC-V MCUs Get Official Arduino Support

Like many of you, we’ve been keeping a close eye on the CH32 family of RISC-V microcontrollers from WCH Electronics. You can get the CH32V003, featuring 2 kB RAM and 16 kB of flash for under fifteen cents, and the higher-end models include impressive features like onboard Ethernet. But while the hardware is definitely interesting, the software side of things has been a little rocky compared to what we’ve come to expect from modern MCUs.

Things should start looking up a bit though with the release of an Arduino core for the CH32 direct from WCH themselves. It’s been tested on Windows, Linux, and Mac, and supports the CH32V00x, CH32V10x, CH32V20x, CH32V30x, and CH32X035 chips. Getting it installed is as easy as adding the URL to the Arduino IDE’s Boards Manager interface, though as the video below shows, running it on Linux does require an extra step or two.

So far, we’ve seen several projects, like this temperature sensor or this holiday gizmo that use [cnlohr]’s open-source toolchain. But there’s no question that plenty of hobbyists out there feel more comfortable in the Arduino environment, and if those folks are now able to pick up a CH32 and do something cool, that means more people jumping on board, more libraries developed, more demo code written…you get the idea.

Just like the ESP8266’s popularity exploded when it was added to the Arduino IDE, we’ve got high hopes for the CH32 family in the coming months.

26 thoughts on “CH32 RISC-V MCUs Get Official Arduino Support

  1. While I’ve been keeping track of RISC-V developments for awhile now, and it is certainly *ideologically* nice to be using a full open-source ISA (particularly if you want to roll your own on an FPGA)… It is still not entirely clear to me… Are there some actual technical/performance benefits as reasons to go RISC-V ? Or, otherwise, and foregive me it seems slightly more a moot point otherwise unless you are looking to mint your own ASICs or something. Am I wrong ?

    1. Not really, you could use a CM0 instead.

      The key interesting thing is that they market the CH32V003 as an 8 bit replacement for low cost hobbyist usage. The EVK is available cheaply and they have good community outreach.

      STM and TI could, in principle, do the same with their new low-cost line ups. The STM32C looks quite nice. But when you try to order it at Digikey, you pay >$1.00 instead of “low cost”…

        1. Understandably. ARM is the x86 of RISC right now. RISC-V is rather more like m68k/PPC, ideologically.

          It’s just sad from a compatibility point of view, generally speaking.

          32-Bit Android and the Raspberry Pi had reached a wide acceptance and lots of projects are based on it.

          Some of which are nolonger being developed on, maybe because the author has passed or lost interest.
          Some drivers might be hardware-dependent, also.

          For these projects, the fall of ARM will be a loss.
          But on the other hand, Android 12 has intentionally begun to drop 32-Bit support, as well.

          Of course that’s not relevant to RISC V microcontrollers with a lousy 4 KB of memory (even a VIC20 had more). They’re basically e-waste in this era, like newly made AM radios. But that’s another story.

          1. The biggest issue is the cost for the manufactures, as an ARM license comes at a steep cost for them. So for MCUs where the Barrier to Entry is much lower, then you can simply replace the ARM based Core, with a RISC-V core. Especially if you where designing your own peripherals then yeah, there is really the incentive to bring all of production in house.

    2. My understanding is that the ARM license costs per-chip, and the RISC-V chips don’t. If you’re paying one cent in licensing for a five-cent chip that you retail for ten cents, it’s a tough pill. Higher up the food chain, it probably doesn’t matter _as much_.

      (Can anyone replace these wild-ass-guesses with approximately correct numbers?)

      Some of the cores are also very power efficient per clock cycle. Whether this translates into actual efficiency gains?

      1. My understanding is that the license fees for a CM0+ are really low and don’t play too much into the equation. Things may change a bit for larger cores.

        There are CM0 MCUs available that are cheaper than the CH32V003, e.g. the PY32F0xx.

        It’s really mostly about marketing it as RISC-V and moving away from ARM. There is not so much technical merit.

        The specific RISC-V core used in the CH32V003 also an extremely simple one (RV32EC) that is significantly less powerful that a CM0. (16 vs. 32 registers, no multiplication).

        As said above, it’s a pity that TI and STs low-end offering are not marketed better to hobbyist. It’s a wasted strategic opportunity imo. Espressif has demonstrated the importance of grass-roots marketing very well.

          1. Nicely, the very cheap PY32F’s mentioned above support a 2.7 – 5.5V supply voltage range.
            I do like the 5V tolerance and combability with cheap, existing SWD programmers.

    3. ARM charges licensing and royalties. And the costs were quite painful. RISC-V has put pressure on ARM already to reduce both.

      https://www.electronicdesign.com/technologies/embedded/article/21808309/arm-eases-upfront-licensing-fees-to-head-off-risc-v

      We kind of have an open source ISA in the 8051 which is no longer protected. But it’s not suitable for much more than very embedded tasks like acting as controllers for USB devices (keyboard, mice etc).

      We currently have a world in which our devices are filled with MCUs of different instruction sets determined by functionality and licensing. (8051->AVR/PIC->ARM->x86), from free to progressively more expensive, from simple to progressively high performance and complex.

      RISC-V could be adapted to be suitable to compete in all those spots simultaneously.

    4. no technical merit, other than ‘its cool.’ in most measurable ways, low cost CM0+s utterly trounce it. The Puya py32, for example – faster, similar price, more peripherals and flexibility, more mature toolchain.

      the stm32g030 can be found for about 0.35, too.

      so, the ch32s are fun to play with, try new things…. but they’re not so compelling on the technical front

  2. You need to buy a special WCHE flasher from WCH to be able to flash those chips.

    I had success with Ardulink (an Arduino Uno 328p) showing up as a /dev/ttyACM0 and the minichlink tool (not WCH’s patched OpenOCD), I doubt that this Arduino port by WCH will support the Ardulink any time soon.

    I could flash a SOP16 ch32v003 breakout board running in 5V, but no success with pre-made boards like the nanoch32v003 or the Tweng board, which has 3.3V SWIO. If someone has a trick to get it flashed (I tried unsuccessfully with a level shifter 5v->3.3v), I am listening.

    I made a repo with an arduino-cli docker image (1GB) with the arduino-cli for ch32v003, it is buggy for the moment, but I will make some fixes one of those evenings. I published the first 2 examples for blink and serial output:

    https://gitlab.com/zoobab/ch32v003-arduino-cli/-/blob/master/code/blink/blink.ino
    https://gitlab.com/zoobab/ch32v003-arduino-cli/-/blob/master/code/uart/uart.ino

        1. What worked for me was an Arduino UNO in 5V connected to a CH32v003 SOP16 running in 5V as well (power taken from the Arduino 5V pin), with Arduino Pin 8 connected to the SWIO interface with a 1k resistor (without I had stability issues):

          https://gitlab.com/BlueSyncLine/arduino-ch32v003-swio

          I will do some schematics once I have added the ch32v003 in Fritzing.

          What did not worked was to try to flash a premade board (the nanoCh32v003) which had a label 3.3V on its SWIO pin, and power it over 5V (the ch32 runs in 5V as well, so if you don’t power it over USB, it should run fine in 5V).

    1. The nanoch32v003 has a USB interface. You weren’t able to program it with it? Do you think with the Arduino IDE now, it would be possible? Do you know how it handles the USB side, since i don’t see an FTDI chip on the board? And finally, do you know a good place to buy standalone CH32 ships in bulk? Ebay is quite expensive, nowhere near some cents as hackaday says.

  3. china wants semiconductor supremacy at any cost – they recently threw another $40B at the Big Fund. And they will achieve it in the coming years because in the West we have greed-driven semi companies that have little concern for the makers or small guy, as well as being stingy with MCU features and memory. Adding value to shareholders is what is important.
    ADI buys LT and then shuts down the factory, the Hillview CA fab and then outsources the fab and packaging to Asia. Who cares about USA semi’s?

    https://www.reuters.com/technology/china-launch-new-40-bln-state-fund-boost-chip-industry-sources-say-2023-09-05

  4. I for one am pretty excited for this. I’m pretty comfortable in the Arduino environment now and I’ve had one of these chips on a dev board sitting on my desk for months doing nothing. Maybe I’ll take some time to make a fun project with it.

  5. The problem I see with WCH is their pricing strategy. Remember the god chip CH552 from a few years back? Back then it was $0.3, it was a bomb, but they later raised the price so much that it is no longer viable. At almost $1, there’s no way anyone would buy that over a, say, GD32F350.

    CH32X035 is what I see a great upgrade to CH552 or CH543, but we just don’t know when WCH will raise its price again forcing us to redo our low cost designs all over again. I’d like to trust them for once as they might try to cease 8051 production and use price to force their customers to go RV, but if that happens again, I really won’t be able to find them a new excuse.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.