Machines › Computers › WCH › CH32V307
CH32V307
2021
The CH32V307 (WCH, 2021) is the higher-end sibling of the CH32V003: a 144MHz QingKe V4F RISC-V RV32IMAFC core with a hardware multiplier and a single-precision FPU, 256KB of flash and 64KB of SRAM. A typical board exposes two on-board user LEDs on PA0/PA1, a user button on PB4 and a USART1 serial console. Here it runs real compiled firmware on a from-scratch RISC-V core.
CH32V307 Online Emulator
Play CH32V307 using JavaScript directly in your browser.
Controls
Runs real compiled WCH CH32V307 firmware on an in-browser QingKe V4F RISC-V core (RV32IMAFC: the full RV32I integer base with the M multiply/divide, A atomic and F single-precision floating-point extensions, plus the C compressed extension; 144 MHz, 256 KB flash, 64 KB SRAM) — the bigger sibling of the CH32V003. The default is "Blink PA0/PA1": a bare-metal C program that clocks GPIOA in RCC, configures PA0/PA1 as outputs and blinks the two on-board user LEDs in anti-phase with the atomic BSHR/BCR set/reset registers. "Button + LED" reads the on-board user button on PB4 (press B, or the on-screen BTN) and lights LED1 while it is held, with LED2 as a heartbeat. "USART Hello" brings up USART1 (TX on PA9) and prints a greeting to the serial console while blinking the LED; "SysTick + FPU" times each step off the SysTick counter and computes a circle circumference and area in hardware single-precision float (the Qingke V4F FPU: fmul.s/fadd.s/fcvt.*) and prints them over USART1. The FPU demo is compiled with clang for rv32imafc; the others for rv32imac. Open the debugger, or add ?debug, to single-STEP real RISC-V instructions from flash at 0x00000000, set PC breakpoints and write watchpoints, and read the RV32IMAFC registers (x0-x31 with ABI names + pc + the machine CSRs mstatus/mtvec/mepc/mcause/fcsr AND the 32 single-precision float registers f0-f31) and the real CH32V307 memory map live (FLASH 0x00000000, SRAM 0x20000000, peripherals 0x40000000). A bare CH32V307 dev board has no on-board speaker, so it is honestly silent.
Runs real compiled WCH CH32V307 firmware on an in-browser QingKe V4F RISC-V core (RV32IMAFC: the full RV32I integer base with the M multiply/divide, A atomic and F single-precision floating-point extensions, plus the C compressed extension; 144 MHz, 256 KB flash, 64 KB SRAM) — the bigger sibling of the CH32V003. The default is "Blink PA0/PA1": a bare-metal C program that clocks GPIOA in RCC, configures PA0/PA1 as outputs and blinks the two on-board user LEDs in anti-phase with the atomic BSHR/BCR set/reset registers. "Button + LED" reads the on-board user button on PB4 (press B, or the on-screen BTN) and lights LED1 while it is held, with LED2 as a heartbeat. "USART Hello" brings up USART1 (TX on PA9) and prints a greeting to the serial console while blinking the LED; "SysTick + FPU" times each step off the SysTick counter and computes a circle circumference and area in hardware single-precision float (the Qingke V4F FPU: fmul.s/fadd.s/fcvt.*) and prints them over USART1. The FPU demo is compiled with clang for rv32imafc; the others for rv32imac. Open the debugger, or add ?debug, to single-STEP real RISC-V instructions from flash at 0x00000000, set PC breakpoints and write watchpoints, and read the RV32IMAFC registers (x0-x31 with ABI names + pc + the machine CSRs mstatus/mtvec/mepc/mcause/fcsr AND the 32 single-precision float registers f0-f31) and the real CH32V307 memory map live (FLASH 0x00000000, SRAM 0x20000000, peripherals 0x40000000). A bare CH32V307 dev board has no on-board speaker, so it is honestly silent.
Runs real compiled WCH CH32V307 firmware on an in-browser QingKe V4F RISC-V core (RV32IMAFC: the full RV32I integer base with the M multiply/divide, A atomic and F single-precision floating-point extensions, plus the C compressed extension; 144 MHz, 256 KB flash, 64 KB SRAM) — the bigger sibling of the CH32V003. The default is "Blink PA0/PA1": a bare-metal C program that clocks GPIOA in RCC, configures PA0/PA1 as outputs and blinks the two on-board user LEDs in anti-phase with the atomic BSHR/BCR set/reset registers. "Button + LED" reads the on-board user button on PB4 (press B, or the on-screen BTN) and lights LED1 while it is held, with LED2 as a heartbeat. "USART Hello" brings up USART1 (TX on PA9) and prints a greeting to the serial console while blinking the LED; "SysTick + FPU" times each step off the SysTick counter and computes a circle circumference and area in hardware single-precision float (the Qingke V4F FPU: fmul.s/fadd.s/fcvt.*) and prints them over USART1. The FPU demo is compiled with clang for rv32imafc; the others for rv32imac. Open the debugger, or add ?debug, to single-STEP real RISC-V instructions from flash at 0x00000000, set PC breakpoints and write watchpoints, and read the RV32IMAFC registers (x0-x31 with ABI names + pc + the machine CSRs mstatus/mtvec/mepc/mcause/fcsr AND the 32 single-precision float registers f0-f31) and the real CH32V307 memory map live (FLASH 0x00000000, SRAM 0x20000000, peripherals 0x40000000). A bare CH32V307 dev board has no on-board speaker, so it is honestly silent.
Runs real compiled WCH CH32V307 firmware on an in-browser QingKe V4F RISC-V core (RV32IMAFC: the full RV32I integer base with the M multiply/divide, A atomic and F single-precision floating-point extensions, plus the C compressed extension; 144 MHz, 256 KB flash, 64 KB SRAM) — the bigger sibling of the CH32V003. The default is "Blink PA0/PA1": a bare-metal C program that clocks GPIOA in RCC, configures PA0/PA1 as outputs and blinks the two on-board user LEDs in anti-phase with the atomic BSHR/BCR set/reset registers. "Button + LED" reads the on-board user button on PB4 (press B, or the on-screen BTN) and lights LED1 while it is held, with LED2 as a heartbeat. "USART Hello" brings up USART1 (TX on PA9) and prints a greeting to the serial console while blinking the LED; "SysTick + FPU" times each step off the SysTick counter and computes a circle circumference and area in hardware single-precision float (the Qingke V4F FPU: fmul.s/fadd.s/fcvt.*) and prints them over USART1. The FPU demo is compiled with clang for rv32imafc; the others for rv32imac. Open the debugger, or add ?debug, to single-STEP real RISC-V instructions from flash at 0x00000000, set PC breakpoints and write watchpoints, and read the RV32IMAFC registers (x0-x31 with ABI names + pc + the machine CSRs mstatus/mtvec/mepc/mcause/fcsr AND the 32 single-precision float registers f0-f31) and the real CH32V307 memory map live (FLASH 0x00000000, SRAM 0x20000000, peripherals 0x40000000). A bare CH32V307 dev board has no on-board speaker, so it is honestly silent.
Configurations
| Configuration | Emulator | Machine | OS | Legal | |
|---|---|---|---|---|---|
| Blink PA0/PA1 (user LEDs) | CH32V307 | CH32V307 | open | Open ⛶ | |
| Button + LED | CH32V307 | CH32V307 | open | Open ⛶ | |
| USART Hello | CH32V307 | CH32V307 | open | Open ⛶ | |
| SysTick + FPU | CH32V307 | CH32V307 | open | Open ⛶ |
Downloads — ROMs & software
| Title | Type | Size (bytes) | Legal | |
|---|---|---|---|---|
| Blink PA0/PA1 (user LEDs) | demo | 0 | open | Download ↓ |
| Button + LED | demo | 0 | open | Download ↓ |
| SysTick + FPU | demo | 0 | open | Download ↓ |
| USART Hello | demo | 0 | open | Download ↓ |
Chips
Emulators
| Emulator | Type | License | Site |
|---|---|---|---|
| CH32V307 | online | CC0 | Website ↗ |