RZ/G2L Getting Started

This page describes how to bring up your RZ/G2L evaluation board and how to run the sample application on  the board.


Step1 Getting the Evaluation Board Kit

RZ/G2L Evaluation Board Kit (EVK) is the most suitable board kit for RZ/G2L evaluation.RZ/G2L EVK consists of Module Board and Common carrier board.  
The module board conforms to the SMARC v2.1 standard.

RZ/G2L Getting the Evaluation Board Kit

 

 

Image
RZ/G2L Evaluation Board Kit

Included items

  • RZ/G2L Module Board (SMARC2.1)
  • Common Carrier Board 
  • USB cable (USB Type-A- Micro USB Type-B) 

* The following items need to be purchased separately by customers.

  • USB type C charger 65W
    • Support USB PD, QC
    • Output specification: 5V3A,9V3A,15V3A,20V3.25A
  • USB type C to type C cable
    • USB-C & USB-C 3.1 Gen2 USB-PD support 100W 
  • micro SD UHI-Class10 (8GB or more)

If you would like to display the USB camera capture images on the HDMI Display in Step2-4, please prepare the following items additionally.

  • USB camera (support UVC)
  • HDMI Display
  • micro-HDMI to HDMI cable

* If you would like to operate the Qt demo in Step7, please prepare the following item additionally.

  • USB mouse
  • HDMI Display
  • micro-HDMI to HDMI cable

 


Step2: Let’s try to run the “pre built image”

After getting the RZ/G2L EVK, download the Pre-Built Image and try running it. 

Please download the file (RZG2L_VLP3.0.3_Pre-built_Images_EN.zip) from the link below and decompress the file on your PC.

RZ/G2L Pre-built Images (RZG2L_VLP3.0.3_Pre-built_Images_EN.zip) (ZIP | English, 日本語)

 

Step2-1: Preparing the microSD card

Write the rzg2l_v303_sd_card.img included in Images_RZG2L_v3.0.3 to your microSD card.

<Case1: Using Windows PC>

  1. Copy the Images_RZG2L_v3.0.3.zip to Windows PC and unzip it.  
  2. Write the microSD card image (rzg2l_v3.0.3_sd_card.img) to the SD card which has a 2GB or more capacity by using any tool like as below:  

