Skip to content

Commit 82b4a05

Browse files
Phuc Phamfabiobaltieri
authored andcommitted
boards: renesas: Add minimal support for Renesas RZ/G2UL-SMARC
Add minimal support for board Renesas RZ/G2UL-SMARC Signed-off-by: Phuc Pham <phuc.pham.xr@bp.renesas.com> Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
1 parent 872d5cf commit 82b4a05

9 files changed

+294
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_RZG2UL_SMARC
5+
select SOC_R9A07G043U11GBG
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board_runner_args(jlink "--device=R9A07G043U11")
5+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/renesas/rzg2ul_smarc/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: rzg2ul_smarc
3+
full_name: RZ/G2UL SMARC Evaluation Board Kit
4+
vendor: renesas
5+
socs:
6+
- name: r9a07g043u11gbg
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
.. zephyr:board:: rzg2ul_smarc
2+
3+
Overview
4+
********
5+
6+
The Renesas RZ/G2UL SMARC Evaluation Board Kit (RZ/G2UL-EVKIT) consists of a SMARC v2.1 module board and a carrier board.
7+
8+
* Device: RZ/G2UL (Type-1) R9A07G043U11GBG
9+
10+
* Cortex-A55 Single, Cortex-M33
11+
* BGA361pin, 13mmSq body, 0.5mm pitch
12+
13+
* SMARC v2.1 Module Board Functions
14+
15+
* DDR4 SDRAM: 1GB x 1pc
16+
* QSPI flash memory: 128Mb x 1pc `AT25QL128A <https://www.renesas.com/en/products/memory-logic/non-volatile-memory/spi-nor-flash/at25ql128a-128mbit-17v-minimum-spi-serial-flash-memory-dual-io-quad-io-and-qpi-support>`_
17+
* eMMC memory: 64GB x 1pc
18+
* The microSD card slot is implemented and used as an eSD for boot
19+
* 5-output clock oscillator `5P35023 <https://www.renesas.com/en/products/clocks-timing/clock-generation/programmable-clocks/5p35023-versaclock-3s-programmable-clock-generator>`_ implemented
20+
* PMIC power supply `DA9062 <https://www.renesas.com/en/products/power-management/multi-channel-power-management-ics-pmics/da9062-pmic-designed-applications-requiring-85a>`_ implemented
21+
22+
* Carrier Board Functions
23+
24+
* The FFC/FPC connector is mounted as standard for connection to high-speed serial interface for camera module.
25+
* The Micro-HDMI connector via DSI/HDMI conversion module is mounted as standard for connection to high-speed serial interface for digital video module.
26+
* The Micro-AB receptacle (ch0: USB2.0 OTG) and A receptacle (ch1: USB2.0 Host) are respectively mounted as standard for connection to USB interface.
27+
* The RJ45 connector is mounted as standard for software development and evaluation using Ethernet.
28+
* The audio codec is mounted as standard for advance development of audio system. The audio jack is implemented for connection to audio interface.
29+
* The Micro-AB receptacles are implemented for connection to asynchronous serial port interface.
30+
* The microSD card slot and two sockets for PMOD are implemented as an interface for peripheral functions.
31+
* For power supply, a mounted USB Type-C receptacle supports the USB PD standard.
32+
33+
Hardware
34+
********
35+
36+
The Renesas RZ/G2UL MPU documentation can be found at `RZ/G2UL Group Website`_
37+
38+
.. figure:: rzg2ul_block_diagram.webp
39+
:width: 600px
40+
:align: center
41+
:alt: RZ/G2UL group feature
42+
43+
RZ/G2UL block diagram (Credit: Renesas Electronics Corporation)
44+
45+
Supported Features
46+
==================
47+
48+
.. zephyr:board-supported-hw::
49+
50+
Programming and Debugging
51+
*************************
52+
53+
Applications for the ``rzg2ul_smarc`` board can be built in the usual way as
54+
documented in :ref:`build_an_application`.
55+
56+
Console
57+
=======
58+
59+
By default, `J-Link RTT Viewer`_ is used by Zephyr running on CM33 for providing serial console.
60+
The only serial port (SER3_UART micro-USB) is reserved for CA55 to run Linux.
61+
62+
.. note::
63+
64+
Set SW1-1 on the board to "OFF" to select JTAG debug mode, which is required for
65+
RTT to work.
66+
67+
There are two ways to use the RTT Viewer on this board. The basic steps for each method are
68+
described below:
69+
70+
1. Using with Ozone
71+
-------------------
72+
73+
After the Zephyr application has been built successfully, open J-Link RTT Viewer and configure the
74+
connection as follows:
75+
76+
- **Connect to J-Link**: Existing Session (enable Auto Reconnect)
77+
- **RTT Control Block**: Auto Detection
78+
- Click **OK**
79+
80+
Next, open `Ozone Debugger`_ and choose "Create New Project". Inside the "New Project Wizard"
81+
configure the settings as follows:
82+
83+
- **Device**: R9A07G043U11
84+
- **Register Set**: Cortex-M33
85+
- Click **Next**
86+
- **Target Interface**: SWD
87+
- **Target Interface Speed**: 4MHz
88+
- **Host Interface**: USB
89+
- Click **Next**
90+
- Set the full path of ``zephyr.elf`` file. The path should resemble ``zephyrproject/zephyr/build/zephyr/zephyr.elf``
91+
- Click **Next**, leave all options by default, and click **Finish**
92+
- Press **F5** to download and reset program
93+
94+
2. Using with U-Boot
95+
--------------------
96+
97+
After the Zephyr application has been built successfully, open the ``zephyr.map`` file located in
98+
``zephyrproject\zephyr\build\zephyr\zephyr.map``. Locate the symbol ``_SEGGER_RTT`` and copy its
99+
address value in hexadecimal.
100+
101+
Then, perform the "Flashing" steps described below to run the Zephyr application using U-Boot. As soon as the
102+
application is invoked, open J-Link RTT Viewer and configure the connection as follows:
103+
104+
- **Connect to J-Link**: USB
105+
- **Specify Target Device**: R9A07G043U11 (enable Force go on connect)
106+
- **Target Interface & Speed**: SWD @ 4000 kHz
107+
- **RTT Control Block**: Select "Address", then paste the address of the ``_SEGGER_RTT`` symbol copied earlier.
108+
- Click **OK**
109+
110+
.. note::
111+
112+
When using RTT Viewer with a Zephyr application launched by U-Boot, it is important to connect
113+
the RTT Viewer immediately after executing the U-Boot command sequence. This helps avoid losing
114+
early log output.
115+
116+
Debugging
117+
=========
118+
119+
It is possible to load and execute a Zephyr application binary on
120+
this board on the Cortex-M33 System Core from
121+
the internal SRAM, using ``JLink`` debugger (:ref:`jlink-debug-host-tools`).
122+
123+
Here is an example for building and debugging with the :zephyr:code-sample:`hello_world` application.
124+
125+
.. zephyr-app-commands::
126+
:zephyr-app: samples/hello_world
127+
:board: rzg2ul_smarc/r9a07g043u11gbg/cm33
128+
:goals: build debug
129+
130+
Flashing
131+
========
132+
133+
RZ/G2UL-EVKIT is designed to start different systems on different cores.
134+
It uses Yocto as the build system to build Linux system and boot loaders
135+
to run Zephyr on Cortex-M33 with u-boot. The minimal steps are described below.
136+
137+
1. Follow "2.2 Building Images" of `SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide`_ to prepare the build environment.
138+
139+
2. At step (4), follow step "2. Download Multi-OS Package" and "3. Add the layer for Multi-OS Package"
140+
of "3.2 OpenAMP related stuff Integration for RZ/G2L, RZ/G2LC and RZ/G2UL" of `Release Note for RZ/G Multi-OS Package V2.2.0`_
141+
to add the layer for Multi-OS Package.
142+
143+
.. code-block:: console
144+
145+
$ cd ~/rzg_vlp_<pkg ver>
146+
$ unzip <Multi-OS Dir>/r01an5869ej0220-rzg-multi-os-pkg.zip
147+
$ tar zxvf r01an5869ej0220-rzg-multi-os-pkg/meta-rz-features_multi-os_v2.2.0.tar.gz
148+
$ bitbake-layers add-layer ../meta-rz-features/meta-rz-multi-os/meta-rzg2l
149+
150+
3. Start the build:
151+
152+
.. code-block:: console
153+
154+
$ MACHINE=smarc-rzg2ul bitbake core-image-minimal
155+
156+
The below necessary artifacts will be located in the build/tmp/deploy/images
157+
158+
+---------------+------------------------------------------------------+
159+
| Artifacts | File name |
160+
+===============+======================================================+
161+
| Boot loader | bl2_bp-smarc-rzg2ul.srec |
162+
| | |
163+
| | fip-smarc-rzg2ul.srec |
164+
+---------------+------------------------------------------------------+
165+
| Flash Writer | Flash_Writer_SCIF_RZG2UL_SMARC_DDR4_1GB_1PCS.mot |
166+
+---------------+------------------------------------------------------+
167+
168+
4. Follow "4.2 Startup Procedure" of `SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide`_ for power supply and board setting
169+
at SCIF download (SW11[1:4] = OFF, ON, OFF, ON) and (SW1[1:3] = ON, OFF, OFF)
170+
171+
5. Follow "4.3 Download Flash Writer to RAM" of `SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide`_ to download Flash Writer to RAM
172+
173+
6. Follow "4.4 Write the Bootloader" of `SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide`_ to write the boot loader
174+
to the target board by using Flash Writer.
175+
176+
7. Follow "4.5 Change Back to Normal Boot Mode" with switch setting (SW11[1:4] = OFF, OFF, OFF, ON) and (SW1[1:2] = ON, OFF)
177+
178+
8. Follow "3. Preparing the SD Card" of `SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide`_ to write files to the microSD Card
179+
180+
9. Copy zephyr.bin file to microSD card
181+
182+
10. Follow "4.4.2 CM33 Sample Program Invocation with u-boot" from the beginning to step 4 of `Release Note for RZ/G Multi-OS Package V2.2.0`_
183+
184+
11. Execute the commands stated below on the console to start zephyr application with CM33 core.
185+
Here, "N" stands for the partition number in which you stored zephyr.bin file.
186+
187+
.. code-block:: console
188+
189+
Hit any key to stop autoboot: 2
190+
=> dcache off
191+
=> mmc dev 1
192+
=> fatload mmc 1:N 0x00010000 zephyr.bin
193+
=> fatload mmc 1:N 0x40010000 zephyr.bin
194+
=> cm33 start_normal 0x00010000 0x40010000
195+
=> dcache on
196+
197+
Troubleshooting
198+
===============
199+
200+
By default, the only valid serial port (SER3_UART micro-USB port) controlled by SCIF0 is used by Linux to
201+
print Linux console output. Therefore, in order to use it from Zephyr, the Linux console must first be disabled.
202+
To do this, run the following command in the Linux console to unbind the SCIF0 driver:
203+
204+
.. code-block:: console
205+
206+
$ echo 1004b800.serial | tee /sys/bus/platform/drivers/sh-sci/unbind
207+
208+
This allows the SCIF0 to be accessed from the Zephyr side in debug mode for providing serial console.
209+
Please note that the SCIF0 driver is disabled by default on the Zephyr side to prevent conflicts.
210+
211+
References
212+
**********
213+
214+
.. target-notes::
215+
216+
.. _RZ/G2UL Group Website:
217+
https://www.renesas.com/en/products/microcontrollers-microprocessors/rz-mpus/rzg2ul-general-purpose-microprocessors-single-core-arm-cortex-a55-10ghz-cpu-and-single-core-arm-cortex-m33
218+
219+
.. _RZG2UL-EVKIT Website:
220+
https://www.renesas.com/en/products/microcontrollers-microprocessors/rz-mpus/rzg2ul-evkit-evaluation-board-kit-rzg2ul-mpu
221+
222+
.. _SMARC EVK of RZ/G2L, RZ/G2LC, RZ/G2UL Linux Start-up Guide:
223+
https://www.renesas.com/en/document/gde/smarc-evk-rzg2l-rzg2lc-rzg2ul-linux-start-guide-rev106
224+
225+
.. _Release Note for RZ/G Multi-OS Package V2.2.0:
226+
https://www.renesas.com/en/document/rln/release-note-rzg-multi-os-package-v220?r=1522841
227+
228+
.. _J-Link RTT Viewer:
229+
https://www.segger.com/products/debug-probes/j-link/tools/rtt-viewer
230+
231+
.. _Ozone Debugger:
232+
https://www.segger.com/products/development-tools/ozone-j-link-debugger/
Binary file not shown.
Binary file not shown.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
9+
#include <zephyr/dt-bindings/input/input-event-codes.h>
10+
#include <arm/renesas/rz/rzg/r9a07g043.dtsi>
11+
#include "rzg2ul_smarc-pinctrl.dtsi"
12+
13+
/ {
14+
model = "Renesas RZ/G2UL SMARC";
15+
compatible = "renesas,rzg2ul-smarc";
16+
17+
chosen {
18+
zephyr,sram = &ddr;
19+
};
20+
21+
ddr: memory@60010000 {
22+
compatible = "mmio-sram";
23+
reg = <0x60010000 DT_SIZE_M(46)>;
24+
};
25+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
identifier: rzg2ul_smarc/r9a07g043u11gbg/cm33
2+
name: Cortex-M33 for Renesas RZ/G2UL SMARC
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
supported:
9+
- uart
10+
- gpio
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_XIP=n
5+
6+
# Enable console
7+
CONFIG_CONSOLE=y
8+
9+
# Segger RTT
10+
CONFIG_RTT_CONSOLE=y
11+
CONFIG_USE_SEGGER_RTT=y

0 commit comments

Comments
 (0)