RZ/G2L SMARC Board by Renesas

From Renesas.info
Jump to navigation Jump to search

← 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 that is included in the ZIP file download from renesas.com. However, the steps below fix some bugs in the instructions.
  • ⚠️ There are currently 3 versions of RZ/G2L boards (WS1-Discrete, WS2-Discrete, WS2-PMIC) and there is only 1 version of RZ/G2LC board. Please review section Board Version Identification above.
  • ⚠️ 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 v1.3 in detail before following the instructions in section 3.
  • ✨ BSP v1.3-update1 has been released. It is recommended over all other versions.
  • To make the build faster, you can copy the downloads directory from an older BSP (rzg2l_bsp_v1.1/build/downloads -> rzg2l_bsp_v1.3/build/downloads) to skip downloading the same open source packages again.

Please choose the correct board:

Simple build instructions for RZ/G2L,G2LC SMARC BSP v1.3-update2                              

These instructions are a summary of what is explained in the BSP Release Note, and contain additional information that is not in the Release Notes.

### Extract BSP v1.3 update2 package (inside the zip file) that was downloaded from renesas.com
$ mkdir rzg2l_bsp_v1.3
$ tar -xf rzg2l_bsp_v1.3.tar.gz -C rzg2l_bsp_v1.3
$ cd rzg2l_bsp_v1.3

### Apply the update2 patch (inside the zip file)
### Copy the patch file (v1.3-to-v1.3update2.patch) to the base of the BSP directory and apply the patches.
$ patch -p1 < v1.3-to-v1.3update2.patch
$ cd meta-rzg2
$ for i in ../extra/v1.3update2_patches/*.patch; do patch -p1 < $i; done
$ cd..
$ echo "RZ/G2L BSP v1.3-update2" > version.txt   # to remember we install update2

### Copy the 'Mali Graphics library' Zip file (RTK0EF0045Z13001ZJ-v0.8_EN.zip) under our BSP directory.
### Then, we will un-zip it and install it.
$ unzip RTK0EF0045Z13001ZJ-v0.8_EN.zip
$ tar zxvf RTK0EF0045Z13001ZJ-v0.8_EN/meta-rz-features.tar.gz

### Install Codec Library Package
### Copy the file "RTK0EF0045Z15001ZJ-v0.53_EN.zip" under the BSP directory.
$ unzip RTK0EF0045Z15001ZJ-v0.53_EN.zip
$ tar zxvf RTK0EF0045Z15001ZJ-v0.53_EN/meta-rz-features.tar.gz

### Initialize Yocto Environment
$ source poky/oe-init-build-env

### Copy prepared configuration files for this board (choose RZG2L or RZ/G2LC)
RZ/G2L:  $ cp -v ../meta-rzg2/docs/template/conf/smarc-rzg2l/*.conf ./conf/
RZ/G2LC: $ cp -v ../meta-rzg2/docs/template/conf/smarc-rzg2lc/*.conf ./conf/


### Build
$ bitbake core-image-minimal   # (this is optional, no graphics)
$ bitbake core-image-weston
$ bitbake core-image-minimal -c populate_sdk

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 eMMC after 3 seconds.
  • Press the blue reset button and wait.

7-3. Boot the Board using SD Card on SOM Board (eMMC Flash disabled)

  • Set switch SW1-2 = ON
  • Insert the SD card into the socket on SMARC SOM CPU board (not the carrier board).
  • 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.
  • Note that you will get this message every time "*** Warning - MMC init failed, using default environment" because u-boot environment variables are stored in eMMC Flash (that you disabled)
  • At the u-boot prompt ( => ), enter the following commands to boot the board:
  # Manually enter the following commands to boot
=> mmc dev 0 ; fatload mmc 0:1 0x48080000 Image ; fatload mmc 0:1 0x48000000 /r9a07g044l2-smarc.dtb
=> setenv bootargs 'root=/dev/mmcblk0p2 rootwait' ; booti 0x48080000 - 0x48000000


8. Linux Login

  • The login will be "root" (no password is needed)

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 ..


#---------------------------------------------------
# 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 ..


#---------------------------------------------------
# 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 ..


#---------------------------------------------------
# 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 ..


#---------------------------------------------------
# Download build scripts
#---------------------------------------------------
wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/build_scripts_new/build.sh
wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/build_scripts_new/build_common.sh
wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/build_scripts_new/build_flashwriter.sh
wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/build_scripts_new/build_tfa.sh
wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/build_scripts_new/build_uboot.sh
chmod +x *.sh


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

#---------------------------------------------------
# build Flash Writer
#
# - Select toolchain "ARM gcc-arm-10.2-2020.11" that you installed
# - Change "eMMC Flash programming support" from "(default)" to "ENABLE"
# - Select 'Build'
#---------------------------------------------------
./build.sh f

#---------------------------------------------------
# build u-boot
#---------------------------------------------------
# * Select toolchain "ARM gcc-arm-10.2-2020.11" that you installed
./build.sh u

#---------------------------------------------------
# build TF-A
#
# - Select toolchain "ARM gcc-arm-10.2-2020.11" 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"
# - 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
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>"

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