Win32 Disk Imager (Win32 Disk Imager download | SourceForge.net

         or  

balenaEtcher (balenaEtcher - Flash OS images to SD cards & USB drives). 

※If following message is shown when insert the microSD card to the Window PC or after write the image to the microSD card, please select “Cancel”. 

Image
Insert the microSD card message

 

<Case2: Using Linux Host PC>

※If you would like to program the image to your microSD card by Linux Host PC, see following steps.  

Prepare the microSD card by entering the following commands on your Linux PC.    

  1. Unzip the Images_RZG2L_v3.0.3.zip file to get the rzg2l_v3.0.3_sd_card.img.  
  2. Check the microSD Card Device Name: enter the lsblk command before and after inserting your microSD card.

※Be careful not to use other device names. (sdb is used in this document)  

<before inserting microSD card>.

$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT 
sda 8:0 0 30.9G 0 disk 
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 1K 0 part 
└─sda5 8:5 0 30.3G 0 part / 
sr0 11:0 1 1024M 0 rom
Image
Down Arrow

<after inserting microSD card>

$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT 
sda 8:0 0 30.9G 0 disk 
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 1K 0 part 
└─sda5 8:5 0 30.3G 0 part / 
sdb 8:16 1 29.7G 0 disk 
└─sdb1 8:17 1 29.7G 0 part
 
sr0 11:0 1 1024M 0 rom 
  1. Using the Device name found above, write the image file into the microSD card by dd command.
$ sudo dd if=<PATH>/rzg2l_v3.0.3_sd_card.img of=/dev/sdb status=progress
$ sync


After that, remove and insert the microSD card again to confirm that the image file has been written to the microSD card normally.  
 

Step2-2: Writing Bootloader and U-boot

Write bl2_bp-smarc-rzg2l_pmic.srec and fip-smarc-rzg2l_pmic.srec to the EVK board using Flash_Writer_SCIF_RZG2L_SMARC_PMIC_DDR4_2GB_1PCS.mot included in the Images_RZG2L_v3.0.3 folder.

<Main specification of the EVK>

The used components of the RZ/G2L EVK in this step are as follows.

Image
SMARC v2.1 Module board

 

<2-2-1 : Preparation of Hardware>

  1. Connect CN14 and your PC by USB Type-microAB cable,  connect USB-PD Power Charger and CN6 by USB Type-C cable.Then, you can see LED1(VBUS Power ON) and LED3 (Module PWR On) light up. 
Image
Preparation of Hardware
  1. Set the board to SCIF Download mode to write to the serial flash memory on the EVK board.  Please set the SW11 and the SW1 as below.
Image
SCIF Download Mode
  1. Press the power button(SW9) to turn on the power. Then LED4(Carrier PWR On) lights up additionally.

    ※When turn off the power, press and hold the power button for 2 seconds. Then, check that LED4 is turned off.

Image
Turn on the Power

 

<2-2-2 : Prepare to write>

  1. Bring up the terminal software on your PC. Please get the Tera Term (latest version) from the link below. Available at : Tera Term Open Source Project (osdn.jp)
  2. Select “Serial” as shown in the following picture.  “Port:” is “COM[number]:USB Serial Port (COM[number])”.
Image
USB Serial Port on Tera Term
  1. Select “Setup” > “Serial port” to set the settings about serial communication protocol on the software. Set each setting as below:
  • Baud rate : 115200
  • Date : 8 bit
  • Parity : none
  • Stop : 1 bit
  • Flow control : none  
     
Image
Serial Port Setup
  1. After serial port setting, press the reset button SW10 (blue-colored).Check the message below is displayed on the console. 
Image
Press the Reset Button SW10 (blue-colored)

 

<2-2-3 : Booting Flash Writer>

  1. Send an image of Flash Writer using terminal software after the message “please send !” is shown. Select the “File” > “Send file” menu.
Image
Send the Flash Writer Image
  1. Select Flash_Writer_SCIF_RZG2L_SMARC_PMIC_DDR4_2GB_1PCS.mot , and then click ”Open” button. The image will be sent to the board via serial connection. After successfully downloading the binary, Flash Writer starts automatically and shows a message like below on the terminal. 

    (a) During download

Image
During download

(b) After successfully downloading

Flash writer for RZ/G2L Series V1.06 Aug.10,2022 
Product Code : RZ/G2L 
>

 

<2-2-4 : Writing Bootloader>

  1. Next, two boot loader files need to be written to the target board.

Enter the following bolded commands.  
Send "bl2_bp-smarc-rzg2l_pmic.srec" by the terminal software as same manner in 2-2-3 after the message "please send !" is shown.

>XLS2 
===== Qspi writing of RZ/G2 Board Command ============= 
Load Program to Spiflash 
Writes to any of SPI address. 
Micron : MT25QU512 
Program Top Address & Qspi Save Address 
===== Please Input Program Top Address ============ 
Please Input : H'11E00 

===== Please Input Qspi Save Address === 
Please Input : H'00000 
Work RAM(H'50000000-H'53FFFFFF) Clear.... 
please send ! ('.' & CR stop load)

If you get the following message, press “y”.

SPI Data Clear(H'FF) Check : H'00000000-0000FFFF,Clear OK?(y/n)

After successfully write the binary, the message like below is shown on the console.( The address may be different depending on the version of the boot loader used. )

SPI Data Clear(H'FF) Check :H'00000000-0000FFFF Erasing..Erase Completed 
SAVE SPI-FLASH....... 
======= Qspi Save Information ================= 
SpiFlashMemory Stat Address : H'00000000 
SpiFlashMemory End Address  : H'0000CB28
===========================================================
  1. Next, write another loader file by using bolded commands again.

Send fip-smarc-rzg2l_pmic.srec by the terminal software as same manner in 2-2-4  2. after the message "please send !" is shown.

>XLS2 
===== Qspi writing of RZ/G2 Board Command ============= 
Load Program to Spiflash 
Writes to any of SPI address. 
Micron : MT25QU512 
Program Top Address & Qspi Save Address 
===== Please Input Program Top Address ============ 
Please Input : H'00000 

===== Please Input Qspi Save Address === 
Please Input : H'1D200 
Work RAM(H'50000000-H'53FFFFFF) Clear.... 
please send ! ('.' & CR stop load) 

If you get the following message, press “y”.

SPI Data Clear(H'FF) Check : H'00000000-0000FFFF,Clear OK?(y/n)

After successfully write the binary, the message like below is shown on the console.

( The address may be different depending on the version of the boot loader used. )

SPI Data Clear(H'FF) Check :H'00000000-0000FFFF Erasing..Erase Completed 
SAVE SPI-FLASH....... 
======= Qspi Save Information ================= 
SpiFlashMemory Stat Address : H'00000000 
SpiFlashMemory End Address  : H'0000CB28
===========================================================
  1. After writing two loader files normally, turn off the power of the board by pressing SW9.

 

Step2-3: Startup Linux

  1. Set the board to SPI Boot mode to start the Bootloader. 

Please change the SW11 as below (SW11-2 ON→OFF).

Insert your microSD card to the slot (CN10) on the carry board.  

Image
Start the Bootloader with SPI Boot Mode
  1. Turn on the power of the board by pressing the power button SW9.

The settings of Terminal in this process are the same as in 2-2-2.

Press the reset button SW10 and after "Hit any key to stop autoboot: "appears, press the enter key on the PC within 3 seconds.

U-Boot 2021.10 (Mar 31 2022 - 03:57:20 +0000) 
CPU: Renesas Electronics K rev 14.15 
Model: smarc-rzg2l 
DRAM: 1.9 GiB 
MMC: sd@11c00000: 0, sd@11c10000: 1 
Loading Environment from MMC... OK 
In: serial@1004b800 
Out: serial@1004b800 
Err: serial@1004b800 
Net: eth0: ethernet@11c20000 
Hit any key to stop autoboot: 0 
=> 

To set the environment variables, enter the bolded commands bellow.

=> env default -a 
## Resetting to default environment 
=> setenv bootargs 'root=/dev/mmcblk1p2 rootwait' 
=> setenv bootcmd 'mmc dev 1;fatload mmc 1:1 0x48080000 Image-smarc-rzg2l.bin; fatload mmc 1:1 0x48000000 Image-r9a07g044l2-smarc.dtb; booti 0x48080000 - 0x48000000' 
=> saveenv 
Saving Environment to MMC... Writing to MMC(0)….OK

Please turn off and on the power pressing SW9 again to boot up the board.

When “smarc-rzg2l login:” is displayed, enter “root” to login.(No password required)

                                                         :
                                                         :
Version: 3.0.3 
smarc-rzg2l login: root 
Last login: Sun Sep 20 10:44:03 UTC 2020
root@smarc-rzg2l:~#

 

Step2-4: Startup EVK

Let‘s actually start EVK. By this procedure, display the Capture image of the USB Camera on the HDMI Display.

 

  1. Connect the USB Camera, EVK, HDMI Display, and your PC as below.
Image
Connect the USB Camera, EVK, HDMI Display, and PC
  1. After EVK booting up, by the following command, the USB Camera Capture image which size of 1920×1080 will be displayed on the HDMI display.  
    The size can be changed with the options "width" and "height".
# gst-launch-1.0 v4l2src ! video/x-raw,format=YUY2,width=1920,height=1080 ! waylandsink

Also, you can confirm the image size supported by your USB camera by using the following command.

# v4l2-ctl --list-formats-ext
  1. In case you finish displaying the Capture image, push ”Ctrl” key and "c" on the Tera term.  The console changes to the command input screen.
  2. To power down the system, enter the command as below.
# shutdown –h now

Then, press the SW9 to turn off the power.


Step3: Linux environment requirement

STEP2 describes how to startup the RZ/G2L by using Pre-built image files.If you would like to build the Linux environment by yourself for Linux customization and application development, follow the STEP3 onwards.

 

Step3-1: Setting environment

The following equipments are used to build a Linux environment.

Equipment Description
Linux Host PC OS : Ubuntu 20.04 LTS
Windows PC OS : Windows 10
Used for controlling serial console of the target board  
Tera Term (latest version) is recommended.  
Available at:Tera Term Open Source Project (osdn.jp)
Please install the VCP Driver corresponding to the target board.  
Available at:VCP Drivers - FTDI (ftdichip.com)
USB serial to micro–USB Cable The type of USB serial connector on the Evaluation Board Kit is Micro USB type B.
Micro SD Card Use the microSD card of 8GB or more.

 

Step3-2: Build Instruction

This section describes the instructions to build the Linux environment.  
Before starting the build, enter the command below on the Linux Host PC to install packages used for building.  
※\:Indicates a single command without line breaks.

$ 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

Enter the commands below and set the user name and email address before starting the build procedure.   
※Without this setting, an error may occur when building procedure runs git command to apply patches.

$ git config --global user.email "[email protected]"
$ git config --global user.name "Your Name"

Please download the necessary packages to build the environment from the following links.

Copy all files to any directory in Linux Host PC.  
The directory which you put the files in is described as <package download directory> in next instructions.

Also, for more information on the Verified Linux Package (VLP), please refer to the following link.  

RZ/G Verified Linux Package [5.10-CIPversion] | Renesas  
 

(1) Decompress Yocto recipe package

Create a working directory at your home directory and decompress Yocto recipe package.Enter the commands below. The name and location of the working directory can be changed arbitrarily.

※Please note that your build environment must have 100GB of free hard drive space in order to complete the minimum build. If you are using a Virtual Machine, please check how much disk space you have allocated for your virtual environment.

$ mkdir ~/rzg_vlp_3.0.3
$ cd ~/rzg_vlp_3.0.3
$ cp ../<package download directory>/*.zip .
$ unzip ./RTK0EF0045Z0021AZJ-v3.0.3.zip
$ tar zxvf ./RTK0EF0045Z0021AZJ-v3.0.3/rzg_bsp_v3.0.3.tar.gz

(2) Enable Graphics and Video Codec features

To enable the Graphics on RZ/G2L and enter the commands below.

$ unzip ./RTK0EF0045Z13001ZJ-v1.0.5_EN.zip
$ tar zxvf ./RTK0EF0045Z13001ZJ-v1.0.5_EN/meta-rz-features_graphics_v1.0.5.tar.gz

To enable the Video Codec on RZ/G2L and enter the commands below.  

$ unzip ./RTK0EF0045Z15001ZJ-v1.1.0_EN.zip
$ tar zxvf ./RTK0EF0045Z15001ZJ-v1.1.0_EN/meta-rz-features_codec_v1.1.0.tar.gz

(3) Build Initialize

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

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

(4) Add layers

Please follow the below steps to add the layers. The steps add the settings to bblayers.conf.

  • Graphics:Please enter the below command to enable the Graphics library.
$ bitbake-layers add-layer ../meta-rz-features/meta-rz-graphics
  • Video Codec:Please enter the below command to enable the Video codec library.
$ bitbake-layers add-layer ../meta-rz-features/meta-rz-codecs
  • Qt : Please enter the below commands to include Qt.
$ bitbake-layers add-layer ../meta-qt5
$ bitbake-layers add-layer ../meta-rz-features/meta-rz-graphics
$ bitbake-layers add-layer ../meta-rz-features/meta-rz-codecs

Then, edit file build/conf/local.conf to install the Qt demo.

Please remove the comment marker #QT_DEMO = "1" as below. 

# Adding qt demonstration to core-image-qt or not 
QT_DEMO = "1"

(5) Setting “offline” environment (Optional) 

All source codes will be downloaded from the repositories of each OSS via the network when running bitbake command in the online environment. The build may fail if the OSS repository has been changed unintentionally. In that case, please use the “offline” environment.

This step is not mandatory and able to go to the step (6) in case the “offline” environment is not required.

Please download the OSS packages to build “offline” environment  from the following links.

 Open source packages 

Enter the following commands in the “build” directory and decompress the OSS package.

$ cp ../../<package download directory>/*.7z .
$ 7z x oss_pkg_rzg_v3.0.3.7z

 

If you want to prevent network access, please change the line in the “~/rzg_vlp_v3.0.3/build/conf/local.conf” as below:

BB_NO_NETWORK = "1"

( To change  BB_NO_NETWORK from "0" to "1" )

(6) Start a build

Chalcone the target file system image using bitbake.  Enter the commands below to start a build. Building an image can take up to a few hours depending on the user’s host system performance.

$ MACHINE=smarc-rzg2l bitbake core-image-qt

Please refer to RZ/G Verified Linux Package V3.0.3 Release Note about the supported build options ( Core-image-<target> ).

 

After the build is successfully completed, a similar output will be seen. 

NOTE: Tasks Summary: Attempted 7427 tasks of which 16 didn't need to be rerun and all succeeded.

Check the following files are generated in build/tmp/deploy/images.

RZ/G2L

Linux karnel

Image-smarc-rzg2l.bin

Device tree file

Image-r9a07g044l2-smarc.dtb

root filesystem

core-image-qt-smarc-rzg2l.tar.bz2

Boot loader

・bl2_bp-smarc-rzg2l_pmic.srec  
・fip-smarc-rzg2l_pmic.srec

Flash Writer

Flash_Writer_SCIF_RZG2L_SMARC_PMIC_DDR4_2GB_1PCS.mot

STEP4 Create the microSD card -On Linux Host PC-

If you do not use the Pre-Built Image, set the partition of the microSD card in this section

 

Step4-1: Prepare the microSD card

Please format the microSD card according to the following steps before using the card.  
Check the device name which is associated to the microSD card.  
Enter the “lsblk” command before and after inserting the microSD card.  
※Be careful not to use the other device names in the following steps. (sdb is used in this document)

<before inserting the microSD card>  
 

$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT 
sda 8:0 0 30.9G 0 disk 
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 1K 0 part 
└─sda5 8:5 0 30.3G 0 part / 
sr0 11:0 1 1024M 0 rom

<after inserting the microSD card>

$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT 
sda 8:0 0 30.9G 0 disk 
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 1K 0 part 
└─sda5 8:5 0 30.3G 0 part / 
sdb 8:16 1 29.7G 0 disk 
└─sdb1 8:17 1 29.7G 0 part
 
sr0 11:0 1 1024M 0 rom

 

Step4-2: Unmount the microSD card partitions

Unmount automatically mounted microSD card partitions.  
Enter the bolded commands as below.

※*If more than one partition has already been created on microSD card, unmount all partitions.  
  */<username>/395E-80B3 depend on your environment.

$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 745652 0 745652 0% /dev
:
snip
:
/dev/sdb1 511720 4904 506816 1% /media/<username>/395E-80B3
$ sudo umount /media/<username>/395E-80B3

 

Step4-3: Change the partition table

microSD card needs two partitions as listed below to startup Linux on the EVK board.

Type/Number

size

Filesystem

Contents

Primary #1

500MB (minimum128MB)

FAT32

Linux kernel  
Device tree

Primary #2

All remaining

Ext4

Root filesystem

Set the partition table using the “fdisk” command like this.  

$ sudo fdisk /dev/sdb
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): o

Created a new DOS disklabel with disk identifier 0x6b6aac6e.

Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)

Select (default p): p
Partition number (1-4, default 1): (Push the enter key)
First sector (2048-62333951, default 2048): (Push the enter key)
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-62333951, default 6233395
1): +500M

Created a new partition 1 of type 'Linux' and of size 500 MiB.
Partition #1 contains a vfat signature.

Do you want to remove the signature? [Y]es/[N]o: Y

The signature will be removed by a write command.

Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)

Select (default p): p
Partition number (2-4, default 2): (Push the enter key)
First sector (1026048-62333951, default 1026048): (Push the enter key)
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1026048-62333951, default 62333
951): (Push the enter key)

