1.. zephyr:board:: arduino_uno_r4
2
3Overview
4********
5
6The Arduino UNO R4 Minima/WiFi is a development board featuring the Renesas RA4M1 SoC
7in the Arduino form factor and is compatible with traditional Arduino.
8
9Hardware
10********
11
12- Renesas RA4MA1 Processor (ARM Cortex-M4 at 48 MHz)
13- 256 KiB flash memory and 32 KiB of RAM
14- One user LEDs
15- One reset button
16- One WiFi Transceiver (Arduino UNO R4 WiFi only)
17- One 12x8 LED Matrix (Arduino UNO R4 WiFi only)
18- Built-in CMSIS-DAP debug adapter (Arduino UNO R4 WiFi only)
19
20Supported Features
21==================
22
23.. zephyr:board-supported-hw::
24
25Programming and debugging
26*************************
27
28Debug adapter
29=============
30
31A debug adapter is required to flash and debug programs.
32Arduino UNO R4 WiFi has a built-in debug adapter that
33you can use for flashing and debugging.
34
35In the Arduino UNO R4 Minima case, You need to prepare
36debug adapter separately. A 5V-compatible CMSIS-DAP adapter
37adapts to this board.
38
39
40Building & Flashing
41===================
42
43You can build and flash with ``west flash`` command (See
44:ref:`build_an_application` and
45:ref:`application_run` for more details).
46
47Here is an example for building and flashing the :zephyr:code-sample:`blinky` application.
48
49.. zephyr-app-commands::
50   :zephyr-app: samples/basic/blinky
51   :board: arduino_uno_r4@minima
52   :goals: build flash
53
54.. zephyr-app-commands::
55   :zephyr-app: samples/basic/blinky
56   :board: arduino_uno_r4@wifi
57   :goals: build flash
58
59Debugging
60=========
61
62Debugging can be done with ``west debug`` command.
63The following command is debugging the :zephyr:code-sample:`blinky` application.
64Also, see the instructions specific to the debug server that you use.
65
66.. zephyr-app-commands::
67   :zephyr-app: samples/basic/blinky
68   :board: arduino_uno_r4@minima
69   :maybe-skip-config:
70   :goals: debug
71
72.. zephyr-app-commands::
73   :zephyr-app: samples/basic/blinky
74   :board: arduino_uno_r4@wifi
75   :maybe-skip-config:
76   :goals: debug
77
78
79Using pyOCD
80-----------
81
82Various debug adapters, including cmsis-dap probes, can debug the Arduino UNO R4 with pyOCD.
83The default configuration uses the pyOCD for debugging.
84You must install CMSIS-Pack when flashing or debugging Arduino UNO R4 Minima with pyOCD.
85If not installed yet, execute the following command to install CMSIS-Pack for Arduino UNO R4.
86
87.. code-block:: console
88
89   pyocd pack install r7fa4m1ab
90
91
92Restoring Arduino Bootloader
93============================
94
95If you corrupt the Arduino bootloader, you can restore it with the following command.
96
97.. code-block:: console
98
99   wget https://raw.githubusercontent.com/arduino/ArduinoCore-renesas/main/bootloaders/UNO_R4/dfu_minima.hex
100   pyocd flash -e sector -a 0x0 -t r7fa4m1ab dfu_minima.hex
101
102.. code-block:: console
103
104   wget https://raw.githubusercontent.com/arduino/ArduinoCore-renesas/main/bootloaders/UNO_R4/dfu_wifi.hex
105   pyocd flash -e sector -a 0x0 -t r7fa4m1ab dfu_wifi.hex
106