Skip to content

Commit

Permalink
boards: arduino: uno_r4: Add Arduino UNO R4 WiFi
Browse files Browse the repository at this point in the history
Add configuration for Arduino UNO R4 WiFi

Signed-off-by: TOKITA Hiroshi <[email protected]>
  • Loading branch information
soburi authored and carlescufi committed Apr 10, 2024
1 parent 63772ad commit 1b25601
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 69 deletions.
5 changes: 5 additions & 0 deletions boards/arduino/uno_r4/Kconfig.arduino_uno_r4_wifi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 TOKITA Hiroshi <[email protected]>
# SPDX-License-Identifier: Apache-2.0

config BOARD_ARDUINO_UNO_R4_WIFI
select SOC_R7FA4M1AB3CFM
62 changes: 62 additions & 0 deletions boards/arduino/uno_r4/arduino_uno_r4_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,70 @@

/dts-v1/;
#include <renesas/ra/r7fa4m1ab3cfm.dtsi>
#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
model = "Arduino Uno R4 Board";
compatible = "renesas,r7fa4m1aB3cfm";

chosen {
zephyr,console = &uart2;
zephyr,shell-uart = &uart2;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
};
};

&sci2 {
status = "okay";
pinctrl-0 = <&sci2_default>;
pinctrl-names = "default";
uart2: uart {
current-speed = <115200>;
status = "okay";
};
};

&ioport1 {
status = "okay";
};

&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "bootloader";
reg = <0x00000000 0x4000>;
read-only;
};

code_partition: partition@4000 {
label = "code";
reg = <0x4000 0x3C000>;
read-only;
};
};
};

&fcu {
status = "okay";
};

&hoco {
status = "okay";
clock-frequency = <48000000>;
};

&cgc {
clock-source = <&hoco>;
iclk-div = <1>;
pclka-div = <1>;
pclkb-div = <2>;
pclkc-div = <1>;
pclkd-div = <1>;
fclk-div = <2>;
};
64 changes: 0 additions & 64 deletions boards/arduino/uno_r4/arduino_uno_r4_minima.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,12 @@
*/

/dts-v1/;

#include <zephyr/dt-bindings/gpio/gpio.h>

#include "arduino_uno_r4_common.dtsi"
#include "arduino_uno_r4_minima-pinctrl.dtsi"

/ {
model = "Arduino Uno R4 Minima";

chosen {
zephyr,console = &uart2;
zephyr,shell-uart = &uart2;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
};

leds {
compatible = "gpio-leds";
led: led {
Expand All @@ -33,56 +22,3 @@
led0 = &led;
};
};

&sci2 {
status = "okay";
pinctrl-0 = <&sci2_default>;
pinctrl-names = "default";
uart2: uart {
current-speed = <115200>;
status = "okay";
};
};

&ioport1 {
status = "okay";
};

&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "bootloader";
reg = <0x00000000 0x4000>;
read-only;
};

code_partition: partition@4000 {
label = "code";
reg = <0x4000 0x3C000>;
read-only;
};
};
};

&fcu {
status = "okay";
};

&hoco {
status = "okay";
clock-frequency = <48000000>;
};

&cgc {
clock-source = <&hoco>;
iclk-div = <1>;
pclka-div = <1>;
pclkb-div = <2>;
pclkc-div = <1>;
pclkd-div = <1>;
fclk-div = <2>;
};
15 changes: 15 additions & 0 deletions boards/arduino/uno_r4/arduino_uno_r4_wifi-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright (c) 2024 TOKITA Hiroshi <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/pinctrl/renesas/pinctrl-r7fa4m1xxxxxx.h>

&pinctrl {
sci2_default: sci2_default {
group1 {
pinmux = <P301_RXD2>, <P302_TXD2>;
};
};
};
24 changes: 24 additions & 0 deletions boards/arduino/uno_r4/arduino_uno_r4_wifi.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 TOKITA Hiroshi <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include "arduino_uno_r4_common.dtsi"
#include "arduino_uno_r4_wifi-pinctrl.dtsi"

/ {
model = "Arduino Uno R4 WiFi";

leds {
compatible = "gpio-leds";
led: led {
gpios = <&ioport1 2 GPIO_ACTIVE_HIGH>;
};
};

aliases {
led0 = &led;
};
};
12 changes: 12 additions & 0 deletions boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
identifier: arduino_uno_r4_wifi
name: Arduino Uno R4 WiFi
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 32
supported:
- gpio
- uart
23 changes: 23 additions & 0 deletions boards/arduino/uno_r4/arduino_uno_r4_wifi_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2024 TOKITA Hiroshi <[email protected]>
# SPDX-License-Identifier: Apache-2.0

CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000

CONFIG_BUILD_OUTPUT_HEX=y

# Enable UART driver
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y

# Enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# Enable GPIO
CONFIG_GPIO=y

CONFIG_PINCTRL=y

CONFIG_CLOCK_CONTROL=y

CONFIG_USE_DT_CODE_PARTITION=y
14 changes: 9 additions & 5 deletions boards/arduino/uno_r4/board.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
board:
name: arduino_uno_r4_minima
vendor: arduino
socs:
- name: r7fa4m1ab3cfm
boards:
- name: arduino_uno_r4_minima
vendor: arduino
socs:
- name: r7fa4m1ab3cfm
- name: arduino_uno_r4_wifi
vendor: arduino
socs:
- name: r7fa4m1ab3cfm

0 comments on commit 1b25601

Please sign in to comment.