Created a new partition 2 of type 'Linux' and of size 29.2 GiB.

Command (m for help): p
Disk /dev/sdb: 29.74 GiB, 31914983424 bytes, 62333952 sectors
Disk model: Transcend
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos 
Disk identifier: 0x6b6aac6e 

Device Boot Start End Sectors Size Id Type 
/dev/sdb1 2048 1026047 1024000 500M 83 Linux 
/dev/sdb2 1026048 62333951 61307904 29.2G 83 Linux 

Filesystem/RAID signature on partition 1 will be wiped. 

Command (m for help): t 
Partition number (1,2, default 2): 1 
Hex code (type L to list all codes): b 

Changed type of partition 'Linux' to 'W95 FAT32’. 

Command (m for help): w 
The partition table has been altered. 
Syncing disks.


 

Then, check the partition table you created with the bolded commands below.

$ partprobe
$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 29.74 GiB, 31914983424 bytes, 62333952 sectors
Disk model: Maker name etc.
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6b6aac6e

Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 1026047 1024000 500M b W95 FAT32
/dev/sdb2 1026048 62333951 61307904 29.2G 83 Linux

 

Step4-4: Format and mount the partitions

Format the partitions using the commands below:

$ sudo mkfs.vfat -v -c -F 32 /dev/sdb1 
mkfs.fat 4.1 (2017-01-24) 
/dev/sdb1 has 64 heads and 32 sectors per track, 
hidden sectors 0x0800; 
logical sector size is 512, 
using 0xf8 media descriptor, with 1024000 sectors; 
drive number 0x80; 
filesystem has 2 32-bit FATs and 8 sectors per cluster. 
FAT size is 1000 sectors, and provides 127746 clusters. 
There are 32 reserved sectors. 
Volume ID is a299e6a6, no volume label. 
Searching for bad blocks 16848... 34256... 51152... 68304... 85072... 10209 6... 119376... 136528... 153552... 170576... 187472... 204624... 221648... 238 928... 256208... 273744... 290768... 308048... 325328... 342480... 359504... 3 76656... 393680... 410576... 427216... 444624... 462032... 479184... 495952... 

