Skip to content

Commit d95ebf9

Browse files
quytranpzznashif
authored andcommitted
boards: renesas: Add initial support for EK-RA4M3 board
Initial commit to support Renesas EK-RA4M3 board Signed-off-by: Quy Tran <[email protected]> Signed-off-by: Duy Phuong Hoang. Nguyen <[email protected]>
1 parent 41e140d commit d95ebf9

File tree

11 files changed

+323
-0
lines changed

11 files changed

+323
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_EK_RA4M3
5+
select SOC_R7FA4M3AF3CFB
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+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board_runner_args(jlink "--device=R7FA4M3AF")
5+
6+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/renesas/ek_ra4m3/board.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
board:
2+
name: ek_ra4m3
3+
vendor: renesas
4+
socs:
5+
- name: r7fa4m3af3cfb
51.1 KB
Loading
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
.. _ek_ra4m3:
2+
3+
RA4M3 Evaluation Kit
4+
####################
5+
6+
Overview
7+
********
8+
9+
The Renesas RA4M3 group of 32-bit microcontrollers (MCUs) uses the high-performance
10+
Arm® Cortex®-M33 core with TrustZone. In concert with the secure crypto engine, it
11+
offers secure element functionality. The RA4M3 is built on a highly efficient 40nm
12+
process, built on FreeRTOS—and is expandable to use other RTOSes and middleware.
13+
The RA4M3 is suitable for IoT applications requiring vast communication options, future
14+
proof security, large embedded RAM, and low active power consumption down to 119µA/MHz
15+
running the CoreMark® algorithm from Flash.
16+
17+
The MCU in this series incorporates a high-performance Arm Cortex®-M33 core running up to
18+
100 MHz with the following features:
19+
20+
**MCU Native Pin Access**
21+
- R7FA4M3AF3CFB
22+
- 100-pin LQFP package
23+
- 100 MHz Arm® Cortex®-M33 core
24+
- 1 MB Code Flash, 128 KB SRAM
25+
- 144 pins, LQFP package
26+
- Native pin access through 4 x 40-pin male headers
27+
- MCU and USB current measurement points for precision current consumption measurement
28+
- Multiple clock sources - RA MCU oscillator and sub-clock oscillator crystals, providing precision
29+
24.000 MHz and 32,768 Hz reference clock. Additional low-precision clocks are available internal to the
30+
RA MCU
31+
32+
**System Control and Ecosystem Access**
33+
- USB Full Speed Host and Device (micro AB connector)
34+
- Three 5 V input sources
35+
36+
- USB (Debug, Full Speed)
37+
- External power supply (using surface mount clamp test points and power input vias)
38+
39+
Three Debug modes
40+
41+
- Debug on-board (SWD)
42+
- Debug in (ETM, SWD, and JTAG)
43+
- Debug out (SWD)
44+
45+
User LEDs and buttons
46+
47+
- Three User LEDs (red, blue, green)
48+
- Power LED (white) indicating availability of regulated power
49+
- Debug LED (yellow) indicating the debug connection
50+
- Two User buttons
51+
- One Reset button
52+
53+
- Five most popular ecosystems expansions
54+
55+
- 2 Seeed Grove® system (I2C/Analog) connectors
56+
- SparkFun® Qwiic® connector
57+
- 2 Digilent PmodTM (SPI and UART) connectors
58+
- ArduinoTM (Uno R3) connector
59+
- MikroElektronikaTM mikroBUS connector
60+
61+
- MCU boot configuration jumper
62+
63+
**Special Feature Access**
64+
- 32 MB (256 Mb) External Quad-SPI Flash
65+
66+
.. figure:: ek-ra4m3-board.webp
67+
:align: center
68+
:alt: RA4M3 Evaluation Kit
69+
70+
EK-RA4M3 Board Functional Area Definitions (Credit: Renesas Electronics Corporation)
71+
72+
Hardware
73+
********
74+
Detail Hardware feature for the RA4M3 MCU group can be found at `RA4M3 Group User's Manual Hardware`_
75+
76+
.. figure:: ra4m3-block-diagram.webp
77+
:width: 442px
78+
:align: center
79+
:alt: RA4M3 MCU group feature
80+
81+
RA4M3 Block diagram (Credit: Renesas Electronics Corporation)
82+
83+
Detail Hardware feature for the EK-RA4M3 MCU can be found at `EK-RA4M3 - User's Manual`_
84+
85+
Supported Features
86+
==================
87+
88+
The below features are currently supported on Zephyr OS for EK-RA4M3 board:
89+
90+
+-----------+------------+----------------------+
91+
| Interface | Controller | Driver/Component |
92+
+===========+============+======================+
93+
| GPIO | on-chip | gpio |
94+
+-----------+------------+----------------------+
95+
| MPU | on-chip | arch/arm |
96+
+-----------+------------+----------------------+
97+
| NVIC | on-chip | arch/arm |
98+
+-----------+------------+----------------------+
99+
| UART | on-chip | serial |
100+
+-----------+------------+----------------------+
101+
102+
Other hardware features are currently not supported by the port.
103+
104+
Programming and Debugging
105+
*************************
106+
107+
Applications for the ``ek_ra4m3`` board target configuration can be
108+
built, flashed, and debugged in the usual way. See
109+
:ref:`build_an_application` and :ref:`application_run` for more details on
110+
building and running.
111+
112+
Flashing
113+
========
114+
115+
Program can be flashed to EK-RA4M3 via the on-board SEGGER J-Link debugger.
116+
SEGGER J-link's drivers are avaialbe at https://www.segger.com/downloads/jlink/
117+
118+
To flash the program to board
119+
120+
1. Connect to J-Link OB via USB port to host PC
121+
122+
2. Make sure J-Link OB jumper is in default configuration as describe in `EK-RA4M3 - User's Manual`_
123+
124+
3. Execute west command
125+
126+
.. code-block:: console
127+
128+
west flash -r jlink
129+
130+
Debugging
131+
=========
132+
133+
You can use Segger Ozone (`Segger Ozone Download`_) for a visual debug interface
134+
135+
Once downloaded and installed, open Segger Ozone and configure the debug project
136+
like so:
137+
138+
* Target Device: R7FA4M3AD
139+
* Target Interface: SWD
140+
* Target Interface Speed: 4 MHz
141+
* Host Interface: USB
142+
* Program File: <path/to/your/build/zephyr.elf>
143+
144+
**Note:** It's verified that we can debug OK on Segger Ozone v3.30d so please use this or later
145+
version of Segger Ozone
146+
147+
References
148+
**********
149+
- `EK-RA4M3 Website`_
150+
- `RA4M3 MCU group Website`_
151+
152+
.. _EK-RA4M3 Website:
153+
https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ek-ra4m3-evaluation-kit-ra4m3-mcu-group
154+
155+
.. _RA4M3 MCU group Website:
156+
https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ra4m3-100mhz-arm-cortex-m33-trustzone-high-integration-rich-connectivity
157+
158+
.. _EK-RA4M3 - User's Manual:
159+
https://www.renesas.com/us/en/document/mat/ek-ra4m3-v1-users-manual
160+
161+
.. _RA4M3 Group User's Manual Hardware:
162+
https://www.renesas.com/us/en/document/man/ra4m3-group-users-manual-hardware
163+
164+
.. _Segger Ozone Download:
165+
https://www.segger.com/downloads/jlink#Ozone
55.3 KB
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
&pinctrl {
7+
sci0_default: sci0_default {
8+
group1 {
9+
/* tx rx */
10+
psels = <RA_PSEL(RA_PSEL_SCI_0, 4, 11)>,
11+
<RA_PSEL(RA_PSEL_SCI_0, 4, 10)>;
12+
};
13+
};
14+
};
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <renesas/ra/ra4/r7fa4m3af3cfb.dtsi>
9+
#include <dt-bindings/gpio/gpio.h>
10+
#include "ek_ra4m3-pinctrl.dtsi"
11+
12+
/ {
13+
model = "Renesas EK-RA4M3";
14+
compatible = "renesas,ra4m3", "renesas,ra";
15+
16+
chosen {
17+
zephyr,sram = &sram0;
18+
zephyr,flash = &flash0;
19+
zephyr,console = &uart0;
20+
zephyr,shell-uart = &uart0;
21+
};
22+
23+
leds {
24+
compatible = "gpio-leds";
25+
led1: led1 {
26+
gpios = <&ioport4 15 GPIO_ACTIVE_HIGH>;
27+
label = "LED1";
28+
};
29+
led2: led2 {
30+
gpios = <&ioport4 4 GPIO_ACTIVE_HIGH>;
31+
label = "LED2";
32+
};
33+
led3: led3 {
34+
gpios = <&ioport4 0 GPIO_ACTIVE_HIGH>;
35+
label = "LED3";
36+
};
37+
};
38+
39+
aliases {
40+
led0 = &led1;
41+
};
42+
};
43+
44+
&xtal {
45+
clock-frequency = <DT_FREQ_M(24)>;
46+
mosel = <0>;
47+
#clock-cells = <0>;
48+
status = "okay";
49+
};
50+
51+
&subclk {
52+
status = "okay";
53+
};
54+
55+
&pll {
56+
source = <RA_PLL_SOURCE_MAIN_OSC>;
57+
div = <RA_PLL_DIV_3>;
58+
mul = <25 0>;
59+
freq = <DT_FREQ_M(200)>;
60+
status = "okay";
61+
};
62+
63+
&sci0 {
64+
pinctrl-0 = <&sci0_default>;
65+
pinctrl-names = "default";
66+
status = "okay";
67+
uart0: uart {
68+
current-speed = <115200>;
69+
status = "okay";
70+
};
71+
};
72+
73+
&ioport4 {
74+
status = "okay";
75+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
identifier: ek_ra4m3
2+
name: Renesas EK-RA4M3
3+
type: mcu
4+
arch: arm
5+
ram: 128
6+
flash: 1024
7+
toolchain:
8+
- zephyr
9+
- gnuarmemb
10+
supported:
11+
- gpio
12+
- uart
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=100000000
5+
6+
# Enable GPIO
7+
CONFIG_GPIO=y
8+
CONFIG_PINCTRL=y
9+
10+
# Enable Console
11+
CONFIG_SERIAL=y
12+
CONFIG_UART_INTERRUPT_DRIVEN=y
13+
CONFIG_UART_CONSOLE=y
14+
CONFIG_CONSOLE=y
15+
16+
CONFIG_BUILD_OUTPUT_HEX=y
17+
CONFIG_BUILD_NO_GAP_FILL=y

0 commit comments

Comments
 (0)