Skip to content

Commit 96c33f6

Browse files
soburifabiobaltieri
authored andcommitted
boards: arm: add initial support for Arduino UNO R4 Minima
Add support for the Arduino UNO R4 Minima. This board is the newest version of Arduino that uses Renesas RA4M1 SoC. This commit provides only limited support to simplify the initial support patch. Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent 69a3930 commit 96c33f6

File tree

9 files changed

+238
-0
lines changed

9 files changed

+238
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2023 TOKITA Hiroshi <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_ARDUINO_UNO_R4_MINIMA
5+
bool "Arduino Uno R4 Minima board"
6+
depends on SOC_R7FA4M1AB3CFM
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2023 TOKITA Hiroshi <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_ARDUINO_UNO_R4_MINIMA
5+
6+
config BOARD
7+
default "arduino_uno_r4_minima" if BOARD_ARDUINO_UNO_R4_MINIMA
8+
9+
endif # BOARD_ARDUINO_UNO_R4_MINIMA
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2023 TOKITA Hiroshi <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <renesas/ra/r7fa4m1ab3cfm.dtsi>
9+
10+
/ {
11+
model = "Arduino Uno R4 Board";
12+
compatible = "renesas,r7fa4m1aB3cfm";
13+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (c) 2023 TOKITA Hiroshi <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pinctrl/renesas/pinctrl-r7fa4m1xxxxxx.h>
8+
9+
&pinctrl {
10+
sci2_default: sci2_default {
11+
group1 {
12+
pinmux = <P301_RXD2>, <P302_TXD2>;
13+
};
14+
};
15+
};
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (c) 2023 TOKITA Hiroshi <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <zephyr/dt-bindings/gpio/gpio.h>
10+
11+
#include "arduino_uno_r4_common.dtsi"
12+
#include "arduino_uno_r4_minima-pinctrl.dtsi"
13+
14+
/ {
15+
model = "Arduino Uno R4 Minima";
16+
17+
chosen {
18+
zephyr,console = &uart2;
19+
zephyr,shell-uart = &uart2;
20+
zephyr,sram = &sram0;
21+
zephyr,flash = &flash0;
22+
zephyr,code-partition = &code_partition;
23+
};
24+
25+
leds {
26+
compatible = "gpio-leds";
27+
led: led {
28+
gpios = <&ioport1 11 GPIO_ACTIVE_HIGH>;
29+
};
30+
};
31+
32+
aliases {
33+
led0 = &led;
34+
};
35+
};
36+
37+
&sci2 {
38+
status = "okay";
39+
pinctrl-0 = <&sci2_default>;
40+
pinctrl-names = "default";
41+
uart2: uart {
42+
current-speed = <115200>;
43+
status = "okay";
44+
};
45+
};
46+
47+
&ioport1 {
48+
status = "okay";
49+
};
50+
51+
&flash0 {
52+
partitions {
53+
compatible = "fixed-partitions";
54+
#address-cells = <1>;
55+
#size-cells = <1>;
56+
57+
boot_partition: partition@0 {
58+
label = "bootloader";
59+
reg = <0x00000000 0x4000>;
60+
read-only;
61+
};
62+
63+
code_partition: partition@4000 {
64+
label = "code";
65+
reg = <0x4000 0x3C000>;
66+
read-only;
67+
};
68+
};
69+
};
70+
71+
&fcu {
72+
status = "okay";
73+
};
74+
75+
&hoco {
76+
status = "okay";
77+
clock-frequency = <48000000>;
78+
};
79+
80+
&cgc {
81+
clock-source = <&hoco>;
82+
iclk-div = <1>;
83+
pclka-div = <1>;
84+
pclkb-div = <2>;
85+
pclkc-div = <1>;
86+
pclkd-div = <1>;
87+
fclk-div = <2>;
88+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
identifier: arduino_uno_r4_minima
2+
name: Arduino Uno R4 Minima
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
- xtools
9+
ram: 32
10+
supported:
11+
- gpio
12+
- uart
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2023 TOKITA Hiroshi <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_SOC_SERIES_RA4M1=y
5+
CONFIG_SOC_R7FA4M1AB3CFM=y
6+
7+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000
8+
9+
CONFIG_BUILD_OUTPUT_HEX=y
10+
11+
# enable uart driver
12+
CONFIG_SERIAL=y
13+
14+
# enable console
15+
CONFIG_CONSOLE=y
16+
CONFIG_UART_CONSOLE=y
17+
18+
# enable GPIO
19+
CONFIG_GPIO=y
20+
21+
CONFIG_PINCTRL=y
22+
23+
CONFIG_CLOCK_CONTROL=y
24+
25+
CONFIG_USE_DT_CODE_PARTITION=y
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2023 TOKITA Hiroshi <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board_runner_args(pyocd "--target=r7fa4m1ab")
5+
6+
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
.. _arduino_uno_r4:
2+
3+
Arduino UNO R4 Minima
4+
#####################
5+
6+
Overview
7+
********
8+
9+
The Arduino UNO R4 Minima is a development board featuring the Renesas RA4M1 SoC
10+
in the Arduino form factor and is compatible with traditional Arduino.
11+
12+
Programming and debugging
13+
*************************
14+
15+
Building & Flashing
16+
===================
17+
18+
You can build and flash an application in the usual way (See
19+
:ref:`build_an_application` and
20+
:ref:`application_run` for more details).
21+
22+
Here is an example for building and flashing the :zephyr:code-sample:`blinky` application.
23+
24+
.. zephyr-app-commands::
25+
:zephyr-app: samples/basic/blinky
26+
:board: arduino_uno_r4_minima
27+
:goals: build flash
28+
29+
Debugging
30+
=========
31+
32+
Debugging also can be done in the usual way.
33+
The following command is debugging the :zephyr:code-sample:`blinky` application.
34+
Also, see the instructions specific to the debug server that you use.
35+
36+
.. zephyr-app-commands::
37+
:zephyr-app: samples/basic/blinky
38+
:board: arduino_uno_r4_minima
39+
:maybe-skip-config:
40+
:goals: debug
41+
42+
43+
Using pyOCD
44+
-----------
45+
46+
Various debug adapters, including cmsis-dap probes, can debug the Arduino UNO R4 with pyOCD.
47+
The default configuration uses the pyOCD for debugging.
48+
You must install CMSIS-Pack when flashing or debugging Arduino UNO R4 Minima with pyOCD.
49+
If not installed yet, execute the following command to install CMSIS-Pack for Arduino UNO R4.
50+
51+
.. code-block:: console
52+
53+
pyocd pack install r7fa4m1ab
54+
55+
56+
Restoring Arduino Bootloader
57+
============================
58+
59+
If you corrupt the Arduino bootloader, you can restore it with the following command.
60+
61+
.. code-block:: console
62+
63+
wget https://raw.githubusercontent.com/arduino/ArduinoCore-renesas/main/bootloaders/UNO_R4/dfu_minima.hex
64+
pyocd flash -e sector -a 0x0 -t r7fa4m1ab dfu_minima.hex

0 commit comments

Comments
 (0)