$ sudo mkfs.ext4 -L rootfs /dev/sdb2 
mke2fs 1.45.5 (07-Jan-2020) 
Creating filesystem with 7663488 4k blocks and 1916928 inodes 
Filesystem UUID: 63dddb3f-e268-4554-af51-1c6e1928d76c 
Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
4096000 

Allocating group tables: done 
Writing inode tables: done 
Creating journal (32768 blocks): done 
Writing superblocks and filesystem accounting information: done

 

Step4-5: Remount the microSD card

After format, remove the card reader and connect it again to mount the partitions.

 

Step4-6: Write files to the microSD card

Check the mount point name with “df” command.  
※・/<username>/58FC-A480 depend on your environment.

$ df 
Filesystem 1K-blocks Used Available Use% Mounted on 
udev 745652 0 745652 0% /dev 

snip 

/dev/sdb1 510984 16 510968 1% /media/<username>/58FC-A480 
/dev/sdb2 30041556 45080 28447396 1% /media/<username>/rootfs

Copy the file which made in STEP3-2 to the microSD card.

Copy Linux kernel ( Image-smarc-rzg2l.bin )  and Device tree file ( Image-r9a07g044l2-smarc.dtb ) to the first partition.

$ cp $WORK/build/tmp/deploy/images/smarc-rzg2l/Image-smarc-rzg2l.bin /media/<username>/58FC-A480
$ cp $WORK/build/tmp/deploy/images/smarc-rzg2l/Image-r9a07g044l2-smarc.dtb /media/<username>/58FC-A480

