1.. zephyr:board:: ch32v003evt
2
3Overview
4********
5
6The `WCH`_ CH32V003EVT hardware provides support for QingKe 32-bit RISC-V2A
7processor and the following devices:
8
9* CLOCK
10* :abbr:`GPIO (General Purpose Input Output)`
11* :abbr:`NVIC (Nested Vectored Interrupt Controller)`
12
13The board is equipped with two LEDs. The `WCH webpage on CH32V003`_ contains
14the processor's information and the datasheet.
15
16Hardware
17********
18
19The QingKe 32-bit RISC-V2A processor of the WCH CH32V003EVT is clocked by an
20external crystal and runs at 48 MHz.
21
22Supported Features
23==================
24
25The ``ch32v003evt`` board target supports the following hardware features:
26
27+-----------+------------+----------------------+
28| Interface | Controller | Driver/Component     |
29+===========+============+======================+
30| CLOCK     | on-chip    | clock_control        |
31+-----------+------------+----------------------+
32| GPIO      | on-chip    | gpio                 |
33+-----------+------------+----------------------+
34| PWM       | on-chip    | pwm                  |
35+-----------+------------+----------------------+
36| PINCTRL   | on-chip    | pinctrl              |
37+-----------+------------+----------------------+
38| TIMER     | on-chip    | timer                |
39+-----------+------------+----------------------+
40| UART      | on-chip    | uart                 |
41+-----------+------------+----------------------+
42
43Other hardware features have not been enabled yet for this board.
44
45Connections and IOs
46===================
47
48LED
49---
50
51* LED1 = Unconnected. Connect to an I/O pin (PD4).
52
53Programming and Debugging
54*************************
55
56Applications for the ``ch32v003evt`` board target can be built and flashed
57in the usual way (see :ref:`build_an_application` and :ref:`application_run`
58for more details); however, an external programmer is required since the board
59does not have any built-in debug support.
60
61The following pins of the external programmer must be connected to the
62following pins on the PCB (see image):
63
64* VCC = VCC (do not power the board from the USB port at the same time)
65* GND = GND
66* SWIO = PD1
67
68Flashing
69========
70
71You can use ``minichlink`` to flash the board. Once ``minichlink`` has been set
72up, build and flash applications as usual (see :ref:`build_an_application` and
73:ref:`application_run` for more details).
74
75Here is an example for the :zephyr:code-sample:`blinky` application.
76
77.. zephyr-app-commands::
78   :zephyr-app: samples/basic/blinky
79   :board: ch32v003evt
80   :goals: build flash
81
82Debugging
83=========
84
85This board can be debugged via OpenOCD or ``minichlink``.
86
87Testing the LED on the WCH CH32V003EVT
88**************************************
89
90There is 1 sample program that allow you to test that the LED on the board is
91working properly with Zephyr:
92
93.. code-block:: console
94
95   samples/basic/blinky
96
97You can build and flash the examples to make sure Zephyr is running
98correctly on your board. The button and LED definitions can be found
99in :zephyr_file:`boards/wch/ch32v003evt/ch32v003evt.dts`.
100
101References
102**********
103
104.. target-notes::
105
106.. _WCH: http://www.wch-ic.com
107.. _WCH webpage on CH32V003: https://www.wch-ic.com/products/CH32V003.html
108