Skip to content

Commit ef5cfd3

Browse files
HenryXinkartben
authored andcommitted
boards: weact: weact_ra4m1_core: add weact studio ra4m1_core board
The ra4m1_core board is a Renesas RA4M1 core demo board from WeAct Studio as a compact PCBA for Renesas R7AM1AB3CFM microcontroller. Add it by modifying the code from Renesas RA4M1 Evaluation Kit. Passed these example codes: helloworld; blinky; button(polling). Signed-off-by: Henry Xin <yuepeng.xin@gmail.com>
1 parent d083466 commit ef5cfd3

9 files changed

Lines changed: 300 additions & 0 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation'
2+
# Copyright (c) 2026 Henry Xin
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config BOARD_WEACT_RA4M1_CORE
6+
select SOC_R7FA4M1AB3CFM
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2026 Henry Xin
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board_runner_args(jlink "--device=R7FA4M1AB")
5+
board_runner_args(rfp "--device=RA")
6+
7+
include(${ZEPHYR_BASE}/boards/common/rfp.board.cmake)
8+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/weact/ra4m1_core/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: weact_ra4m1_core
3+
full_name: WeAct RA4M1 Core Board
4+
vendor: weact
5+
socs:
6+
- name: r7fa4m1ab3cfm
52.1 KB
Loading
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
.. zephyr:board:: weact_ra4m1_core
2+
3+
Overview
4+
********
5+
6+
The MCU integrates multiple series of software- and pin-compatible Arm®-based 32-bit
7+
cores that share a common set of Renesas peripherals to facilitate design scalability
8+
and efficient platform-based product development.
9+
The MCU provides an optimal combination of low-power, high-performance Arm Cortex®-M4 core
10+
running up to 48 MHz with the following features:
11+
12+
**Renesas RA4M1 Microcontroller Group**
13+
14+
- R7FA4M1AB3CFM
15+
- 64-pin LQFP package
16+
- 48 MHz Arm® Cortex®-M4 core with Floating Point Unit (FPU)
17+
- 32 KB SRAM
18+
- 256 KB code flash memory
19+
- 8 KB data flash memory
20+
21+
**Connectivity**
22+
23+
- A Device USB connector for the Main MCU
24+
- A SWD interface is also provided for connecting optional external debuggers and
25+
programmers.
26+
- 1 User button, 1 User LED
27+
- Pin headers for access to power and signals for the Main MCU
28+
29+
**Multiple clock sources**
30+
31+
- Main MCU oscillator crystals, providing precision 16.000 MHz and 32,768 Hz external reference
32+
clocks
33+
- Additional low-precision clocks are available internal to the Main MCU
34+
35+
**General purpose I/O ports**
36+
37+
- One jumper to allow measuring of Main MCU current
38+
- Copper jumpers on PCB bottom side for configuration and access to selected MCU signals
39+
40+
**Operating voltage**
41+
42+
- External 5 V input through the USB-C connector supplies the on-board power regulator to power
43+
logic and interfaces on the board.
44+
- A red board status LED indicating availability of regulated power.
45+
- A blue User LED, controlled by the Main MCU firmware.
46+
- A user push-button switch, controlled by the Main MCU firmware.
47+
- MCU reset push-button switch.
48+
- MCU boot configuration button.
49+
50+
Hardware
51+
********
52+
53+
Detailed hardware features can be found at:
54+
55+
- RA4M1 MCU: `RA4M1 Group User's Manual Hardware`_
56+
- RA4M1_Core Schematic: `Ra4m1-core Schematic`_
57+
58+
Supported Features
59+
==================
60+
61+
.. zephyr:board-supported-hw::
62+
63+
Programming and Debugging
64+
*************************
65+
66+
.. zephyr:board-supported-runners::
67+
68+
Applications for the ``weact_ra4m1_core`` board can be built, flashed, and debugged
69+
in the usual way. See :ref:`build_an_application` and :ref:`application_run`
70+
for more details on building and running.
71+
72+
Flashing
73+
========
74+
75+
Program can be flashed to WeAct RA4M1-Core via an external SEGGER J-Link debugger.
76+
SEGGER J-link's drivers are available at https://www.segger.com/downloads/jlink/
77+
78+
To flash the program to board
79+
80+
1. Connect to J-Link OB via USB port to host PC
81+
82+
2. Make sure J-Link connection is correct to the board's SWD pins.
83+
84+
3. Execute west command
85+
86+
.. code-block:: console
87+
88+
west flash -r jlink
89+
90+
Debugging
91+
=========
92+
93+
You can use Segger Ozone (`Segger Ozone Download`_) for a visual debug interface
94+
95+
Once downloaded and installed, open Segger Ozone and configure the debug project
96+
like so:
97+
98+
* Target Device: R7FA4M1AB
99+
* Target Interface: SWD
100+
* Target Interface Speed: 4 MHz
101+
* Host Interface: USB
102+
* Program File: <path/to/your/build/zephyr.elf>
103+
104+
**Note:** It's verified that we can debug OK on Segger Ozone v3.30d so please use this or later
105+
version of Segger Ozone
106+
107+
References
108+
**********
109+
.. _RA4M1 Group User's Manual Hardware:
110+
https://www.renesas.com/us/en/document/mah/renesas-ra4m1-group-users-manual-hardware?r=1054146
111+
112+
.. _Ra4m1-core Schematic:
113+
https://github.com/WeActStudio/WeActStudio.RA4M1_64Pin_CoreBoard/blob/master/Hardware/WeAct-RA4M1_CoreBoard_V10%20SchDoc.pdf
114+
115+
.. _Segger Ozone Download:
116+
https://www.segger.com/downloads/jlink#Ozone
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2025 Peter Johanson
3+
* Copyright (c) 2026 Henry Xin
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&pinctrl {
8+
sci1_default: sci1_default {
9+
group1 {
10+
/* tx rx */
11+
psels = <RA_PSEL(RA_PSEL_SCI_1, 4, 1)>,
12+
<RA_PSEL(RA_PSEL_SCI_1, 4, 2)>;
13+
};
14+
};
15+
16+
spi1_default: spi1_default {
17+
group1 {
18+
/* MISO MOSI RSPCK SSL */
19+
psels = <RA_PSEL(RA_PSEL_SPI, 2, 2)>,
20+
<RA_PSEL(RA_PSEL_SPI, 2, 3)>,
21+
<RA_PSEL(RA_PSEL_SPI, 2, 4)>,
22+
<RA_PSEL(RA_PSEL_SPI, 2, 5)>;
23+
};
24+
};
25+
};
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/*
2+
* Copyright (c) 2024-2025 Renesas Electronics Corporation
3+
* Copyright (c) 2025 Pete Johanson
4+
* Copyright (c) 2026 Henry Xin
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/dts-v1/;
9+
10+
#include <renesas/ra/ra4/r7fa4m1ab3cfm.dtsi>
11+
#include <dt-bindings/gpio/gpio.h>
12+
#include <zephyr/dt-bindings/adc/adc.h>
13+
#include <dt-bindings/input/input-event-codes.h>
14+
#include "weact_ra4m1_core-pinctrl.dtsi"
15+
16+
/ {
17+
model = "WeAct RA4M1-Core";
18+
compatible = "renesas,ra4m1", "renesas,ra";
19+
20+
chosen {
21+
zephyr,sram = &sram0;
22+
zephyr,flash-controller = &flash;
23+
zephyr,flash = &flash0;
24+
zephyr,console = &uart1;
25+
zephyr,shell-uart = &uart1;
26+
zephyr,entropy = &trng;
27+
};
28+
29+
leds {
30+
compatible = "gpio-leds";
31+
32+
led1: led1 {
33+
gpios = <&ioport0 12 GPIO_ACTIVE_HIGH>;
34+
label = "LED1";
35+
};
36+
};
37+
38+
buttons {
39+
compatible = "gpio-keys";
40+
polling-mode;
41+
42+
button0: s1 {
43+
gpios = <&ioport0 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
44+
label = "Push button switch 1";
45+
zephyr,code = <INPUT_KEY_0>;
46+
};
47+
};
48+
49+
aliases {
50+
led0 = &led1;
51+
sw0 = &button0;
52+
watchdog0 = &wdt;
53+
};
54+
};
55+
56+
&xtal {
57+
clock-frequency = <DT_FREQ_M(16)>;
58+
mosel = <0>;
59+
#clock-cells = <0>;
60+
status = "okay";
61+
};
62+
63+
&subclk {
64+
status = "okay";
65+
};
66+
67+
&pll {
68+
clocks = <&xtal>;
69+
div = <2>;
70+
mul = <6 0>;
71+
status = "okay";
72+
};
73+
74+
&sci1 {
75+
pinctrl-0 = <&sci1_default>;
76+
pinctrl-names = "default";
77+
status = "okay";
78+
79+
uart1: uart {
80+
current-speed = <115200>;
81+
status = "okay";
82+
};
83+
};
84+
85+
&ioport0 {
86+
status = "okay";
87+
};
88+
89+
&ioport1 {
90+
status = "okay";
91+
};
92+
93+
&ioport2 {
94+
status = "okay";
95+
};
96+
97+
&ioport4 {
98+
status = "okay";
99+
};
100+
101+
&spi1 {
102+
pinctrl-0 = <&spi1_default>;
103+
pinctrl-names = "default";
104+
status = "okay";
105+
};
106+
107+
&trng {
108+
status = "okay";
109+
};
110+
111+
&wdt {
112+
status = "okay";
113+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
identifier: weact_ra4m1_core
2+
name: WeAct RA4M1 Core Board
3+
type: mcu
4+
arch: arm
5+
ram: 32
6+
flash: 256
7+
toolchain:
8+
- zephyr
9+
- gnuarmemb
10+
supported:
11+
- gpio
12+
- uart
13+
- watchdog
14+
vendor: weact
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# Copyright (c) 2026 Henry Xin
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Enable GPIO
6+
CONFIG_GPIO=y
7+
8+
# Enable Console
9+
CONFIG_SERIAL=y
10+
CONFIG_UART_INTERRUPT_DRIVEN=y
11+
CONFIG_UART_CONSOLE=y
12+
CONFIG_CONSOLE=y

0 commit comments

Comments
 (0)