RZ/G2L SMARC Board by Renesas

From Renesas.info

<img height="200" style="float:right" src=renesas_rzg2l_carrier.jpg> ← RZ-G

πŸ“ŒThis page is for both the RZ/G2L and RZ/G2LC boards.

General Information

Board Version Identification (RZ/G2L only)

There are currently multiple versions of RZ/G2L boards with different components. (There is only 1 version of RZ/G2LC board). Please make note of what board you have.
Some boards require different software patches to be applied before building.

RZG2L Discrete vs PMIC.png

RZ/G2L Silicon version WS1 vs WS2:

  • The WS1 Silicon version has the specific date code "2050KC002" written on top of the device
  • The WS2 Silicon version has the text "RZ/G2L" written on top of the device

Discrete Power Design vs New Renesas PMIC Solution:

  • The Discrete Power design has the words "Renesas" written in white silk screen on the top edge of the board.
  • The PMIC Power design has the words "Renesas" written in white silk screen in the center the board. Also, the PMIC has the words Renesas on the top of the device.

Board Combinations:

Here are the only release of these boards:

  • 1st Release: WS1 Silicon + Discrete Power
  • 2nd Release: WS2 Silicon + Discrete Power
  • 3rd Release: WS2 Silicon + PMIC Power

Power Button on PMIC Boards:

  • On the PMIC boards, please press and hold the red power button for 2 seconds to turn ON and OFF.
  • If the "Carrier PWR On" LED does not turn green, please try again and hold the button longer.

Getting Started

1. Download the Linux BSP

  • Download the RZ/G2L Board Support Package from renesas.com.
  • Links to all the downloads can be found on this page here. Please refer to the RZ/G2L table.
  • ⚠️ You also need to download the "RZ/G2L Mali Graphic Library" package to enable graphics.
  • ⚠️ You also need to download the "RZ/G2L Codec Library" package to enable video encode/decode.


2. Build Environment

  • To build the BSP, you will need a Linux PC running Ubuntu 20.04. Only this Host OS version was tested.
  • You can use a Linux PC (recommended) or a Virtual Machine.

3. Build the BSP

  • 🚦 The instructions for building the BSP are located in the Release Note document (r01us0471ej0xxx-rz-g.pdf) that is included in the ZIP file download from renesas.com.
  • ⚠️ There are currently 3 versions of RZ/G2L boards (WS1-Discrete, WS2-Discrete, WS2-PMIC). Please review section Board Version Identification above. There is only 1 version of RZ/G2LC board. There is only 1 version of RZ/G2UL board.
  • ⚠️ If you are building core-image-weston or core-image-qt, you need to add Mali Graphics library mentioned in step 1.
  • If you have a RZ/G2L WS1 board (very rare), please review section 6 in the 'Release Note' of the BSP in detail before following the instructions in section 3.
  • ✨ To make the build faster, you can copy the downloads directory from an older BSP (rzg2l_bsp_v1.3/build/downloads -> rzg2l_bsp_v1.4/build/downloads) to skip downloading the same open source packages again.

4. Prepare an SD Card

  • The evaluation boards can be booted from SD Cards. The SD card must be formatted and loaded using a Linux PC. A helpful script has been created (usb_sd_partition) that you can run on your Linux PC.
  • Insert your micro SD card into a USB-SD-Card reader and then plug into a Linux PC.
  • Use the commands below to download the formatting script and run. Please select your card and choose the default settings.
$ wget https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/usb_sd_partition/usb_sd_partition.sh
$ chmod +x usb_sd_partition.sh
$ ./usb_sd_partition.sh
  • Use the commands below to copy the files you build with the BSP to the SD card. Start in the base of your Yocto BSP.
# Change to the Yocto output directory that contains the files
# Replace "smarc-rzg2l" to "smarc-rzg2lc" where needed
$ cd build/tmp/deploy/images/smarc-rzg2l

# Copy the Linux kernel and Device Tree to partition 1
$ sudo cp -v Image /media/$USER/RZ_FAT
$ sudo cp -v r9a07g044l2-smarc.dtb /media/$USER/RZ_FAT   # RZ/G2L
$ sudo cp -v r9a07g044c2-smarc.dtb /media/$USER/RZ_FAT   # RZ/G2LC

# Copy and expand the Root File System to partition 2
$ sudo tar -xvf core-image-minimal-smarc-rzg2l.tar.gz   -C /media/$USER/RZ_ext
    (or if using graphics)