Expand root filesystem to the second partition.

$ cd /media/<username>/rootfs
$ sudo tar jxvf $WORK/build/tmp/deploy/images/smarc-rzg2l/core-image-qt-smarc-rzg2l.tar.bz2
$ sync

Step5 Writing Bootloader, U-boot

※If STEP2 has been done, STEP5 and STEP6 are NOT required.  
   
Write bl2_bp-smarc-rzg2l_pmic.srec and fip-smarc-rzg2l_pmic.srec to the EVK board using Flash_Writer_SCIF_RZG2L_SMARC_PMIC_DDR4_2GB_1PCS.mot.

1. Copy the following three files made in STEP3-2 on the Windows PC.

  • bl2_bp-smarc-rzg2l_pmic.srec
  • fip-smarc-rzg2l_pmic.srec
  • Flash_Writer_SCIF_RZG2L_SMARC_PMIC_DDR4_2GB_1PCS.mot

2. Follow the below section for the further step :

"Step2-2  Writing Bootloader and U-Boot   2-2-1 : preparation of hardware" ~ 2-2-4 : Writing Bootloader


Step6 Startup Linux

Executing the setting environment variable is refer to “Step2-3  Startup Linux” .


STEP7 Let’s try to run the Qt demo

After turning on the EVK board , the Qt demo will be run which have preinstalled.  
Connect Display(CN13) and computer mouse(CN12) to the EVK board as following.  
The icons will be displayed on the display and the Qt demo can be run.

