RZ Gateway Solution Linux Environment Preparation

RZ Gateway Solution Linux Environment Preparation

Requirements

To build Yocto Linux, the equipment below should be prepared:

Equipment

Details

Equipment

Details

Linux PC

Approximately 110GB free space is necessary

OS

Ubuntu 20.04 LTS

64bit OS must be used

For newer OS version please use a container.
Renesas has a guide for creating a container for Linux Yocto builds:
renesas-rz/docker_setup: Instructions and scripts for creating docker containers to be used to build RZ BSP images

Step 1: Linux Download 

Get the Verified Linux Package (version 3.0.6-update3)
RZ/G Verified Linux Package [5.10-CIP] | Renesas

Note: Downloading the VLP will require user to create a Renesas account

Step 2: Build Instructions

Description:

Follow Instruction described in Linux Start-up Guide & RZ/G Verified Linux Package Version 3.0.6-update3 - Release Note to apply the necessary patches beforehand.
Note: patches application are detailed in below detailed instructions.

Detailed Instruction:

Assumption:
$WORK is the current working directory.

Install packages to build the Verified Linux Package / RZ BSP 

sudo apt-get update sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \ xz-utils debianutils iputils-ping libsdl1.2-dev xterm p7zip-full libyaml-dev \ libssl-dev bmap-tools

Configure Git by setting the user name and email address before starting the build procedure

Note: Without this setting, an error occurs when building procedure runs git command to apply patches

git config --global user.email "you@example.com" git config --global user.name "Your Name"

Copy all files obtained from Renesas into your Linux Host PC prior to the steps below.
The directory which you put the files in is described as <package download directory> in the build instructions

Create a working directory at your home directory, and decompress Yocto recipe package

