Skip to content

Commit 7638952

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

File tree

11 files changed

+321
-0
lines changed

11 files changed

+321
-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_RA4M2
5+
select SOC_R7FA4M2AD3CFP
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=R7FA4M2AD")
5+
6+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

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