RZ/G2L SMARC Board by Renesas

From Renesas.info
Revision as of 16:23, 17 August 2021 by Padhikari (talk | contribs)

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

General Information

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 2 versions of boards. In the 'Release Note' of the BSP v1.1, therefore please review section 6-4 and 6-5 in detail before following the instructions in section 3.
  • ⚠️ 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. Update1 must be applied to the v1.1 release. Please see instructions below.
Simple build instructions for BSP v1.1  

These instructions are a summary of what is explained in the BSP Release Note.

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

# Apply additional patches for BSP v1.1 "update1" (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 ..

# Apply additional patches for WS1 boards (only 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 ..

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

# Set up Yocto Environment
$ source poky/oe-init-build-env
$ cp ../meta-rzg2/docs/template/conf/smarc-rzg2l/*.conf ./conf/

# Build
$ bitbake core-image-minimal
$ 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

# 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.
  • Note that the SD Card slot on the Carrier board will always work because it uses a separate peripheral channel on the RZ/G2L.
  • On the SOM (CPU) board, there is a little switch (SW1) by the SD card socket.
SOM board uses SD Card socket                 SOM board uses eMMC Flash
SW1-1 = ON                                    SW1-1 = ON
SW1-2 = ON                                    SW1-2 = OFF
      +-----+                                       +-----+
      | ON  |                                       | ON  |
      | = = |                                       | =   |
      |     |                                       |   = |
      | 1 2 |                                       | 1 2 |
      +-----+                                       +-----+

7-1. Boot the Board using eMMC Flash on SOM board

  • Set switch SW1 ON,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-2. Boot the Board using SD Card on SOM board

  • Set switch SW1 ON,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.
  • At the u-boot prompt ( => ), enter the following commands to boot the board:
# Create command macros and save them:
=> setenv sd_boot_som1 'mmc dev 0 ; fatload mmc 0:1 0x48080000 Image ; fatload mmc 0:1 0x48000000 /r9a07g044l2-smarc.dtb'
=> setenv sd_boot_som2 'setenv bootargs 'root=/dev/mmcblk0p2 rootwait' ; booti 0x48080000 - 0x48000000'
=> saveenv

# Execute the saved commands to boot your board:
=> run sd_boot_som1 sd_boot_som2

# Automatically boot using these commands after every reset:
=> setenv bootcmd 'run sd_boot_som1 sd_boot_som2'
=> saveenv

7-3. Boot the Board using SD Card on Carrier board

  • Insert the SD card into the socket on 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.
  • 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'
=> saveenv

# Execute the saved commands to boot your board:
=> run sd_boot_carrier1 sd_boot_carrier2

# Automatically boot using these commands after every reset:
=> setenv bootcmd 'run sd_boot_carrier1 sd_boot_carrier2'
=> saveenv


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.

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

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]"

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]"

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 is the simple test script to test your MIPI CSI camera using gstreamer.

$ wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/boards/rzg2l_smarc/camera_patch/test_csi2.sh
$ chmod +x test_csi2.sh
$ ./test_csi2.sh 1280x960   # pass resolution 1280x960 or 1920x1080 or 2592x1944

Build Qt in BSP V1.1

BSP V1.1 already support to build core-image-qt. It also comes with Qt demoes. If you want to build demos, enable QT_DEMO = "1" in conf/local.conf. Please follow instructions to add Qt in BSP V1.1.

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

Now you can build core-image-qt.