mkdir ~/rz_gateway_sol cd ~/rz_gateway_sol cp ../<package download directory>/*.zip . unzip ./RTK0EF0045Z0021AZJ-v3.0.6-update3.zip tar zxvf ./RTK0EF0045Z0021AZJ-v3.0.6-update3/rzg_vlp_v3.0.6.tar.gz

Copy the RZ gateway solution patch directory from GitHub

If not downloaded, the RZ Gateway Solution repository can also be cloned:

git clone https://github.com/renesas-rz/rz-gateway-solution.git

Patch folders are located in the path below:

rz-gateway-solution/Patch/

The folder is structured as below:

Patch/ |__ RZG2L/patch-gw-sol-g2l |__ RZG3S/patch-gw-sol |__ other-patches

For RZ/G3S

cp ../<path-to-patch>/other-patches ./ cp ../<path-to-patch>/patch-gw-sol ./

For RZ/G2L

cp -r ../<path-to-patch>/other-patches ./ cp -r ../<path-to-patch>/patch-gw-sol-g2l ./

Download AWS meta-aws repository

git clone https://github.com/aws4embeddedlinux/meta-aws.git cd meta-aws git checkout dunfell cd ..

Download RAUC meta-rauc repository

git clone https://github.com/rauc/meta-rauc.git cd meta-rauc git checkout dunfell cd ..

Apply all necessary patches

For v.3.0.6-update3 VLP:

patch -p1 < ./RTK0EF0045Z0021AZJ-v3.0.6-update3/vlpg306-to-vlpg306update3.patch cd meta-renesas patch -p1 < ../extra/0001-rz-common-recipes-debian-buster-glibc-update-to-v2.2.patch patch -p1 < ../extra/0001-rz-common-linux-update-linux-kernel-to-the-latest-re.patch patch -p1 < ../extra/0001-rz-common-gst-plugins-bad-Depending-bayer2raw-if-lay.patch

For Debian related dead links:

patch -p1 < ../other-patches/0001-meta-rz-common-recipes-core-debian-glibc-fix-CVE-2025-4802.patch patch -p1 < ../other-patches/0002-meta-rz-common-glib2.0-update-to-2.58.3-2-deb10u8.patch patch -p1 < ../other-patches/0003-rz-common-recipes-debian-buster-switch-some-packages.patch cd ..

For RZ/G2L - AWS IoT Greengrass & RAUC firmware OTA support:

patch -p1 <./patch-gw-sol-g2l/0001-Enabling-linux-configs-required-for-aws-greengrass.patch patch -p1 <./patch-gw-sol-g2l/0002-Enabling-meta-aws-on-VLP-Linux.patch patch -p1 <./patch-gw-sol-g2l/0003-Enable-aws-tools-and-greengrass-development-tools-to.patch patch -p1 <./patch-gw-sol-g2l/0004-Enable-config-to-support-GPLv3-Licence.patch patch -p1 <./patch-gw-sol-g2l/0005-Fixing-meta-aws-dependencies-issues-on-VLP-linux.patch patch -p1 <./patch-gw-sol-g2l/0006-Fixing-corretto-11-bin-packaging-issue.patch patch -p1 <./patch-gw-sol-g2l/0007-Fixing-aws-greengrass-core-sdk-c-lib-package-issue.patch patch -p1 <./patch-gw-sol-g2l/0008-Integration-of-u-boot-env-tools.patch patch -p1 <./patch-gw-sol-g2l/0009-Restructure-the-partitions-for-OTA-up.patch patch -p1 <./patch-gw-sol-g2l/0010-Enable-linux-configuration-for-meta-rauc.patch patch -p1 <./patch-gw-sol-g2l/0011-Enable-rauc-on-core-bsp-image.patch patch -p1 <./patch-gw-sol-g2l/0012-Fix-the-busybox-issue.patch patch -p1 <./patch-gw-sol-g2l/0013-Setup-env-for-aws-greengrass-deployme.patch patch -p1 <./patch-gw-sol-g2l/0014-Enable-openssh-for-IDT-tool-connectiv.patch patch -p1 <./patch-gw-sol-g2l/0015-Adding-bootargs-required-for-AWS-Greengrass-to-U-Boo.patch patch -p1 <./patch-gw-sol-g2l/0016-U-boot-Adding-u-boot-env-to-MMC.patch patch -p1 <./patch-gw-sol-g2l/0017-u-boot-Added-dual-copy-support.patch patch -p1 <./patch-gw-sol-g2l/0018-u-boot-Added-dual-copy-support-to-u-boot-env-tools.patch patch -p1 <./patch-gw-sol-g2l/0019-u-boot-Added-support-to-generate-u-boot-default-env-.patch patch -p1 <./patch-gw-sol-g2l/0020-Adding-wks-config-and-default-u-boot-env-and.patch patch -p1 <./patch-gw-sol-g2l/0021-Kernel-Enable-WDT0-at-Linux-boot-time.patch patch -p1 <./patch-gw-sol-g2l/0022-u-boot-Adding-env-required-for-rauc.patch patch -p1 <./patch-gw-sol-g2l/0023-RAUC-Create-RAUC-configurations.patch patch -p1 <./patch-gw-sol-g2l/0024-Adding-zip-command-to-core-image-bsp.patch

For RZ/G3S - PMOD Sensor & AWS IoT Greengrass support:

patch -p1 <../patch-gw-sol/0001_kernel_version_up.patch patch -p1 <../patch-gw-sol/0003-image-append-greengrass.patch patch -p1 <../patch-gw-sol/0004-rzg3s-linux-Add-I2C-support.patch patch -p1 <../patch-gw-sol/0005-conf-files-aws-gg.patch patch -p1 <../patch-gw-sol/0006-rzg3s-aws-iot-cfg.patch patch -p1 <../patch-gw-sol/0007-rzg3s-linux-configs-Add-legacy-sysfs-interface-for-G.patch cd ../meta-aws patch -p1 <../patch-gw-sol/0002-aws-build.patch

[For Firmware OTA - RZ/G2L] Replace the Key ring file

Before initializing the build as described below follow the instruction from RZ/G2L - Firmware Over-The-Air (FOTA) Update to generate a new Key ring file and replacing the existing one.

Initialize a build using the 'oe-init-build-env' script in Poky and point TEMPLATECONF to RZ platform conf path

For RZ/G2L:

TEMPLATECONF=$PWD/meta-renesas/meta-rzg2l/docs/template/conf/ source poky/oe-init-build-env build

For RZ/G3S:

TEMPLATECONF=$PWD/meta-renesas/meta-rzg3s/docs/template/conf/ source poky/oe-init-build-env build

Start the build

For RZ/G2L:

MACHINE=smarc-rzg2l bitbake core-image-bsp

For RZ/G3S:

MACHINE=smarc-rzg3s bitbake core-image-bsp

If the build is successful,a message similar to the following will appear:

All necessary files will be generated by the bitbake command and will be located in:
$WORK/build/tmp/deploy/images/smarc-<RZ device>/

Step 3: SD Card Preparation

The previously generated core-image-bsp-smarc-<RZ device>.wic.gz binary will be used within the $WORK/rz-gateway/build/tmp/deploy/images/smarc-<RZ device> directory.

Use the lsblk command to check the device name as follows:

    • Before inserting the SD card:

lsblk

Output Example:

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT         (snip)     nvme0n1     259:0    0 465.8G  0 disk     ├─nvme0n1p1 259:1    0   512M  0 part /boot/efi     └─nvme0n1p2 259:2    0 465.3G  0 part /

   • After inserting the SD card:

lsblk

Output Example:

 NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT         (snip)     nvme0n1     259:0    0 465.8G  0 disk     ├─nvme0n1p1 259:1    0   512M  0 part /boot/efi     └─nvme0n1p2 259:2    0 465.3G  0 part /     sda           8:0    1  14.5G  0 disk     ├─sda1        8:1    1   500M  0 part /media/user/boot     └─sda2        8:2    1   3.4G  0 part /media/user/rootfs

Note: The device name is assigned to the SD card by Linux on your Host PC. 
It may be named /dev/sd* (* is a letter representing the physical drive). It is /dev/sda in this sample.

  • Unmount the SD card if it is already mounted

Use umount command with mount points that are displayed when you executed lsblk command.
For example:

umount /media/user/boot umount /media/user/rootfs

    • Write the image to the SD card
Use bmaptool command with device name of SD card is displayed when you executed lsblk command. For example:

sudo bmaptool copy core-image-bsp-smarc-rzg2l.wic.gz /dev/sda

Step 4: EVK Board Booting

For RZ/G2L

  • Setup RZ/G2L EVK's peripheral

 

a. Insert the previously prepared microSD card into the microSD card slot

b. Connect the LAN cable to the Ethernet connector (bottom)

c. Connect the USB serial cable to the serial port. The other end is to be connected to a Windows P

d. Connect the Type-C USB cable to the power connector port. Two green LED will light up.

  • Power up the board by pressing 1 second the Power button.

  •  After successfully booting up the board, 
    on serial console, log in under root account:

    smarc-rzg2l login: root

For RZ/G3S

Setup RZ/G3S EVK's peripheral

a. Connect US082-HS3001EVZ  PMOD sensors to PMOD0 - Type-2A.

b. Insert the previously prepared microSD card into the microSD card slot

c. Connect the LAN cable to the Ethernet connector (bottom)

d. Connect the USB serial cable to the serial port. The other end is to be connected to a Windows P

e. Connect the Type-C USB cable to the power connector port. Two green LED will light up.

  • Power up the board by pressing 1 second the Power button.

  • [Only first time] On Windows PC, right after powering up the board press ENTER from the TeraTerm console.
    Next, set the following in U-boot interface:

    setenv bootcmd 'run bootcmd_check;run bootimage' setenv prodsdbootargs 'setenv bootargs rw rootwait earlycon root=/dev/mmcblk1p2 cgroup_enable=memory cgroup_memory=1 systemd.unified_cgroup_hierarchy=0' saveenv run bootcmd
  •  After successfully booting up the board, 
    on serial console, log in under root account:

    smarc-rzg3s login: root