$ sudo tar -xvf core-image-weston-smarc-rzg2l.tar.gz   -C /media/$USER/RZ_ext

# Make sure all files are finished writing before removing the USB card reader from the PC
$ sync
  • Safely remove your USB card reader by right clicking on the drive icon (either RZ_FAT or RZ_ext) in Ubuntu and selecting "Eject"

5. Power the Board and Connect to the Serial Port

  • Supply power the board using the USB-C connection on the carrier board labeled "Power Input"
  • On the carrier board, press the red button in order to turn on power to the board. The green LED labeled "Carrier PWR On" will be lit when power is on.
  • Now that the board is powered, plug a USB micro cable into the carrier board to the USB connector labeled "SER 3 UART". Use a serial terminal program to interact as you board. With a Linux PC, we recommend using "putty" (connects to /dev/USB0), and with a Windows PC we recommend "TeraTerm" that connects to COMx. The baud rate of the Serial connection is 115200 bps.
  • Press the blue reset button, and then "u-boot" will start. Within 3 seconds, press the space bar on your keyboard in order to stop the auto-boot sequence.

6. Switch settings for the CPU SOM board.

  • The SOM board contains a eMMC Flash device and a Micro SD Card socket. On the SOM board, you can only use one or the other because they are both connected to the same peripheral channel on the RZ/G2L.
  • Set the switches on the SOM board to what you want to use.
  • ⚠️ u-boot environment variables are always stored in eMMC Flash (not SPI flash). This means if you change switch SW1-2 to ON on the SOM board, you cannot access saved u-boot environments variables and you will always get the message "*** Warning - MMC init failed, using default environment"
  • Note that the SD Card slot on the Carrier board will always work regardless of the setting of SW1-2 because it uses a separate peripheral channel on the RZ/G2L.
  • On the SOM (CPU) board, there is a little switch (SW1) near the SD card socket.
SOM board uses SD Card socket                 SOM board uses eMMC Flash
SW1-1 = ON/OFF(JTAG)                          SW1-1 = ON/OFF(JTAG)
SW1-2 = ON                                    SW1-2 = OFF
      +-----+                                       +-----+
      | ON  |                                       | ON  |
      | = = |                                       | =   |
      |     |                                       |   = |
      | 1 2 |                                       | 1 2 |
      +-----+                                       +-----+

7-1. Boot the Board using SD Card on Carrier Board (Recommended)

  • Insert the SD card into the socket on Carrier Board.
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”‚     β”‚ SOM β”‚     β”‚
β”‚     β””β”€β”€β”€β”€β”€β”˜     β”‚
β”‚  Carrier Board  β”‚
β”‚     β”Œβ”€β”         β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       ↑
 SD Card Socket
  • Press the blue reset button, and then "u-boot" will start. Within 3 seconds, press the space bar on your keyboard in order to stop the auto-boot sequence.
  • At the u-boot prompt ( => ), enter the following commands to boot the board.
  • ⚠️ If you get an failure when saving with "saveenv", remove power to the board and try again.

RZ/G2L EVK:

   # Create command macros and save them:
=> setenv sd_boot1 'mmc dev 1 ; fatload mmc 1:1 0x48080000 Image ; fatload mmc 1:1 0x48000000 /r9a07g044l2-smarc.dtb'
=> setenv sd_boot2 'setenv bootargs 'root=/dev/mmcblk1p2 rootwait' ; booti 0x48080000 - 0x48000000'
=> setenv bootcmd 'run sd_boot1 sd_boot2'
=> saveenv

RZ/G2LC EVK:

   # Create command macros and save them:
=> setenv sd_boot1 'mmc dev 1 ; fatload mmc 1:1 0x48080000 Image ; fatload mmc 1:1 0x48000000 /r9a07g044c2-smarc.dtb'
=> setenv sd_boot2 'setenv bootargs 'root=/dev/mmcblk1p2 rootwait' ; booti 0x48080000 - 0x48000000'
=> setenv bootcmd 'run sd_boot1 sd_boot2'
=> saveenv

Reset the board and it will automatically boot

7-2. Boot the Board using eMMC Flash on SOM Board

  • Set switch SW1-2 = OFF
  • The boot loader (u-boot) by default will try to boot from

Sample and Demo Code

(coming soon)

Board Setup Information

board configuration.png
RZ/G2L Evaluation Board Kit Configuration
smarc module board top.png
RZ/G2L SMARC Module Board (TOP)
smarc module board bottom.png
RZ/G2L SMARC Module Board (Bottom)
smarc series carrier board.png
RZ SMARC Series Carrier Board
 