(a) How to connect.

Image
Qt demo can be run

(b) Example of display during the Qt demo execution. 

Image
Qt demo execution

Step8 Building the cross-compile environment

Build the cross-compile environment to build any application.

To build Software Development Kit (SDK), enter the commands below after the STEP3-2 is finished.  
The SDK allows you to build custom applications outside of the Yocto environment, even on a completely different PC.

 

Step8-1 Build the SDK installer

Build the installer to install the SDK with the following commands.

$ cd ~/rzg_vlp_v3.0.3/build
$ MACHINE=smarc-rzg2l bitbake core-image-qt -c populate_sdk


After finishing to build, the SDK installer will be located in build/tmp/deploy/sdk/.

 

Step8-2 Install the SDK 

To run the installer, you would execute the following command:

$ cd $WORK/build/temp/deploy/sdk/
$ sudo sh poky-glibc-x86_64-core-image-qt-aarch64-smarc-rzg2l-toolchain-3.1.21.sh

After launching the SDK installer, set the target directory.  
Enter the red-colored commands here.

Poky (Yocto Project Reference Distro) SDK installer version 3.1.21
==================================================================
Enter target directory for SDK (default: /opt/poky/3.1.21):  (Push the enter key)
You are about to install the SDK to "/opt/poky/3.1.21". Proceed [y/N]? y
Extracting SDK.......................................................................
..........................................................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
$ . /opt/poky/3.1.21/environment-setup-aarch64-poky-linux
$ . /opt/poky/3.1.21/environment-setup-armv7vet2hf-neon-vfpv4-pokymllib32-linux-gnueabi

 

