CH32V003 Getting Started Guide

WCH MCU · 81 views · Updated 2026-08-07

CH32V003 Getting Started Guide

Overview

The CH32V003 is the world's most affordable RISC-V microcontroller:

  • Core: QingKe V2A (RV32EC)
  • Clock: 48 MHz
  • Flash: 16KB
  • RAM: 2KB
  • Package: SOP-8 / QFN-20
  • Price: $0.10

Toolchain Setup

1. Install MounRiver Studio

Download from WCH official site. MounRiver Studio is a free IDE based on Eclipse with RISC-V GCC toolchain pre-configured.

2. Create a New Project

File → New → C Project
→ Select "RISC-V C Project"
→ Chip: WCH CH32V003
→ Debugger: WCH-LinkE

3. LED Blink Example

#include "ch32v00x.h"

int main(void) {
    // Initialize GPIO
    GPIO_InitTypeDef GPIO_InitStruct = {0};
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
    GPIO_InitStruct.GPIO_Pin = GPIO_Pin_2;
    GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP;
    GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init(GPIOC, &GPIO_InitStruct);

    while(1) {
        GPIO_SetBits(GPIOC, GPIO_Pin_2);
        Delay_Ms(500);
        GPIO_ResetBits(GPIOC, GPIO_Pin_2);
        Delay_Ms(500);
    }
}

4. Flash with WCH-LinkE

Connect WCH-LinkE to the CH32V003 SWD pins:

WCH-LinkECH32V003
SWDIOPD4
SWCLKPD1
GNDGND
3V3VCC
Click "Download" in MounRiver Studio or use CLI:
wlink flash build/ch32v003.elf

USB Device Example

The CH32V003 has a built-in USB 2.0 Full Speed PHY:

#include "ch32v00x_usb.h"

// HID keyboard example - sends "Hello" on button press
void USB_HID_SendKey(uint8_t key) {
    // USB HID report endpoint
    USBFSD->EP1_TX = key;
    USBFSD->INT_FG = USBFS_UIF_EP1_TX;
}

2.4G RF Demo

The CH32V003 includes a 2.4G RF transceiver:

#include "ch32v00x_rf.h"

void RF_Init() {
    RF_Config_t cfg = {
        .channel = 2,
        .rate = RF_RATE_1M,
        .power = RF_POWER_20DBM,
        .addr = 0x12345678
    };
    RF_Config(&cfg);
}

void RF_Send(uint8_t *data, uint8_t len) {
    RF_Tx(data, len);
    while(RF_GetStatus() != RF_TX_DONE);
}

Datasheet & Resources

Common Issues

Cannot connect with WCH-LinkE

  1. Ensure SWDIO and SWCLK are not swapped
  2. Check 3.3V power supply
  3. Try wlink erase before flashing

USB not recognized

  1. Check D+ pull-up resistor (1.5k to 3.3V)
  2. Ensure clock is configured for 48MHz USB
  3. Use USB 2.0 port (not USB 3.0)

Buy CH32V003

Ready to start your project? Contact us for samples and volume pricing.
Request Hardware Ask in Forum