RZ-G/RZ-G2L SMARC: Difference between revisions

From Renesas.info
No edit summary
Line 195: Line 195:
* ELECROW Raspberry Pi Touchscreen Monitor 5 inch HDMI Screen Display 800x480 Compatible
* ELECROW Raspberry Pi Touchscreen Monitor 5 inch HDMI Screen Display 800x480 Compatible
** Amazon link : https://www.amazon.com/Elecrow-Capacitive-interface-Supports-Raspberry/dp/B07FDYXPT7/ref=sr_1_8
** Amazon link : https://www.amazon.com/Elecrow-Capacitive-interface-Supports-Raspberry/dp/B07FDYXPT7/ref=sr_1_8
= Camera =
1. Add patch file for MIPI CSI OV5645 camera for yocto build:
<pre>
$ cd ~user-work/meta-rzg2/recipes-kernel/linux/linux-renesas/patches/main
$ wget https://github.com/seebe/rzg_stuff/blob/master/boards/rzg2l_smarc/camera_patch/0001-add-MIPI-CSI-OV5645-camera.patch
</pre>
2. Edit patches.scc file to add patch file, located in ~user_work/meta-rzg2/recipes-kernel/linux/linux-renesas/patches.scc
3. Build image core-image-weston
4. Configure MIPI CSI module to capture image:
MIPI CSI configuration is done by using media-ctl utility from V41-utils package.
<pre>
# 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]"
</pre>
5. Capture image using gstreamer
This is the simple test script to test your MIPI CSI camera using gstreamer.
<pre>
$ wget https://github.com/seebe/rzg_stuff/blob/master/boards/rzg2l_smarc/camera_patch/test_csi2.sh
$ ./test_csi2.sh 1280x960 # pass resolution 1280x960 or 1920x1080 or 2592x1944
</pre>

Revision as of 23:17, 11 August 2021

<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 and install it
$ cp x/x/x/x/RTK0EF0045Z13001ZJ-v0.51_EN.zip  .
$ 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/minimal/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:
=> 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

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:
=> mmc dev 1 ; fatload mmc 1:1 0x48080000 Image ; fatload mmc 1:1 0x48000000 /r9a07g044l2-smarc.dtb
=> setenv bootargs 'root=/dev/mmcblk1p2 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.

Camera

1. Add patch file for MIPI CSI OV5645 camera for yocto build:

$ cd ~user-work/meta-rzg2/recipes-kernel/linux/linux-renesas/patches/main
$ wget https://github.com/seebe/rzg_stuff/blob/master/boards/rzg2l_smarc/camera_patch/0001-add-MIPI-CSI-OV5645-camera.patch

2. Edit patches.scc file to add patch file, located in ~user_work/meta-rzg2/recipes-kernel/linux/linux-renesas/patches.scc

3. Build image core-image-weston

4. Configure MIPI CSI module to capture image:

MIPI CSI configuration is done by using media-ctl utility from V41-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://github.com/seebe/rzg_stuff/blob/master/boards/rzg2l_smarc/camera_patch/test_csi2.sh
$ ./test_csi2.sh 1280x960 # pass resolution 1280x960 or 1920x1080 or 2592x1944