power supply.png
Power Supply
The following power supply environment is used in the evaluation of Renesas:
● USB Type-C cable CB-CD23BK (manufactured by Aukey)
● USB PD Charger Anker PowerPort III 65W Pod (manufactured by Anker)
JTAG connection ice debug.png
JTAG Cable Connection for ICE Debugging
When connecting JTAG debugger, please set the DIP SW1 settings as shown.
The JTAG connector is 10pin.
 
boot mode.png
How to set Boot Modes

Board Operation Information

power on.png
Power ON
● Connect USB-PD Power Charger to USB Type-C Connector. Then LED1(VBUS PWR On) and LED3(Module PWR On) lights up.
● Press SW9 to turn on the power. Then LED4(Carrier PWR On) lights up.
debug serial.png
Debug Serial (Console Output)
● Debug serial uses CN14. The baud rate is 115200bps.
● Since the serial-USB conversion IC is not always powered, the Windows PC will recognize it after the power switch is turned on.
● If it is not recognized by your Windows PC, please install the driverοΏ½https://www.ftdichip.com/Drivers/VCP.htm

LCD Monitors

The following LCD monitor were tested with this board.

Using the Coral MIPI Camera

As of the RZ/G2L BSP v1.3 release, the Coral Camera module (OV5645) is supported and enabled.

MIPI CSI Configuration and Resolution Selection
Before you can use the camera, you must first configure the MIPI CSI module to capture image.
MIPI CSI configuration is done by using media-ctl utility from v4l-utils package.
The first 2 commands below enable the camera.
Below that are commands you use to select the camera resolution you want to capture.

[ Camera Setup ]
media-ctl -d /dev/media0 -r
media-ctl -d /dev/media0 -l "'rzg2l_csi2 10830400.csi2':1 -> 'CRU output':0 [1]"

[Select resolution 1280x960 ]
media-ctl -d /dev/media0 -V "'rzg2l_csi2 10830400.csi2':1 [fmt:UYVY8_2X8/1280x960 field:none]"
media-ctl -d /dev/media0 -V "'ov5645 0-003c':0 [fmt:UYVY8_2X8/1280x960 field:none]"

[Select resolution 1920x1080 ]
media-ctl -d /dev/media0 -V "'rzg2l_csi2 10830400.csi2':1 [fmt:UYVY8_2X8/1920x1080 field:none]"
media-ctl -d /dev/media0 -V "'ov5645 0-003c':0 [fmt:UYVY8_2X8/1920x1080 field:none]"

[Select resolution 2592x1944 ]
media-ctl -d /dev/media0 -V "'rzg2l_csi2 10830400.csi2':1 [fmt:UYVY8_2X8/2592x1944 field:none]"
media-ctl -d /dev/media0 -V "'ov5645 0-003c':0 [fmt:UYVY8_2X8/2592x1944 field:none]"

Capture Images using GStreamer
This command can be used capture images and display them on the screen in weston.

gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! waylandsink

Build Qt in BSP V1.3

BSP V1.3 already supports to build core-image-qt. Please follow these instructions to add Qt to the build.
Start in the base of the Yocto BSP directory.

$ git clone https://github.com/meta-qt5/meta-qt5
$ cd meta-qt5
$ git checkout c1b0c9f546289b1592d7a895640de103723a0305
$ cd ..

It also comes with Qt demoes. If you want to build the demos, enable QT_DEMO = "1" in conf/local.conf.

  • Edit file /build/conf/local.conf
  • Remove the comment marker # to set QT_DEMO = "1"
# Adding qt demonstration to core-image-qt or not
QT_DEMO = "1"

There is an issue in BSP V1.3 to play the multimedia file by gstreamer or gst-launch-1.0. This issue is fixed in BSP V1.3_update1.

In BSP V1.3 it can be fixed by editing the file:

  • rzg2l_bsp_v1.3/meta-rzg2/dynamic-layers/qt5-layer/images/core-image-qt.bb

and adding the following lines to the file:

require recipes-multimedia/image/core-image-weston.inc

Now you can build core-image-qt.

$ bitbake core-image-qt

After the build is complete, copy the new root file system to your SD Card

$ cd build/tmp/deploy/images/smarc-rzg2l
$ sudo tar -xvf core-image-qt-smarc-rzg2l.tar.gz   -C /media/$USER/RZ_ext
$ cd -
$ sync

