RZ/G2L SMARC Board by Renesas

From Renesas.info
Jump to navigation Jump to search

← RZ-G

General Information

Board Version Identification

There are currently multiple versions of boards with different components. Please make note of what board you have.
Some boards require different software patches to be applied before building.

RZG2L Discrete vs PMIC.png

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

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.
  • ⚠️ There are currently 3 versions of boards (WS1-Discrete, WS2-Discrete, WS2-PMIC). Please review section Board Version Identification above. In the 'Release Note' of the BSP v1.1, please review section 6-4 and 6-5 in detail before following the instructions in section 3 (or use the simple copy/paste instruction below).
  • ⚠️ If you are building core-image-weston, you need to add Mali Graphics library mentioned in step 1.
  • ⚠️ An "update1" was released after the BSP v1.1 package for WS2 boards only. Update1 must be applied to the v1.1 release.
  • ⚠️ The Simple build instructions below are a summary of what is explained in the BSP Release Note and contain additional information that is not in the Release Notes.
Simple build instructions for BSP v1.1                              

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 package that was downloaded from renesas.com
$ mkdir rzg2l_bsp_v1.1
$ tar -xf rzg2l_bsp_v1.1.tar.gz -C rzg2l_bsp_v1.1
$ cd rzg2l_bsp_v1.1

### Copy the 'Mali Graphics library' Zip file (RTK0EF0045Z13001ZJ-v0.51_EN.zip) under our BSP directory.
### Then, we will un-zip it and install it.
$ unzip RTK0EF0045Z13001ZJ-v0.51_EN.zip
$ cd RTK0EF0045Z13001ZJ-v0.51_EN/proprietary
$ ./copy_gfx_mmp.sh ../../meta-rzg2
$ cd ../..

### (only for WS2-xxx boards) Apply additional patches for BSP v1.1 "update1" that is not included in renesas.com download.
$ cd meta-rzg2
$ wget https://github.com/renesas-rz/meta-rzg2/commit/6edc0e741b37.patch
$ patch -p1 < 6edc0e741b37.patch
$ wget https://github.com/renesas-rz/meta-rzg2/commit/61f6dcb61ac8.patch
$ patch -p1 < 61f6dcb61ac8.patch
$ cd ..

### (only for WS1-Discrete boards) Apply additional patches for WS1 boards
$ cd meta-rzg2
$ patch -p1 < ../extra/0001-linux-renesas-add-workaround-patch-for-gicv3.patch
$ patch -p1 < ../extra/0002-tf-a-add-rd-wr-64-bit-reg-workaround.patch
$ cd ..

### (only for WS2-Discrete boards) Apply additional patches for WS2-Discrete boards
$ cd meta-rzg2
$ patch -p1 < ../extra/0001-BSPv1.1-Modify-the-initialization-routine-for-DDR-of.patch
$ cd ..

### (only for WS2-PMIC boards) Apply additional patches for WS2-PMIC boards
$ cd meta-rzg2
$ wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/boards/rzg2l_smarc/bsp_v1.1_update1_pmic_patch/0001-Support-RZ-G2L-Smarc-PMIC-edition-boards.patch
$ patch -p1 < 0001-Support-RZ-G2L-Smarc-PMIC-edition-boards.patch
$ cd ..

### (Optional, select users) Install Codec Library Package - Alpha Version
### Copy the file "RTK0EF0045Z15001ZJ_0_4_0.tar.bz2" under the BSP directory.
### Copy the file "meta-rzg2_add_codec_support.patch.tar.gz" under the BSP directory.
$ tar -xvf RTK0EF0045Z15001ZJ_0_4_0.tar.bz2
$ tar -xvf meta-rzg2_add_codec_support.patch.tar.gz
$ cd meta-rzg2
$ patch -p1 -i ../meta-rzg2_add_codec_support.patch
$ sh docs/template/copyscript/copy_proprietary_software_omx.sh  ../RTK0EF0045Z15001ZJ_0_4_0
$ cd ..

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

### Copy prepared configuration files for this board
$ cp ../meta-rzg2/docs/template/conf/smarc-rzg2l/*.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
$ 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

# 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 OFF 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:
   # Create command macros and save them:
=> setenv sd_boot_carrier1 'mmc dev 1 ; fatload mmc 1:1 0x48080000 Image ; fatload mmc 1:1 0x48000000 /r9a07g044l2-smarc.dtb'
=> setenv sd_boot_carrier2 'setenv bootargs 'root=/dev/mmcblk1p2 rootwait' ; booti 0x48080000 - 0x48000000'
=> setenv bootcmd 'run sd_boot_carrier1 sd_boot_carrier2'
=> 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.

Enable the Coral MIPI Camera

In the RZ/G2L BSP v1.1 release, the Coral Camera module (OV5645) is supported, but not enabled. Please follow the instructions below to apply a patch that enables the Camera module in the Device Tree.

These instructions assume that you have already built the BSP at least 1 time.

1. Download a patch and apply it to your current kernel source code. Start at the base of your Yocto directory.

$ cd build/tmp/work-shared/smarc-rzg2l/kernel-source
$ wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/boards/rzg2l_smarc/camera_patch/0001-add-MIPI-CSI-OV5645-camera.patch
$ patch -p1 -i 0001-add-MIPI-CSI-OV5645-camera.patch
$ cd ../../../..

⚠️ In Yocto, if you do a 'bitbake linux-renesas clean' command, it will completely erase the kernel code, and you will have to apply this patch again.

2. Since this patch only updated the kernel Device Tree, follow these instructions to rebuild just the Device Tree.

3. Copy your new Device Tree file (build/tmp/deploy/images/smarc-rzg2l/r9a07g044l2-smarc.dtb) to the SD Card and boot.

4. Configure 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]"

5. Capture image 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.1

BSP V1.1 already support to build core-image-qt. Please follow instructions to add Qt in BSP V1.1.
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"

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.