Board description
The RZ/G2L microprocessor includes a Cortex®-A55 (1.2 GHz) CPU, 16-bit DDR3L / DDR4 interface, 3D graphics engine with Arm Mali-G31 and video codec (H.264). It also has many interfaces such as camera input, display output, USB 2.0, and Gbit-Ether, making it ideal for applications such as entry-class industrial human-machine interfaces (HMIs) and embedded devices with video capabilities.
Test results
The Yocto Project releases in the table below have been tested by the Mender community. Please update it if you have tested this integration on other Yocto Project releases:
Yocto Project | Build | Runtime |
---|---|---|
dunfell (3.1) |
Build Means that the Yocto Project build using this Mender integration completes without errors and outputs images.
Runtime Means that Mender has been verified to work on the board. For U-Boot-based boards, the integration checklist has been verified.
Getting started
Prerequisites
- A supported Linux distribution and dependencies installed on your workstation/laptop as described in the Yocto Mega Manual
- NOTE. Instructions depend on which Yocto version you intend to use.
- Google repo tool installed and in your
PATH
.
Configuring the build
Setup Yocto environment
Set the Yocto Project branch you are building for:
# set to your branch, make sure it is supported (see table above)
export BRANCH="dunfell"
Create a directory for your mender-rzg2l
setup to live in and clone the
meta information.
mkdir mender-rzg2l && cd mender-rzg2l
Initialize repo manifest:
repo init -u https://github.com/mendersoftware/meta-mender-community \
-m meta-mender-renesas/scripts/manifest-renesas.xml \
-b ${BRANCH}
Fetch layers in manifest:
repo sync
Setup build environment
Initialize the build environment:
source setup-environment renesas
Configure Mender server URL (optional)
This section is not required for a successful build but images that are generated by default are only suitable for usage with the Mender client in Standalone deployments, due to lack of server configuration.
You can edit the conf/local.conf
file to provide your Mender server configuration, ensuring the generated images and Mender Artifacts are connecting to the Mender server that you are using. There should already be a commented section in the generated conf/local.conf
file and you can simply uncomment the relevant configuration options and assign appropriate values to them.
Build for Hosted Mender:
# To get your tenant token:
# - log in to https://hosted.mender.io
# - click your email at the top right and then "My organization"
# - press the "COPY TO CLIPBOARD"
# - assign content of clipboard to MENDER_TENANT_TOKEN
#
MENDER_SERVER_URL = "https://hosted.mender.io"
MENDER_TENANT_TOKEN = "<copy token here>"
Building the image
You can now proceed with building an image:
bitbake core-image-minimal
Replace core-image-minimal
with your desired image target, keep in mind the image core-image-minimal
is the one tested.
Setup the board
For flashing and setting up the board, follow the official Renesas documentation.
The board can boot in different modes, the SW11 switch is responsable to define the boot mode and input voltage mode. SW11[4] = 1, means 5V input and SW11[4] = 0, means 9V as input voltage.
Boot Mode | SW11[1…4] |
---|---|
QSPI Mode | 0001 |
SCIF Download Mode | 0101 |
eMMC | 1001 |
eSD | 1101 |
The board also has a debug mode & main boot device selection
Debug mode | SW1[1] |
---|---|
JTAG | 0 |
Normal operation | 1 |
Boot devie | SW1[2] |
---|---|
eMMC on the SoM | 0 |
microSD on the SoM | 1 |
Power on/off the board
- Press and hold for 1 second the SW9 push button to power on the board. The LED4 should be on.
- To turn it off, press and hold for 2 seconds the SW9 push button.
Booting the Flash Writer
The following is the serial configuration for the board
Variable | Value |
---|---|
Speed | 115200 bauds |
Data | 8bit |
Parity | None |
Stop bit | 1bit |
Flow control | None |
To enable send files to the board, set the SW11 switch to SCIF Download Mode (0101)
TeraTerm > File > Send file > Open the Flash Writer file > Send the file.
Writing the bootloader
In the device terminal (Tera Term session), run the XLS2
and send both bootloader files with their repective addresses.
Variable | Value | Address to RAM | Address to ROM |
---|---|---|---|
Linux kernel | Image-smarc-rzg2l.bin | 0x48080000 | - |
Device tree file | Image-r9a07g044l2-smarc.dtb | 0x48000000 | - |
Boot loader | bl2_bp-smarc-rzg2l_pmic.srec fip-smarc-rzg2l_pmic.srec |
11E00 0000 |
0000 1D200 |
Flash Writer | Flash_Writer_SCIF_RZG2L_SMARC_PMIC_DDR4_2GB_1PCS.mot | - | - |
Root FS | IMAGE_NAME-smarc-rzg2l.tar.bz2 | - | - |
In case a message to prompt to clear data, enter “y”.
Using Renesas Macro to flash
There is an available macro to flash using Tera Term easily.
Create a folder with the following structure:
renesas_macro
├── Binaries
│ ├── bl2...
│ └── fip...
└── rzg2l_smarc-rzg2l_flash_writer.ttl
Copy the binaries files to flash and load the macro:
TeraTerm > Control > Macro > Open Macro File
Preparing the microSD card
The SD layout it is as following
Type/Number | Size | Filesystem | Contents |
---|---|---|---|
Primary #1 | 500MB (minimum 128MB) | FAT32 | Linux kernel Device tree |
Primary #2 | 1/2 of remaining | Ext4 | AB Root filesystem |
Primary #3 | 1/2 of remaining | Ext4 | AB Root filesystem |
Primary #4 | TBD | Ext4 | Data partition |
Repartitioning
- Run
fdisk
command to repartition the microSD card
# fdisk /dev/SD_DEV
-
Enter
o
(new DOS disklabel) -
Enter
n
(boot partition)-
p
(primary partition) -
Enter
(keep the default) -
+500M
(the size) -
Enter
(keep the default) -
Y
(remove the signatures)
-
-
Enter
n
(rootfs partition)p
-
Enter
(keep the default) -
Enter
(keep the default) -
+2048M
(the size) -
Y
(remove the signatures)
Repeat the step 3 to create the additional partition for AB system & data
-
Enter
p
(review the changes) -
Enter
t
(change partition type)-
1
(boot partition) -
b
(W95 FAT32)
-
-
Enter
w
(save & write the changes)
Validate the partitions
- Run the following commands
$ partprobe
# fdisk -l /dev/SD_DEV
Validate the microSD card has the wanted layout
Format the partitions
# mkfs.vfat -v -c -F 32 /dev/SD_DEV_1
# mkfs.ext4 -L rootfs /dev/SD_DEV_2
# mkfs.ext4 -L rootfs /dev/SD_DEV_3
# mkfs.ext4 -L rootfs /dev/SD_DEV_4
Copying files
- Create mounting directories
# mkdir /mnt/sd_boot
# mkdir /mnt/sd_rootfs_a
# mkdir /mnt/sd_rootfs_b
# mkdir /mnt/sd_data
- Mount the partitions
# mount /dev/SD_DEV_1 /mnt/sd_boot
# mount /dev/SD_DEV_2 /mnt/sd_rootfs_a
# mount /dev/SD_DEV_3 /mnt/sd_rootfs_b
# mount /dev/SD_DEV_4 /mnt/sd_data
- Check the partitions correctly mounted
$ df
- Copy the boot files
$ cp $WORK/build/tmp/deploy/images/<board>/<Linux kernel> /mnt/sd_boot/Image-smarc-rzg2l.bin
$ cp $WORK/build/tmp/deploy/images/<board>/<Device tree> /mnt/sd_boot/Image-r9a07g044l2-smarc.dtb
- Expand the rootfs in partition 2 & 3
$ cd /mnt/sd_rootfs_a
# tar jxvf $WORK/build/tmp/deploy/images/<board>/<root filesystem>
$ cd /mnt/sd_rootfs_b
# tar jxvf $WORK/build/tmp/deploy/images/<board>/<root filesystem>
- Copy the fw_env.config file
$ mkdir -p /mnt/sd_data/u-boot
$ cp meta-mender-renesas/misc/fw_env.config /data/u-boot/fw_env.config
- Copy the device_type file
$ mkdir -p /mnt/sd_data/mender
$ cp meta-mender-renesas/misc/device_type /data/mender/device_type
Boot and setup U-boot
To use U-boot, set the SW11 switch to QSPI Mode (0001). On first boot, reset the environment:
env default -a
saveenv
Then you can boot the board with boot
command or reset it.
References
- The Renesas RZ/G2L template files can be found in meta-mender-community
- The official Mender documentation explains how Mender works. This is simply a board-specific complement to the official documentation.