After the board boots, on the Weston desktop you will see icons that will start the demos.

Enable eMMC Boot

eMMC Boot refers to the SoC booting directly from eMMC flash after RESET. This means SPI Flash is not used.

eMMC boot support was added after BSP v1.3 was released.

The follow commands (copy/paste) and instructions will allow you to manually download, build and program your board.

Instructions                              
# Download and install a toolchain
# Linaro Toolchain, Version 7.5.0-2019.12
sudo mkdir -p /opt/linaro
cd /opt/linaro
sudo wget https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
sudo tar xvf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
cd -   # this command puts you back to your original directory :)

# Make sure you have all the build utilities you need
sudo apt-get install git make gcc g++ libncurses5-dev libncursesw5-dev python bison flex libssl-dev

# Create a new Directory
mkdir rzg2l_emmc_boot
cd rzg2l_emmc_boot

#---------------------------------------------------
# Download FlashWriter
#---------------------------------------------------
git clone https://github.com/renesas-rz/rzg2_flash_writer
cd rzg2_flash_writer ; git checkout rz_g2l ; cd ..      # NOTE: Only for  RZG2L
cd rzg2_flash_writer ; git checkout rz_v2l ; cd ..      # NOTE: Only for  RZV2L


#---------------------------------------------------
# Download TrustedFirmware-A
#---------------------------------------------------
git clone https://github.com/renesas-rz/rzg_trusted-firmware-a
cd rzg_trusted-firmware-a ; git checkout v2.5/rzg2l ; cd ..    # It building RZG2L
cd rzg_trusted-firmware-a ; git checkout v2.5/rzv2l ; cd ..    # It building RZV2L


#---------------------------------------------------
# Download mbed
# mbed code is needed to build Trusted Firmware-A
#---------------------------------------------------
git clone git://github.com/ARMmbed/mbedtls.git
cd mbedtls ; git checkout mbedtls-2.16.3 ; cd ..    # NOTE: For RZG2L and RZV2L


#---------------------------------------------------
# Download u-boot
#---------------------------------------------------
git clone https://github.com/renesas-rz/renesas-u-boot-cip
cd renesas-u-boot-cip ; git checkout v2020.10/rzg2l ; cd ..    # NOTE: Only for  RZG2L
cd renesas-u-boot-cip ; git checkout v2020.10/rzv2l ; cd ..    # NOTE: Only for  RZV2L


#---------------------------------------------------
# Download build scripts
#---------------------------------------------------
wget https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/build_scripts/build_common.sh
wget https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/build_scripts/build_flashwriter.sh
wget https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/build_scripts/build_tfa.sh
wget https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/build_scripts/build_uboot.sh
chmod +x *.sh


#---------------------------------------------------
# Configure build system
#
# - Select "smarc-rzg2l" or "smarc-rzg2l"
# - All output files will be in directory "output_smarc-rzg2l" or "output_smarc-rzv2l"
#---------------------------------------------------
./build.sh s

#---------------------------------------------------
# build Flash Writer
#
# - Select toolchain "Linaro gcc-linaro-7.5.0-2019.12 " that you installed
# - Change "eMMC Flash programming support" from "(default)" to "ENABLE"
# - Select 'Build'
#---------------------------------------------------
./build.sh f

#---------------------------------------------------
# build u-boot
#---------------------------------------------------
# * Select toolchain "Linaro gcc-linaro-7.5.0-2019.12" that you installed
./build.sh u

#---------------------------------------------------
# build TF-A
#
# - Select toolchain "Linaro gcc-linaro-7.5.0-2019.12" that you installed
# - Change "Boot Device" to "eMMC Flash"
# - Select 'Build'
#---------------------------------------------------
./build.sh t

#---------------------------------------------------
# Download 'Flash Writer Tool'
# - Configure for our output directory 
# - Configure for board "smarc-rzg2l" or for RZV2L "smarc-rzv2l"
# - Configure for eMMC Flash boot
#---------------------------------------------------
git clone https://github.com/renesas-rz/rzg2_bsp_scripts
cd rzg2_bsp_scripts/flash_writer_tool
echo "CONFIG_FILE=config.ini" > settings.txt

echo "FILES_DIR=../../output_smarc-rzg2l" > config.ini # NOTE: Only for RZG2L
echo "FILES_DIR=../../output_smarc-rzv2l" > config.ini # NOTE: Only for RZV2L