Step8-3 Set up the cross-compile environment

Please enter the below commands to enable the cross-compile environment.  
User needs to enter the above command for each login session.

$ source /opt/poky/3.1.21/environment-setup-aarch64-poky-linux

Step9 Let’s try to make the sample application

Describe the procedure to build the Linux application that runs on RZ/G2L in this section.  
In the following step, you make the sample project "Hello World" .  
You must build a core image for the target (STEP3-2 (6)) and prepare SDK before making an application (STEP8).

1. Make a work directory for the application on the Linux host PC. The directory name can be changed if necessary.

$ mkdir ~/helloworld
$ cd ~/helloworld

2. Make the following three files in the directory which was made above step :

  • Application file (hello.c)
  • Makefile (Makefile.am)
  • configurefile (configure.ac)

Here, the application is made by automake and autoconf.

Please make all three files by using the command like "vi" and copying the below sentences on the terminal.

  • hello.c
$ vi hello.c

 

#include <stdio.h>
main()
{
printf("Hello, world!\n");
}
  • Makefile.am
$ vi Makefile.am

 

bin_PROGRAMS = hello
hello_SOURCES = hello.c
  • configure.ac  
$ vi configure.ac

 

AC_INIT(hello.c)
AM_INIT_AUTOMAKE(hello,0.1)
AC_PROG_CC
AC_PROG_INSTALL
AC_OUTPUT(Makefile)

3. Enter the following commands to compile the application.

$ aclocal
$ autoconf
$ touch NEWS README AUTHORS ChangeLog
$ automake -a
$ ./configure $CONFIGURE_FLAGS

4. Make the application by the generated makefile. Enter the following command.

$ make

Check the application executable file ( sample file name is "hello" ) is generated in the "helloworld" directory.

5. Store the executable file of “Hello World” application to the microSD card. 

Enter the commands below.  
The application executable file should be stored in the second partition (rootfs).

$ cd /media/<username>/rootfs/usr/bin
$ sudo cp ~/helloworld/hello .
$ sudo chmod +x hello

6. Let’s try to run the "Hello world" sample application.

Insert your microSD card to the EVK board, after that turn on the power of RZ/G2L.  
Enter the following command to run the "Hello World" sample application.

root@rzg2l:~# hello
Hello, world!

You can confirm the application is running by “Hello, world !” is shown as above.