MuseLab nanoCH57x
Overview
The MuseLab nanoCH57x [1] is an evaluation board for the RISC-V based CH570/CH572 SoC.
The board is equipped with a power LED, reset button, USB port, and one user LED. It also features 2.4G PCB antenna and supports BLE/2.4GHz RF transceiver.
Hardware
The QingKe V3C 32-bit RISC-V processor [2] of the nanoCH57x runs at up to 100 MHz, using a 32 MHz external crystal.
The WCH webpage on CH572 [3] contains the processor’s information and the
datasheet. The nanoCH57x board schematics can be found on
nanoCH57x git repository [4].
Supported Features
The nano_ch57x board supports the hardware features listed below.
- on-chip / on-board
- Feature integrated in the SoC / present on the board.
- 2 / 2
-
Number of instances that are enabled / disabled.
Click on the label to see the first instance of this feature in the board/SoC DTS files. -
vnd,foo -
Compatible string for the Devicetree binding matching the feature.
Click on the link to view the binding documentation.
nano_ch57x/ch570 target
On-target memory for this board target: 12 KiB of RAM, 256 KiB of Flash.
Type |
Location |
Description |
Compatible |
|---|---|---|---|
CPU |
on-chip |
WCH QingKe V3C RISC-V MCU1 |
|
GPIO & Headers |
on-chip |
WCH CH5xx General-Purpose Input/Output (GPIO)1 |
|
Interrupt controller |
on-chip |
WCH CH32V00x Programmable Fast Interrupt Controller (PFIC)1 |
|
LED |
on-board |
Group of GPIO-controlled LEDs1 |
|
MTD |
on-chip |
Flash node1 |
|
Pin control |
on-chip |
WCH CH570/CH572 Alternate Function1 |
|
Serial controller |
on-chip |
WCH CH5xx UART1 |
|
SRAM |
on-chip |
Generic on-chip SRAM1 |
|
Timer |
on-chip |
WCH CH32V00x Systick1 |
nano_ch57x/ch572 target
On-target memory for this board target: 12 KiB of RAM, 256 KiB of Flash.
Type |
Location |
Description |
Compatible |
|---|---|---|---|
CPU |
on-chip |
WCH QingKe V3C RISC-V MCU1 |
|
GPIO & Headers |
on-chip |
WCH CH5xx General-Purpose Input/Output (GPIO)1 |
|
Interrupt controller |
on-chip |
WCH CH32V00x Programmable Fast Interrupt Controller (PFIC)1 |
|
LED |
on-board |
Group of GPIO-controlled LEDs1 |
|
MTD |
on-chip |
Flash node1 |
|
Pin control |
on-chip |
WCH CH570/CH572 Alternate Function1 |
|
Serial controller |
on-chip |
WCH CH5xx UART1 |
|
SRAM |
on-chip |
Generic on-chip SRAM1 |
|
Timer |
on-chip |
WCH CH32V00x Systick1 |
Pin Mapping
The peripherals of the CH570/CH572 SoC can be routed to various pins on the board. These mappings can be configured through DTS. The following table shows the possible routings for each peripheral.
Peripheral |
Possible Pin(s) |
Default Pin |
|---|---|---|
UART0 RXD |
PA2, PA3, PA0, PA1, PA6, PA9, PA10, PA11 |
PA2 |
UART0 TXD |
PA3, PA2, PA1, PA0, PA7, PA8, PA11, PA10 |
PA3 |
IC20 SCL |
PA8, PA0, PA3, PA5 |
PA8 |
IC20 SDA |
PA9, PA1, PA2, PA6 |
PA9 |
SPI0 MOSI |
PA7 |
PA7 |
SPI0 MISO |
PA6 |
PA6 |
SPI0 SCK |
PA5, PA3 |
PA5 |
SPI0 SCS |
PA4, PA2 |
PA4 |
TMR0 - PWM0 |
PA7, PA2, PA4, PA9 |
PA7 |
TMR0 - CAPIN1 |
PA7, PA2, PA4, PA9 |
PA7 |
TMR0 - CAPIN2 |
PA2, PA7, PA9, PA4 |
PA2 |
PWM (1-5) |
PA7, PA2, PA3, PA4, PA8 |
PA7, PA2, PA3, PA4, PA8 |
KEYSCAN (0-4) |
PA2, PA3, PA8, PA10, PA11 |
PA2, PA3, PA8, PA10, PA11 |
CMP0 - N |
PA2 |
PA2 |
CMP0 - P |
PA3, PA7 |
PA3 |
Programming and Debugging
Applications for the nanoCH57x board target can be built and flashed
in the usual way (see Building an Application and Run an Application
for more details); however, an external programmer (like the WCH LinkE [5]) is
recommended to flash and debug the board easily.
In this case, the pins of the external programmer must be connected as follows:
WCH LinkE |
3V3 |
GND |
SWDIO |
SWCLK |
TX |
RX |
nanoCH57x |
3V3 |
G |
PA0 |
PA1 |
PA2 |
PA3 |
Note
The debug interface must be enabled in the board and the code protection must be disabled.
The nano_ch57x board supports the runners and associated west commands listed below.
| flash | debug | debugserver | rtt | attach | |
|---|---|---|---|---|---|
| openocd | ✅ (default) | ✅ (default) | ✅ | ✅ | ✅ |
To use OpenOCD runner, you need to use an WCH OpenOCD. E.g. the WCH OpenOCD liberated fork, available at https://github.com/jnk0le/openocd-wch.
Note
You can change the default OpenOCD binary used by Zephyr with the following methods:
Specify the path each time you flash/debug the board by adding the
--openocd path/to/wch-openocd/bin/openocdargument to thewest flashorwest debugcommand.Set the WCH OpenOCD binary as a build configuration parameter:
west config build.cmake-args -- "-DOPENOCD=path/to/wch-openocd/bin/openocd"This method only needs to be run once, unlike the first one.
Flashing
Here is an example using the Blinky application. The LED definitions can be found in boards/muselab/nano_ch57x/nano_ch57x_common.dtsi.
# From the root of the zephyr repository
west build -b nano_ch57x/ch570 samples/basic/blinky
west flash
Debugging
This board can be debugged via OpenOCD:
# From the root of the zephyr repository
west build -b nano_ch57x/ch570 samples/basic/blinky
west debug