echo "FLASH=1" >> config.ini
echo "BOARD=smarc-rzg2l" >> config.ini
echo "BOARD_VERSION=PMIC" >> config.ini        # NOTE: Only if you have a board with PMIC Power Supply
echo "BOARD_VERSION=DISCRETE" >> config.ini    # NOTE: Only if you have a board with Discrete Power Supply

#---------------------------------------------------
# Run 'Flash Writer Tool'
#---------------------------------------------------
./flash_writer_tool.sh

Step 1. Select "Show Switches" to show how to put board into SCIF Download mode
Step 2. Select "Download F.W."
Step 3. Select "eMMC boot setup"
Step 4. Select "Program BL2"
Step 5. Select "Program FIP"
Step 6. Select "Show Switches" to show how to put board into eMMC Boot mode
Step 7. Select "<SAVE-and-EXIT>"

Program On-Board eMMC Flash

  • To program the eMMC Flash device on the SOM board, you can follow the instructions below.
  • You will need to boot with SD card first and partition eMMC Flash device. Then you can load the files from SD card to eMMC Flash.

1. Copy listed files to β€œ/home/root” of the SD Card that you use to boot the system.

RZG2L : core-image-weston-smarc-rzg2l.tar.gz, Image and r9a07g044l2-smarc.dtb

RZV2L : core-image-weston-smarc-rzv2l.tar.gz, Image and r9a07g054l2-smarc.dtb

2. Boot the board with the SD card and log into Linux.

3. Partition the eMMC Flash using fdisk.

  • In fdisk, use the commands 'n' to make a new partition, and 'w' to write the partition (will automatically exit fdisk)
  • In fdisk, you can just press the Enter Key to select the default value (you do not have to type the default value)
root@smarc-rzg2l:~# fdisk /dev/mmcblk0
Command (m for help): n
Partition number (1-128, default 1): 1                <<<< just press ENTER for default value
First sector (34-124321758, default 2048): 2048       <<<< just press ENTER for default value
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-124321758, default 124321758): 124321758  <<<< just press ENTER for default value
Created a new partition 1 of type 'Linux filesystem' and of size 59.3 GiB.

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

4. Format the partition as ext4

root@smarc-rzg2l:~# mkfs.ext4 -L rootfs /dev/mmcblk0p1

5. Mount the ext4 partition to "/mnt".

root@smarc-rzg2l:~# mount /dev/mmcblk0p1 /mnt

6. Extract the file system to the ext4 partition

RZG2L

root@smarc-rzg2l:~# cd /home/root
root@smarc-rzg2l:~# tar -zxvf core-image-weston-smarc-rzg2l.tar.gz -C /mnt
root@smarc-rzg2l:~# cp Image /mnt/boot
root@smarc-rzg2l:~# cp r9a07g044l2-smarc.dtb /mnt/boot
root@smarc-rzg2l:~# sync

RZV2L

root@smarc-rzg2l:~# cd /home/root
root@smarc-rzg2l:~# tar -zxvf core-image-weston-smarc-rzv2l.tar.gz -C /mnt
root@smarc-rzg2l:~# cp Image /mnt/boot
root@smarc-rzg2l:~# cp r9a07g044l2-smarc.dtb /mnt/boot
root@smarc-rzg2l:~# sync

7. Unmount β€œ/mnt”

root@smarc-rzg2l:~# umount /mnt

8. Reboot and change the boot parameter in u-boot to boot from eMMC

=> setenv bootargs 'rw rootwait earlycon root=/dev/mmcblk0p1'
=> setenv bootcmd 'ext4load mmc 0:1 0x48080000 boot/Image; ext4load mmc 0:1 0x48000000 boot/r9a07g044l2-smarc.dtb; booti 0x48080000 - 0x48000000'
=> saveenv
=> boot

Fix qmake missing in BSP v1.1 and BSP v1.3

To created an SDK package that can build Qt applications, you use this command:

bitbake core-image-qt -c populate_sdk

However, there is an issue where when the Qt SDK is created, the qmake utility is not added to the SDK toolchain. This means you will not be able to build Qt user applications.

This can be fixed by editing the file:

  • rzg2l_bsp_v1.3/meta-rzg2/dynamic-layers/qt5-layer/images/core-image-qt.bb

and adding the following lines to the file:

inherit populate_sdk_qt5
TOOLCHAIN_HOST_TASK_append = " nativesdk-qtwayland-tools " 
FEATURE_PACKAGES_tools-sdk += " packagegroup-qt5-toolchain-target kernel-devsrc " 

This will be fixed for BSP v1.4