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

From Renesas.info
(added gstreamer commands for capturing .jpg and .mp4)
Β 
(77 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:RZ/G2L, RZ/G2LC, RZ/G2UL SMARC Board by Renesas}}
{{DISPLAYTITLE:RZ/G2L, RZ/G2LC, RZ/G2UL SMARC Board by Renesas}}
<img height="200" style="float:right" src=http://linuxgizmos.com/files/renesas_rzg2l_carrier.jpg>
<html><img height="200" style="float:right" src=http://linuxgizmos.com/files/renesas_rzg2l_carrier.jpg></html>
← [[RZ-G]]
← [[RZ-G]]


<big>πŸ“Œ'''This page is for the RZ/G2L, RZ/G2LC RZ/G2UL evaluation boards.'''</big>
<big>πŸ“Œ'''This page is for the RZ/G2L, RZ/G2LC, and RZ/G2UL evaluation boards.'''</big>


= General Information =
= General Information =
Line 9: Line 9:
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-arm-based-high-end-32-64-bit-mpus/rzg2l-general-purpose-microprocessors-dual-core-arm-cortex-a55-12-ghz-cpus-3d-graphics-and-video-codec Official Renesas RZ/G2L Device Website (link) ]
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-arm-based-high-end-32-64-bit-mpus/rzg2l-general-purpose-microprocessors-dual-core-arm-cortex-a55-12-ghz-cpus-3d-graphics-and-video-codec Official Renesas RZ/G2L Device Website (link) ]
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-arm-based-high-end-32-64-bit-mpus/rtk9744l23s01000be-rzg2l-evaluation-board-kit Official RZ/G2L Evaluation Board Kit Website (link)]
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-arm-based-high-end-32-64-bit-mpus/rtk9744l23s01000be-rzg2l-evaluation-board-kit Official RZ/G2L Evaluation Board Kit Website (link)]
** [https://www.renesas.com/document/gde/rzg2l-rzg2lc-easy-download-guide?language=en Easy Download Guide for RZ/G2L and RZ/G2LC (link)] - A single PDF file that lists all the available downloads on renesas.com.
** RZ/G2L Evaluation Kit Ordering Part Number: RTK9744<font color=red>L23</font>S01000BE
* '''RZ/G2LC'''
* '''RZ/G2LC'''
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-mpus/rzg2lc-general-purpose-microprocessors-dual-core-arm-cortex-a55-12-ghz-cpus-3d-graphics Official Renesas RZ/G2LC Device Website (link) ]
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-mpus/rzg2lc-general-purpose-microprocessors-dual-core-arm-cortex-a55-12-ghz-cpus-3d-graphics Official Renesas RZ/G2LC Device Website (link) ]
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-arm-based-high-end-32-64-bit-mpus/rtk9744c22s01000be-rzg2lc-evaluation-board-kit Official RZ/G2LC Evaluation Board Kit Website]
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-arm-based-high-end-32-64-bit-mpus/rtk9744c22s01000be-rzg2lc-evaluation-board-kit Official RZ/G2LC Evaluation Board Kit Website]
** [https://www.renesas.com/document/gde/rzg2l-rzg2lc-easy-download-guide?language=en Easy Download Guide for RZ/G2L and RZ/G2LC (link)] - A single PDF file that lists all the available downloads on renesas.com.
** RZ/G2LC Evaluation Kit Ordering Part Number: RTK9744<font color=red>C22</font>S01000BE
* '''RZ/G2UL'''
* '''RZ/G2UL'''
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-mpus/rzg2ul-general-purpose-microprocessors-single-core-arm-cortex-a55-10-ghz-cpu-2ch-giga-bit-ethernet Official Renesas RZ/G2UL Device Website (link) ]
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-mpus/rzg2ul-general-purpose-microprocessors-single-core-arm-cortex-a55-10-ghz-cpu-2ch-giga-bit-ethernet Official Renesas RZ/G2UL Device Website (link) ]
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-mpus/rtk9743u11s01000be-rzg2ul-evaluation-board-kit Official RZ/G2UL Evaluation Board Kit Website (link)]
** [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-mpus/rtk9743u11s01000be-rzg2ul-evaluation-board-kit Official RZ/G2UL Evaluation Board Kit Website (link)]
* '''RZ/G2L, RZ/G2LC Contents Guide'''
** [https://www.renesas.com/us/en/document/gde/rzg2ul-easy-download-guide?language=en Easy Download Guide for RZ/G2UL (link)] - A single PDF file that lists all the available downloads on renesas.com.
** This is a single PDF file that has a list of '''all the available documents''' for download on renesas.com
** RZ/G2UL Evaluation Kit Ordering Part Number: RTK9744<font color=red>U11</font>S01000BE
** https://www.renesas.com/document/gde/rzg2l-rzg2lc-contents-guide?language=en
** There are 2 RZ/G2UL derivates:
* '''Linux Board Support Package Download'''
*** Type1:
** '''[https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-arm-based-high-end-32-64-bit-mpus/rzg2l-board-support-package-419-cip Official Renesas RZ/G2L Series BSP Download Page]'''
**** pin compatible with RZ/A3UL and RZ/Five.
** ⚠️ Multiple download packages are required for the full BSP features. Please refer to page '''[https://renesas.info/wiki/RZ-G/RZ-G2_BSP RZ/G2 Linux BSP]''' on this wiki site for guidance on what packages to download.
**** given on the RZ/G2UL EVK.
** ⚠️ BSP v1.3 and earlier will have build issues. [https://renesas.info/wiki/RZ-G/RZ-G2_BSP#Changes_to_Github_Break_BSP_Build Please see here...]
**** part numbers:
** Please read the '''Release Note''' document included in the BSP for the build instructions.
***** R9A07G043U11GBG (without security)
* Additional Help
***** R9A07G043U15GBG (with security)
** A script for '''programming the boot loaders into SPI Flash''' can be found here: https://github.com/renesas-rz/rzg2_bsp_scripts/tree/master/flash_writer_tool
*** Type2:
** Information regarding '''[[RZ-G/RZ-G2L_Flash_Programming | RZ/G2L Programming]]''' of onboard Flash devices with bootloaders and root file systems
**** pin compatible with RZ/G2LC
* Articles
**** A RZ/G2UL Type2 EVK is not available for purchase. For evaluation, it's recommended to use the RZ/G2UL Type1 or the RZ/G2LC EVK.
** [http://linuxgizmos.com/renesas-adds-to-rz-g2-line-with-three-cortex-a55-socs Renesas adds to RZ/G2 line with three Cortex-A55 SoCs]
**** RZ/G2UL VLP releases are prepared for the RZ/G2UL Type1 EVK. RZ/G2UL Type2 specific modifications are mentioned here: [https://renesas.info/wiki/RZ-G/RZ-G2L_SMARC#RZ/G2UL_Type2_VLP RZ/G2UL Type2 VLP (link)]
****part numbers:
*****R9A07G043U12GBG (without security)
*****R9A07G043U16GBG (with security)
*'''Articles'''
**[http://linuxgizmos.com/renesas-adds-to-rz-g2-line-with-three-cortex-a55-socs Renesas adds to RZ/G2 line with three Cortex-A55 SoCs]


= Board Version Identification (RZ/G2L only) =
=Getting Started=
<html><img height="200" style="float:right" src=https://www.renesas.com/sites/default/files/rtk9744l23s01000be-rzg2l-evaluation-board-kit_0.jpg></html>


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. <br>
'''πŸ“„ Board User Manual'''Β 
Some boards require different '''software patches''' to be applied before building.
*The User Manual for the boards can be found their website pages on renesas.com.
*Check the 'General Information' section on this page for the links.
Β 
'''πŸ“¦ What is included in the kit'''
*A Micro USB cable for serial console.
Β 
'''πŸ›’ What you will need to purchase'''
*'''Power:''' (Required) USB Type-C power supply. 5V or 9V can be used. To use 9V, switch SW11-4 change is needed (please see the board manual).
* '''HDMI LCD:''' An LCD monitor with an HMDI input. Here is a list of tested touchscreen monitors: [[RZ-G/RZ-G2L_SMARC#LCD_Monitors]]
* '''mini-HDMI Adapter:''' The connector on the board is type mini-HDMI.
*'''USB Camera:''' A camera supporting USB Video Class (UVC) such as Logitec C270, C920, C922, BRIO Ultra HD Pro.
* '''USB Mouse:''' In the case that you do not have a touchscreen LCD monitor.
Β 
'''⭐ Pre-Built Binaries ⭐'''
* If you prefer to program pre-built binaries into your board, you can download them from renesas.com
* The package includes a complete SD Card image that can be written using Windows or Linux.
* Boot loaders are also included in the package.
* On the [https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-mpus/rzg-linux-platform/rzg-marketplace/verified-linux-package/rzg-verified-linux-package RZ/G Verified Linux Package [5.10-CIP] ] BSP download page, look for "Pre-built Images" downloads for RZ/G2L, RZ/G2LC, RZ/G2UL.
* ⚠️ '''The instructions in the package for v3.0.5 are wrong and incomplete.''' Please use these instead.
For a Windows PC:
Β 
1. Use [https://www.7-zip.org/ 7-Zip] to extract/convert the .wic file ( core-image-qt-smarc-rzg2l<font color=red>.wic.gz</font> β†’ core-image-qt-smarc-rzg2l<font color=red>.wic</font> )
Β 
2. Use [https://etcher.balena.io Balena Etcher] to program the <font color=red>.wic</font> file into and SD Card. The card needs to be '''4GB''' or larger.
Β 
3. Insert the '''SD card''' into the socket on '''Carrier Board'''.
<pre style="background-color:#FFFFFF; border:0px">
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”‚Β  Β  β”‚ SOM β”‚Β  Β  β”‚
β”‚Β  Β  β””β”€β”€β”€β”€β”€β”˜Β  Β  β”‚
β”‚Β  Carrier BoardΒ  β”‚
β”‚Β  Β  β”Œβ”€β”Β  Β  Β  Β  β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Β  Β  Β  ↑
SD Card Socket
</pre>
Β 
4. Power the board and connect a terminal program (like [https://teratermproject.github.io/index-en.html Tera Term]) to the USB-Serial connect. The Baud is 115,200. Stop the autoboot by pressing the space board on your keyboard before the count down stops. Note, even if you don't press the space, you will be OK because the auto-boot will fail and will leave you at the u-boot prompt " => "


[[File:RZG2L_Discrete_vs_PMIC.png|thumb|right]]
5. Copy/paste these commands below (without the " => ") to create and save a new boot command.
<pre>
=> setenv sd_boot1 'mmc dev 1 ; ext4load mmc 1:2 0x48080000 /boot/Image ; ext4load mmc 1:2 0x48000000 /boot/r9a07g044l2-smarc.dtb'


'''RZ/G2L Silicon version WS1 vs WS2:'''
=> setenv sd_boot2 'setenv bootargs 'root=/dev/mmcblk1p2 rootwait' ; booti 0x48080000 - 0x48000000'
* 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:'''
=> setenv bootcmd 'run sd_boot1 sd_boot2'
* 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:'''
=> saveenv


Here are the only release of these boards:
</pre>
* 1st Release: WS1 Silicon + Discrete Power
* 2nd Release: WS2 Silicon + Discrete Power
* 3rd Release: WS2 Silicon + PMIC Power


'''Power Button on PMIC Boards:'''
6. Reset your board with the blue button, and it should now count down and then automatically boot into Linux. The Linux username will be "root", no password is needed.
* On the PMIC boards, please '''press and hold''' theΒ  <span style="color:red">red</span> 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 '''[https://renesas.info/wiki/RZ-G/RZ-G2_BSP this page here]'''. Please refer to the sections that support RZ/G2L.
* The '''Linux-5.10 BSP''' is recommended.
* You will be downloaded multiple packages for the full build. You will need to download the "RZ/G2L Mali Graphic Library" package to '''enable graphics''' and "RZ/G2L Codec Library" package to '''enable video encode/decode'''.


'''2. Build Environment'''
'''πŸ’» Build Environment'''
* To build the BSP, you will need a Linux PC running '''Ubuntu 20.04'''. Only this Host OS version was tested.
<center><div style="padding: 2px; border: 2px solid maroon; margin: 0;">
* You can use a Linux PC (recommended) or a Virtual Machine. If using a Virtual Machine, 200GB of hard drive space is recommended.
<font size=+1>⚠️ The BSP will only build in Ubuntu 20.04</font></div>
</center>
*To build the BSP, you will need a Linux PC running '''Ubuntu 20.04'''. This was the only host OS that was tested and that specific version is a requirement of Yocto 3.1 (dunfell). '''Using Ubuntu <font color=red>22.04</font> will not work'''
*You can use a Linux PC (recommended) or a Virtual Machine. If using a Virtual Machine, 200GB of hard drive space is recommended for the minimum build.
*If you are '''not currently running Ubuntu 20.04''', you can use a '''[https://www.docker.com/ docker container]'''.
** Example: Host Machine = Ubuntu 22.04 + Docker Container running Ubuntu 20.04 inside of it
* Some docker setup instructions and scripts are provided to make it easy to get started.
** https://github.com/renesas-rz/docker_setup


'''3. Build the BSP'''
'''πŸ’Ύ Downloading the Linux 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.
*Download the RZ/G2L Board Support Package from renesas.com. '''Links''' to all the downloads can be found on the '''[https://renesas.info/wiki/RZ-G/RZ-G2_BSP πŸ“¦ RZ/G2 Linux BSP]''' on this site. Please refer to the sections that support RZ/G2L.
* ⚠️ There are currently '''3 versions of RZ/G2L boards''' (WS1-Discrete, WS2-Discrete, WS2-PMIC). Please review section [[RZ-G/RZ-G2L_SMARC#Board_Version_Identification|Board Version Identification]] above. There is only '''1 version of RZ/G2LC board'''. There is only '''1 version of RZ/G2UL board'''. 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.
*The '''Linux-5.10 BSP''' is recommended.
* ⚠️ If you are building core-image-weston or core-image-qt, you need to add '''Mali Graphics library''' mentioned in step 1.
*You will need to downloaded multiple packages for the full build. You will need to download the "RZ/G2L Mali Graphic Library" package to '''enable graphics''' and "RZ/G2L Codec Library" package to '''enable video encode/decode'''.
* 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'''
'''πŸ”¨ Building the BSP'''
* 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 '''([https://github.com/renesas-rz/rzg2_bsp_scripts/tree/master/usb_sd_partition usb_sd_partition])''' that you can run on your Linux PC.
* '''Build Instructions:''' The instructions for building the BSP are located in the '''Release Note''' document that is included in the ZIP file download from renesas.com.
*'''Board Versions:''' There are currently '''3 versions of RZ/G2L boards''' (WS1-Discrete, WS2-Discrete, WS2-PMIC). Please review section [[RZ-G/RZ-G2L_SMARC#Board_Version_Identification|Board Version Identification]] above. There is only 1 version of RZ/G2LC board. There is only 1 version of RZ/G2UL board. 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.
*'''Graphics Libraries:''' If you are building core-image-weston or core-image-qt, you need to add '''Mali Graphics library''' mentioned in step 1. Note that RZ/GUL and RZ/Five do not have a GPU, so you cannot run Weston or Qt.
*'''Enable Qt Demos:''' To build the Qt demos (core-image-qt) you must edit the file build/conf/local.conf and remove the comment marker # to set QT_DEMO = "1" . Please build (bitbake) core-image-weston first, then bitbake core-image-qt. If you buid core-image-qt first, you will get an error. Also, if you get a build error, just keep running the bitbake command again until it completes (there seems to be some issue in the order that packages build).
*'''Hint:''' To make the build '''faster''', you can copy the '''downloads''' directory from an older BSP (rzg2l_bsp_vx.xx.0/build/downloads -> rzg2l_bsp_vx.xx.1/build/downloads) to skip downloading the same open source packages again.


* Insert your micro SD card into a '''USB-SD-Card reader''' and then plug into a Linux PC.
'''⚑ Programing the Board''' 
*The instructions for setting up and programming the board are located in the '''Board Start-up Guide''' that comes in the BSP download package
*A script for automating the programming the boot loaders into Flash can be found here: https://github.com/renesas-rz/rzg2_bsp_scripts/tree/master/flash_writer_tool


* Use the commands below to download the formatting script and run. Please select your card and choose the default settings.
=SD Card Loading and Booting=
* These instructions are for using the output files from the Yocto build to prepare an SD Card and boot into Linux.
* The evaluation boards boot from SPI Flash (boot loaders), then can run Linux from either eMMC on the board or an external SD Card.


==Format the SD Card==
*The SD Card must be formatted by a Linux PC, and contain 2 partitions:
** Partition 1 = FAT16
** Partition 2 = ext4
*A helpful script has been created '''([https://github.com/renesas-rz/rzg2_bsp_scripts/tree/master/usb_sd_partition 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 from github and run. Please select your card and choose the default settings.
<pre>
<pre>
$ wget https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/usb_sd_partition/usb_sd_partition.sh
$ wget https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/usb_sd_partition/usb_sd_partition.sh
Line 83: Line 139:
$ ./usb_sd_partition.sh
$ ./usb_sd_partition.sh
</pre>
</pre>
* 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'''.
<br>
Β 
==Copy files to SD Card==
*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'''.
*Choose the correct command for RZ/G2L or RZ/G2LC or RZ/G2UL
<pre>
<pre>
# Change to the Yocto output directory that contains the files
# 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 Β  # RZ/G2L
$ cd build/tmp/deploy/images/smarc-rzg2l
$ cd build/tmp/deploy/images/smarc-rzg2lc # RZ/G2LC
$ cd build/tmp/deploy/images/smarc-rzg2ulΒ  # RZ/G2UL
Β 
# Copy the Linux kernel to partition 1
$ sudo cp -v Image-smarc-rzg2l.binΒ  /media/$USER/RZ_FATΒ  # RZ/G2L
$ sudo cp -v Image-smarc-rzg2lc.bin /media/$USER/RZ_FATΒ  # RZ/G2LC
$ sudo cp -v Image-smarc-rzg2ul.bin /media/$USER/RZ_FATΒ  # RZ/G2UL


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


# Copy and expand the Root File System to partition 2
# Copy and expand the Root File System to partition 2
Line 100: Line 165:
$ sudo tar -xvf core-image-minimal-smarc-rzg2ul.tar.gzΒ  -C /media/$USER/RZ_extΒ  Β  Β  Β  Β  # RZ/G2UL
$ sudo tar -xvf core-image-minimal-smarc-rzg2ul.tar.gzΒ  -C /media/$USER/RZ_extΒ  Β  Β  Β  Β  # RZ/G2UL
Β Β  Β  (or if using graphics)
Β Β  Β  (or if using graphics)
$ sudo tar -xvf core-image-weston-smarc-rzg2l.tar.gzΒ  -C /media/$USER/RZ_ext Β  Β  Β  Β  # RZ/G2L
$ sudo tar -xvf core-image-weston-smarc-rzg2l.tar.gzΒ  -C /media/$USER/RZ_ext Β  Β  Β  Β  Β  # RZ/G2L
$ sudo tar -xvf core-image-weston-smarc-rzg2lc.tar.gzΒ  -C /media/$USER/RZ_extΒ  Β  Β  Β  Β  # RZ/G2LC
$ sudo tar -xvf core-image-weston-smarc-rzg2lc.tar.gzΒ  -C /media/$USER/RZ_extΒ  Β  Β  Β  Β  # RZ/G2LC
$ sudo tar -xvf core-image-weston-smarc-rzg2ul.tar.gzΒ  -C /media/$USER/RZ_ext Β  Β  Β  Β  # RZ/G2UL
$ sudo tar -xvf core-image-bsp-smarc-rzg2ul.tar.gzΒ  -C /media/$USER/RZ_ext Β  Β  Β  Β  Β  Β  # RZ/G2UL


# Make sure all files are finished writing before removing the USB card reader from the PC
# Make sure all files are finished writing before removing the USB card reader from the PC
Line 108: Line 173:
</pre>
</pre>


* Safely remove your USB card reader by right clicking on the drive icon (either RZ_FAT or RZ_ext) in Ubuntu and selecting "Eject"
*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. Switch settings for the CPU SOM board.'''
==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.
*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.
* ⚠️ 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"
*⚠️ 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.
*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.
*On the SOM (CPU) board, there is a little switch (SW1) near the SD card socket.
* Use the '''Recommended Settings''' below. It is the default of how the board was shipped.
*Use the '''Recommended Settings''' below. It is the default of how the board was shipped.
<pre>
<pre>
[Recommended Settings]Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  [Advanced Users Only]
[Recommended Settings]Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  [Advanced Users Only]
Line 129: Line 194:
</pre>
</pre>


'''6. Power the Board and Connect to the Serial Port '''
==Power the Board and Connect to the Serial Port ==
* On the '''Carrier Board''', set switches '''SW11''' as follows because the boot loaders are stored in QSPI Flash.
*On the '''Carrier Board''', set switches '''SW11''' as follows because the boot loaders are stored in QSPI Flash.
<pre>
<pre>
SW11-1 = OFF
SW11-1 = OFF
Line 142: Line 207:
Β Β  Β  Β  | 1 2 3 4 |
Β Β  Β  Β  | 1 2 3 4 |
Β Β  Β  Β  +---------+
Β Β  Β  Β  +---------+
</pre>
</pre>
* Supply power the board using the '''USB-C connection''' on the carrier board labeled "Power Input"
*'''Supply power''' the board using the '''USB-C connection''' on the carrier board labeled "Power Input". You will only see 2 green LEDs lit.
* 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.
*On the carrier board, '''press and hold the <span style="color:red">red</span> power button for 2 seconds''' to turn ON (or OFF) power to the board. The green LED labeled "Carrier PWR On" will be lit when power is on (making a total of 3 green LEDs lit).
* 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'''.
*Now that the board is powered and the onboard USB-to-Serial chip is also 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.
*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.


'''7-1. Boot the Board using SD Card on Carrier Board (Recommended)'''
==Insert SD Card and Boot==Β 
* Insert the '''SD card''' into the socket on '''Carrier Board'''.
*Insert the '''SD card''' into the socket on '''Carrier Board'''.
<pre style="background-color:#FFFFFF; border:0px">
<pre style="background-color:#FFFFFF; border:0px">
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
Line 160: Line 225:
Β  SD Card Socket
Β  SD Card Socket
</pre>
</pre>
* 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.
*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.
*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.
*⚠️ If you get an failure when saving with "saveenv", remove power to the board and try again.
'''RZ/G2L EVK Booting Commands:'''
'''RZ/G2L EVK Booting Commands:'''
<pre>
<pre>
Β Β  # Create command macros and save them:
Β Β  # 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_boot1 'mmc dev 1 ; fatload mmc 1:1 0x48080000 Image-smarc-rzg2l.bin ; fatload mmc 1:1 0x48000000 /Image-r9a07g044l2-smarc.dtb'
=> setenv sd_boot2 'setenv bootargs 'root=/dev/mmcblk1p2 rootwait' ; booti 0x48080000 - 0x48000000'
=> setenv sd_boot2 'setenv bootargs 'root=/dev/mmcblk1p2 rootwait' ; booti 0x48080000 - 0x48000000'
=> setenv bootcmd 'run sd_boot1 sd_boot2'
=> setenv bootcmd 'run sd_boot1 sd_boot2'
Line 175: Line 240:
<pre>
<pre>
Β Β  # Create command macros and save them:
Β Β  # 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_boot1 'mmc dev 1 ; fatload mmc 1:1 0x48080000 Image-smarc-rzg2lc.bin ; fatload mmc 1:1 0x48000000 /Image-r9a07g044c2-smarc.dtb'
=> setenv sd_boot2 'setenv bootargs 'root=/dev/mmcblk1p2 rootwait' ; booti 0x48080000 - 0x48000000'
=> setenv sd_boot2 'setenv bootargs 'root=/dev/mmcblk1p2 rootwait' ; booti 0x48080000 - 0x48000000'
=> setenv bootcmd 'run sd_boot1 sd_boot2'
=> setenv bootcmd 'run sd_boot1 sd_boot2'
Line 184: Line 249:
<pre>
<pre>
Β Β  # Create command macros and save them:
Β Β  # Create command macros and save them:
=> setenv sd_boot1 'mmc dev 1 ; fatload mmc 1:1 0x48080000 Image ; fatload mmc 1:1 0x48000000 /r9a07g043ull-smarc.dtb'
=> setenv sd_boot1 'mmc dev 1 ; fatload mmc 1:1 0x48080000 Image-smarc-rzg2ul.bin ; fatload mmc 1:1 0x48000000 /Image-r9a07g043u11-smarc.dtb'
=> setenv sd_boot2 'setenv bootargs 'root=/dev/mmcblk1p2 rootwait' ; booti 0x48080000 - 0x48000000'
=> setenv sd_boot2 'setenv bootargs 'root=/dev/mmcblk1p2 rootwait' ; booti 0x48080000 - 0x48000000'
=> setenv bootcmd 'run sd_boot1 sd_boot2'
=> setenv bootcmd 'run sd_boot1 sd_boot2'
Line 191: Line 256:
Reset the board and it will automatically boot
Reset the board and it will automatically boot


'''7-2. Boot the Board using eMMC Flash on SOM Board'''
==Linux Login==
* Set switch SW1-2 = OFF
*The login will be '''root''' (no password is needed)
* The boot loader (u-boot) by default will try to boot from
*You can plug in a '''USB Mouse''' or '''USB Touchscreen'''
Β 
=Board Version Identification=
Β 
'''This section is only for RZ/G2L boards. (not RZ/G2LC or RZ/G2UL)'''


'''8. Linux Login'''
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. <br>
* The login will be '''root''' (no password is needed)
Some boards require different '''software patches''' to be applied before building.
* You can plug in a '''USB Mouse''' or '''USB Touchscreen'''


= Sample and Demo Code =
[[File:RZG2L_Discrete_vs_PMIC.png|thumb|right]]


(coming soon)
'''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


= Board Setup Information =
'''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Β  <span style="color:red">red</span> 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.
Β 
=Sample and Demo Code=
Β 
'''General Sample Code'''
* https://github.com/renesas-rz/rzg2l_smarc_sample_code
** GPIO examples
** Camera examples
Β 
'''Camera Image Overlay Demos'''
* https://github.com/renesas-rz/demo-camera-image-overlay
* Capture camera images to memory, then use Hardware (OpenGL) to overlay images/text and then do h.264 encoding
Β 
'''Camera Data Receive Unit (CRU) Sample Application'''
* https://github.com/renesas-rz/rz_cru_sample_code
* This sample application demonstrates using CRU functions for various image processing tasks like demosaicing raw camera data, color correction, and some simple camera functions.
Β 
''' GStreamer Application Note '''
* [https://www.renesas.com/us/en/document/mas/rzg2l-group-and-rzv2l-group-linux-interface-specification-gstreamer-users-manual-software?utm_nooverride=1&language=en RZ/G2L Group and RZ/V2L Group Linux Interface Specification GStreamer User's Manual]
* This User's Manual (Application Note) explains GStreamer and the custom plug-ins created by Renesas.
* Usage examples are also included.
Β 
=Board Setup Information=
{| class="toccolours" width="100%" style="border-style: none ; text-align: center; background-color:white;"
{| class="toccolours" width="100%" style="border-style: none ; text-align: center; background-color:white;"
|-
|-
| [[File:board_configuration.png|frameless]]<br>'''RZ/G2L Evaluation Board Kit Configuration'''
|[[File:board_configuration.png|frameless]]<br>'''RZ/G2L Evaluation Board Kit Configuration'''
| [[File:smarc_module_board_top.png|frameless|]] <br>'''RZ/G2L SMARC Module Board (TOP)'''
|[[File:smarc_module_board_top.png|frameless|]] <br>'''RZ/G2L SMARC Module Board (TOP)'''
| [[File:smarc_module_board_bottom.png|frameless|]]<br>'''RZ/G2L SMARC Module Board (Bottom)'''
|[[File:smarc_module_board_bottom.png|frameless|]]<br>'''RZ/G2L SMARC Module Board (Bottom)'''
| [[File:smarc_series_carrier_board.png|frameless|]]<br>'''RZ SMARC Series Carrier Board'''
|
[[File:smarc_series_carrier_board.png|frameless|]]<br>'''RZ SMARC Series Carrier Board'''
|-
|-
| &nbsp;
|&nbsp;
|-
|-
| colspan="2" style="text-align:left;" | [[File:power_supply.png|frameless|]]<br>'''Power Supply'''<br>The following power supply environment is used in the evaluation of Renesas:<br>● USB Type-C cable CB-CD23BK (manufactured by Aukey) <br> ● USB PD Charger Anker PowerPort III 65W Pod (manufactured by Anker) Β 
| colspan="2" style="text-align:left;" |[[File:power_supply.png|frameless|]]<br>'''Power Supply'''<br>The following power supply environment is used in the evaluation of Renesas:<br>● USB Type-C cable CB-CD23BK (manufactured by Aukey) <br> ● USB PD Charger Anker PowerPort III 65W Pod (manufactured by Anker)
| colspan="2" style="text-align:left;" |[[File:JTAG_connection_ice_debug.png|frameless|]]<br>'''JTAG Cable Connection for ICE Debugging'''<br>When connecting JTAG debugger,Β  please set the DIP SW1 settings as shown.<br>The JTAG connector is 10pin.
| colspan="2" style="text-align:left;" |[[File:JTAG_connection_ice_debug.png|frameless|]]<br>'''JTAG Cable Connection for ICE Debugging'''<br>When connecting JTAG debugger,Β  please set the DIP SW1 settings as shown.<br>The JTAG connector is 10pin.
|-
|-
|-
|-
| &nbsp;
|&nbsp;
|-
|-
| [[File:boot_mode.png|frameless|]]<br>'''How to set Boot Modes'''
|[[File:boot_mode.png|frameless|]]<br>'''How to set Boot Modes'''
|-
|-
| &nbsp;
|&nbsp;
|-
|-
| colspan="2" style="text-align:left;" | [[File:RZG2UL_SW1_setting.png|frameless|]]<br>'''Smarc RZ/G2UL DIP Switch(SW1) Settings'''
| colspan="2" style="text-align:left;" |[[File:RZG2UL_SW1_setting.png|frameless|]]<br>'''Smarc RZ/G2UL DIP Switch(SW1) Settings'''
| colspan="2" style="text-align:left;" |[[File:RZG2LC_SW1_setting.png|frameless|]]<br>'''Smarc RZ/G2LC DIP Switch(SW1) Settings'''
| colspan="2" style="text-align:left;" |[[File:RZG2LC_SW1_setting.png|frameless|]]<br>'''Smarc RZ/G2LC DIP Switch(SW1) Settings'''
|}
|}


= Board Operation Information =
=Board Operation Information=
{| class="toccolours" width="100%" style="border-style: none ; text-align: center; background-color:white;"
{| class="toccolours" width="100%" style="border-style: none ; text-align: center; background-color:white;"
|-
|-
| style="text-align:left;" | [[File:power_on.png|frameless|]]<br>'''Power ON'''<br>● Connect USB-PD Power Charger to USB Type-C Connector. Then LED1(VBUS PWR On) and LED3(Module PWR On) lights up.<br>● Press SW9 to turn on the power. Then LED4(Carrier PWR On) lights up.
| style="text-align:left;" | [[File:power_on.png|frameless|]]<br>'''Power ON'''<br>● Connect USB-PD Power Charger to USB Type-C Connector. Then LED1(VBUS PWR On) and LED3(Module PWR On) lights up.<br>● Press SW9 to turn on the power. Then LED4(Carrier PWR On) lights up.
| style="text-align:left;" | [[File:debug_serial.png|frameless|]]<br>'''Debug Serial (Console Output)'''<br>● Debug serial uses CN14. The baud rate is 115200bps.<br>● Since the serial-USB conversion IC is not always powered, the Windows PC will recognize it after the power switch is turned on.<br>● If it is not recognized by your Windows PC, please install the driverοΏ½https://www.ftdichip.com/Drivers/VCP.htm
| style="text-align:left;" |[[File:debug_serial.png|frameless|]]<br>'''Debug Serial (Console Output)'''<br>● Debug serial uses CN14. The baud rate is 115200bps.<br>● Since the serial-USB conversion IC is not always powered, the Windows PC will recognize it after the power switch is turned on.<br>● If it is not recognized by your Windows PC, please install the driverοΏ½https://www.ftdichip.com/Drivers/VCP.htm


|}
|}


= LCD Monitors =
=LCD Monitors=
The following HDMI LCD screens were tested with this board.
The following HDMI LCD screens were tested with this board.


{| class="wikitable"
{| class="wikitable"
|+ LCD Monitors
|+LCD Monitors
|-
|-
! Β 
!
! Resolution
!Resolution
! Touchscreen
!Touchscreen
! style="width: 150px" | Description
! style="width: 150px" | Description
! style="width: 60px" | Link
! style="width: 60px" | Link
! Comments
!Comments
|-
|-
| style="background-color: #E0FFE0;" | πŸ™‚ || 1920x1080 || Yes || Wimaxit 14 Inch || [https://www.amazon.com/WIMAXIT-Portable-Monitor-Computer-External/dp/B08JLWNX22 πŸ›’ buy] || This is a very nice screen. Good color and easy to press the icons. The LCD input is mini-HDMI and comes with a mini-HDMI to HDMI cable. The RZ board is micro-HDMI. You will also need to buy a [https://www.amazon.com/UGREEN-Adapter-Supports-Compatible-Raspberry/dp/B08P5SDCVT HDMI to micro-HDMI adapter]. Or, buy a [https://www.amazon.com/BronaGrand-Micro-Connector-Adapter-Cable/dp/B08BC3N93R mini-HDMI to HDMI-micro cable]. Note the the micro-USB connection on the LCD for touchscreen does not work, but the USB-C connector does work for touchscreen. You will simply need a [https://www.amazon.com/Anker-2-Pack-Premium-Charging-Samsung/dp/B07DD5YHMH USB-C to USB-A cable] or [https://www.amazon.com/Female-Adapter-Charger-Airpods-Samsung/dp/B079LYHNSR adapter].
| style="background-color: #E0FFE0;" | πŸ™‚||1920x1080||Yes||Wimaxit 14 Inch||[https://www.amazon.com/WIMAXIT-Portable-Monitor-Computer-External/dp/B08JLWNX22 πŸ›’ buy]||This is a very nice screen. Good color and easy to press the icons. The LCD input is mini-HDMI and comes with a mini-HDMI to HDMI cable. The RZ board is micro-HDMI. You will also need to buy a [https://www.amazon.com/UGREEN-Adapter-Supports-Compatible-Raspberry/dp/B08P5SDCVT HDMI to micro-HDMI adapter]. Or, buy a [https://www.amazon.com/BronaGrand-Micro-Connector-Adapter-Cable/dp/B08BC3N93R mini-HDMI to HDMI-micro cable]. Note the the micro-USB connection on the LCD for touchscreen does not work, but the USB-C connector does work for touchscreen. You will simply need a [https://www.amazon.com/Anker-2-Pack-Premium-Charging-Samsung/dp/B07DD5YHMH USB-C to USB-A cable] or [https://www.amazon.com/Female-Adapter-Charger-Airpods-Samsung/dp/B079LYHNSR adapter].
|-
|-
| style="background-color: #E0FFE0;" | πŸ™‚ || 1920x1080 || Yes || ELECROW 10.1 Inch || [https://www.amazon.com/ELECROW-Raspberry-1920X1080p-Touchscreen-Capacitive/dp/B082HWF2HW πŸ›’ buy] || This is a very nice screen. You will also need to buy a HDMI to micro-HDMI cable.
| style="background-color: #E0FFE0;" | πŸ™‚||1920x1080||Yes||ELECROW 10.1 Inch||[https://www.amazon.com/ELECROW-Raspberry-1920X1080p-Touchscreen-Capacitive/dp/B082HWF2HW πŸ›’ buy]||This is a very nice screen. You will also need to buy a HDMI to micro-HDMI cable.
|-
|-
| style="background-color: #FFFFE0;" | 😐 || 1920x1080 || Yes/No(issues) || EVICIV 10.1 Inch || [https://www.amazon.com/dp/B095R6SXX1 πŸ›’ buy] || ⚠️ The display works, USB touch is detected and shows up as /dev/input/event0, but does not work 100%. You can 'scroll' in a web page by dragging your finger on the screen, but actually touches (mouse clicks) do not work for some reason. There is also a noisy fan inside for an R-pi that you'll need to unplug. You will also need to buy a HDMI to micro-HDMI cable. I would not recommend his one.
| style="background-color: #FFFFE0;" | 😐||1920x1080||Yes/No(issues)||EVICIV 10.1 Inch||[https://www.amazon.com/dp/B095R6SXX1 πŸ›’ buy]||⚠️ The display works, USB touch is detected and shows up as /dev/input/event0, but does not work 100%. You can 'scroll' in a web page by dragging your finger on the screen, but actually touches (mouse clicks) do not work for some reason. There is also a noisy fan inside for an R-pi that you'll need to unplug. You will also need to buy a HDMI to micro-HDMI cable. I would not recommend his one.
|-
|-
| style="background-color: #E0FFE0;" | πŸ™‚ || 1280x800 || Yes || SunFounder 10.1 inch || [https://www.amazon.com/dp/B0776VNW9C πŸ›’ buy] || All the cables that you will need are included.
| style="background-color: #E0FFE0;" |πŸ™‚||1280x800||Yes||SunFounder 10.1 inch||[https://www.amazon.com/dp/B0776VNW9C πŸ›’ buy]||All the cables that you will need are included.
|-
|-
| style="background-color: #E0FFE0;" | πŸ™‚ || 1024x600 || Yes || Ingcool 7 inch<br>7IP-CAPLCD || [https://www.amazon.com/Ingcool-Resolution-Capacitive-Compatible-Raspberry/dp/B08H8HZRLQ πŸ›’ buy] || If you attach the 'Touch' USB connection on the LCD to the RZ/G2L board, it will both power the LCD board as well as enable touch support. This kit comes with HDMI cables.
| style="background-color: #E0FFE0;" | πŸ™‚||1024x600||Yes||Ingcool 7 inch<br>7IP-CAPLCD||[https://www.amazon.com/Ingcool-Resolution-Capacitive-Compatible-Raspberry/dp/B08H8HZRLQ πŸ›’ buy]||If you attach the 'Touch' USB connection on the LCD to the RZ/G2L board, it will both power the LCD board as well as enable touch support. This kit comes with HDMI cables.
|-
|-
| style="background-color: #E0FFE0;" | πŸ™‚ || 800x480 || Yes || GeeekPi 5 Inch<br>EP-0081 || [https://www.amazon.com/gp/product/B0749D617J πŸ›’ buy] || HDMI cable not included.
| style="background-color: #E0FFE0;" |πŸ™‚||800x480||Yes||GeeekPi 5 Inch<br>EP-0081||[https://www.amazon.com/gp/product/B0749D617J πŸ›’ buy]||HDMI cable not included.
|-
|-
| style="background-color: #FFFFE0;" | 😐 || 800x480 || Yes/No(Header) || Kuman 5 Inch<br>β€ŽSC5A-US-KFBA || [https://www.amazon.com/gp/product/B07QB2FGSL πŸ›’ buy] || ⚠️ The Touchscreen comes out on a header and no easy way to hook it up. HDMI cable not included.
| style="background-color: #FFFFE0;" | 😐||800x480||Yes/No(Header)||Kuman 5 Inch<br>β€ŽSC5A-US-KFBA||[https://www.amazon.com/gp/product/B07QB2FGSL πŸ›’ buy]||⚠️ The Touchscreen comes out on a header and no easy way to hook it up. HDMI cable not included.
|-
|-
| style="background-color: #FFE0E0;" | ☹️ ||800x480 || Yes || ELECROW 5 inch || [https://www.amazon.com/Elecrow-Capacitive-interface-Supports-Raspberry/dp/B07FDYXPT7 πŸ›’ buy] || ⚠️ This screen flickers with the RZ/G2L board. The reason is not known.
| style="background-color: #FFE0E0;" | ☹️||800x480||Yes||ELECROW 5 inch||[https://www.amazon.com/Elecrow-Capacitive-interface-Supports-Raspberry/dp/B07FDYXPT7 πŸ›’ buy]||⚠️ This screen flickers with the RZ/G2L board. The reason is not known.
|}
|}


= Using the Coral MIPI Camera =
=Using the Coral MIPI Camera=
As of the RZ/G2L BSP v1.3 release, the Coral Camera module (OV5645) is supported and enabled.
Β 
GStreamer can be used to capture camera images from a Coral MIPI Camera.


'''MIPI CSI Configuration and Resolution Selection'''<br>
Below is a User's Manual (Application Note) explains GStreamer and the custom plug-ins created by Renesas.
Before you can use the camera, you must first configure the MIPI CSI module to capture image.<br>
MIPI CSI configuration is done by using media-ctl utility from v4l-utils package.<br>
The first 2 commands below enable the camera.<br>
Below that are commands you use to select the camera resolution you want to capture.
<pre>
[ 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 ]
Usage examples are also included.
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 ]
* '''RZ/G2L Group and RZ/V2L Group Linux Interface Specification GStreamer User's Manual'''
media-ctl -d /dev/media0 -V "'rzg2l_csi2 10830400.csi2':1 [fmt:UYVY8_2X8/1920x1080 field:none]"
* https://www.renesas.com/us/en/document/mas/rzg2l-group-and-rzv2l-group-linux-interface-specification-gstreamer-users-manual-software?utm_nooverride=1&language=en
media-ctl -d /dev/media0 -V "'ov5645 0-003c':0 [fmt:UYVY8_2X8/1920x1080 field:none]"


[Select resolution 2592x1944 ]
<br>
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>


'''Capture Images using GStreamer'''<br>
Additional information on camera setup can be found on page [[RZ-G/RZG_camera]]
This command can be used capture images and display them on the screen in weston.
<pre>
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! waylandsink
</pre>


To capture images (resolution 1280x960) in .jpg format use
=Building Qt Demos=
<pre>
gst-launch-1.0 v4l2srcΒ  num-buffers=300 device=/dev/video0 ! video/x-raw,format=UYVY,width=1280,height=960 ! videoconvert ! jpegenc ! multifilesink location=image_HD_%05d.jpg
</pre>


To capture videos (resolution 1280x960) in .mp4 format use
Support for building Qt v5.6.3 is included in BSP v3.0.0 and later by build core-image-qt
<pre>
<pre>
gst-launch-1.0 v4l2src num-buffers=3600 device=/dev/video0 ! video/x-raw,format=UYVY,width=1280,height=960,framerate=60/1 ! vspmfilter outbuf-alloc=true ! video/x-raw,format=NV12 ! omxh264enc control-rate=2 target-bitrate=10485760 interval_intraframes=14 periodicty-idr=2 no-copy=true ! video/x-h264,profile=\(string\)high,level=\(string\)4.2 ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! qtmux ! queue ! filesink location=video_HD.mp4
bitbake core-image-qt
</pre>
</pre>


=Build Qt in the BSP=
However, if you would like to build and install the Qt demos in the BSP, you must enable them in our local.conf file.
BSP V1.3 and V1.4 already supports to build core-image-qt.Β  Please follow these instructions to add Qt to the build.<br>
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.
Β 
Start in the base of the Yocto BSP directory.
<pre>
$ git clone https://github.com/meta-qt5/meta-qt5
$ cd meta-qt5
$ git checkout c1b0c9f546289b1592d7a895640de103723a0305
$ cd ..
</pre>


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'''
*Edit file /build/conf/local.conf
*Remove the comment marker # to set QT_DEMO = "1"
*Remove the comment marker # to set QT_DEMO = "1"
<pre>
<pre>
Line 327: Line 402:
</pre>
</pre>


Now you can build core-image-qt.
*Now you can build core-image-qt.
<pre>
<pre>
$ bitbake core-image-qt
$ bitbake core-image-qt
</pre>
</pre>
After the build is complete, copy the new root file system to your SD Card
*After the build is complete, copy/expand the new root file system to your SD Card
<pre>
<pre>
$ cd build/tmp/deploy/images/smarc-rzg2l
$ cd build/tmp/deploy/images/smarc-rzg2l
Line 340: Line 415:
After the board boots, on the Weston desktop you will see icons that will start the demos.
After the board boots, on the Weston desktop you will see icons that will start the demos.


= Add HTML5 Browser to BSP v1.4=
=Enable eMMC Boot=
*The following instructions will add Firefox and the HTML engine Gecko (ver 91) to the RZ/G2L v1.4 BSP.
eMMC Boot refers to the SoC booting directly from eMMC flash after RESET. This means SPI Flash is not used.
*The package "vte" (Virtual Terminal) package changed from GLPv2 to GPLv3 from v0.52 to v0.53. This package is required when build gecko. However, a patch is supplied that will revert this package to an older version in order to avoid GLPv3 license issues.
*Sometimes when building, you will get a pseudo abort exit 134 error in Yocto. We fix that by adding the Debian packages pseudo and attr to the BSP v1.4. Then, it will build correctly every time.
*First, '''download and configure the RZ/G2L BSP v1.4'''. Following the '''Release Note''', do the steps in Section 3, but '''stop at step "(5) Start a build"'''. We need to make some changes '''before''' we run "bitbake core-image-weston".
* Now that you have configured the BSP, you can follow the instructions below to add HTML support.
*For the instructions below, '''start at the base''' of the BSP v1.4 directory. If you are in the '''build''' directory, please do a '''cd ..''' first to get back to the base of the BSP before copy/pasting the instructions below.
*Please note that these changes will '''break a core-image-qt build'''.


{| class="mw-collapsible mw-collapsed wikitable"
Note that eMMC Flash is always used to store the u-boot environment variables, even when boot from SPI Flash is enabled. SPI Flash is never used to store the u-boot environment variables as there is not code to support that. This means that when you switch between SPI Flash booting and eMMC Flash booting, your u-boot environment variables will remain the same.
|Instructions &nbsp;Β  &emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &emsp;
|-
|
'''Add meta layers to build Gecko91'''
<pre>
$ git clone -b gem-firefox-91.0.0esr https://github.com/webdino/meta-browser.git
$ git clone https://github.com/meta-rust/meta-rust.git
$ git -C meta-rust checkout 1b59fd45906082c978d0a0a6e4e51a0ea4aa32c7
$ git -C meta-rust revert 647b976da2a9161ceb01ad477216480fc1c88af8 < /dev/null
$ git clone -b dunfell https://github.com/webdino/meta-clang.git
</pre>


'''Add dummy files in meta-rzg2/classes/ because the gecko recipes want to "inherit"'''
But default, the boot loader (TrustedFirmware-A) contains '''both''' support to boot from both SPI or eMMC Flash. During boot, the code will read a boot register to determine if it should load from SPI Flash or eMMC Flash. This means you can use the same default Yocto output for either SPI Flash boot or eMMC boot.
<pre>
$ cd meta-rzg2/classes
$ touch distutils.bbclass pythonnative.bbclass setuptools.bbclass
$ cd ../..
</pre>


'''Download and apply addition patches for X11 and vte'''
However, you will need to program the eMMC Flash boot partitions and configure the eMMC device with the proper boot configuration to match the RZ/G2L.
<pre>
$ cd meta-rzg2
$ wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/boards/rzg2l_smarc/gecko91_for_bsp_v1.4/0001-recipes-graphics-xorg-xserver-Remove-unsupported-opt.patch
$ wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/boards/rzg2l_smarc/gecko91_for_bsp_v1.4/0001-recipes-gecko-add-vte-version-0.52.2.patch
$ patch -p1 < 0001-recipes-graphics-xorg-xserver-Remove-unsupported-opt.patch
$ patch -p1 < 0001-recipes-gecko-add-vte-version-0.52.2.patch
$ cd ..
</pre>


'''Download and apply addition patches to add debian pseudo and attr'''
The follow commands (copy/paste) and instructions will allow you to program the eMMC device on your board using the Flash Writer that was built in Yocto, and a helpful script (flash_writer_tool) that will automate the programming.
<pre>
$ cd meta-rzg2
$ wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/boards/rzg2l_smarc/gecko91_for_bsp_v1.4/add-debian-pseudo-and-attr.patch
$ patch -p1 < add-debian-pseudo-and-attr.patch
$ cd ..
</pre>
Β 
'''Edit the file build/conf/local.conf'''
<pre>
$ gedit build/conf/local.conf &
</pre>
Β 
*'''Comment out''' the following line in the build/conf/local.conf by placing a "#" at the beginning of the line.
<pre>
#DISTRO_FEATURES_remove = " x11"
</pre>
Β 
*'''Add''' the following lines for Gecko91 at the end of build/conf/local.conf
<pre>
IMAGE_INSTALL_append = " firefox "
IMAGE_INSTALL_append = " ttf-sazanami-gothic ttf-sazanami-mincho "
IMAGE_INSTALL_append = " pulseaudio-server "
IMAGE_INSTALL_append = " adwaita-icon-theme adwaita-icon-theme-cursors "
PACKAGECONFIG_append_pn-firefox = " openmax "
PACKAGECONFIG_append_pn-firefox = " webgl "
PACKAGECONFIG_append_pn-firefox = " gpu "
PREFERRED_VERSION_vte = "0.52.2"
Β 
TARGET_CXXFLAGS_remove_toolchain-clang = " --stdlib=libc++"
TUNE_CCARGS_remove_toolchain-clang = " --rtlib=compiler-rt --unwindlib=libunwind --stdlib=libc++"
TUNE_FEATURES_remove_toolchain-clang = "cortexa57-cortexa53"
Β 
DISTRO_FEATURES_append = " x11"
PACKAGECONFIG_remove = " libedit "
</pre>
Β 
'''Configure bblayers.conf to add the meta-layers we downloaded (git cloned) to the build'''
<pre>
$ source poky/oe-init-build-env
$ bitbake-layers -F add-layer $(pwd)/../meta-rust
$ bitbake-layers -F add-layer $(pwd)/../meta-clang
$ bitbake-layers -F add-layer $(pwd)/../meta-browser
</pre>
Β 
'''Start the build'''
<pre>
$ bitbake core-image-weston
</pre>
Β 
'''How to launch Firefox91'''
* After launching the board, you can launch Firefox91 with the following command.
*We suggest that you use PMIC board with Full HD resolution(1920:1080) to evaluate HTML5.
'''Launch in a window:'''
<pre>
$ WAYLAND_DISPLAY=wayland-0 GDK_BACKEND=wayland MOZ_OMX_RZG2L=1 firefox --width 640 --height 480
</pre>
'''Launch full screen:'''
(kiosk mode, adjust resolution to match your screen),
<pre>
$ WAYLAND_DISPLAY=wayland-0 GDK_BACKEND=wayland MOZ_OMX_RZG2L=1 firefox --width 1024 --height 600 --kiosk https://renesas.info
</pre>
Β 
|}
Β 
=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. Β 


{| class="mw-collapsible mw-collapsed wikitable"
{| class="mw-collapsible mw-collapsed wikitable"
Line 456: Line 431:
|
|
<pre>
<pre>
# 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
# Allow non-root access to tty
sudo usermod -a -G dialout $USER
# Create a new Directory
mkdir rzg2l_emmc_boot
cd rzg2l_emmc_boot
#---------------------------------------------------
# Download Flash Writer
#---------------------------------------------------
git clone https://github.com/renesas-rz/rzg2_flash_writer
cd rzg2_flash_writerΒ ; git checkout rz_g2lΒ ; cd ..Β  Β  Β  # Same branch for RZG2L and RZV2L
#---------------------------------------------------
# Download Trusted Firmware-A
#---------------------------------------------------
git clone https://github.com/renesas-rz/rzg_trusted-firmware-a
cd rzg_trusted-firmware-aΒ ; git checkout v2.5/rzg2lΒ ; cd ..Β  Β  # Same branch for RZG2L and RZV2L
#---------------------------------------------------
# Download mbed
# mbed code is needed to build Trusted Firmware-A with security enabled
#---------------------------------------------------
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 ..Β  Β  # Same branch for RZG2L and 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
wget https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/build_scripts/build.sh
chmod +x *.sh
#---------------------------------------------------
# Configure build system
#
# - Select "smarc-rzg2l" or "smarc-rzv2l"
# - 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 and run 'Flash Writer Tool'
# Download and run 'Flash Writer Tool'
Line 552: Line 441:
./flash_writer_tool.sh
./flash_writer_tool.sh


### For 'Board', select "smarc-rzg2l" or "smarc-rzv2l"
### For 'Board', select the board you are using.


### For 'Target Flash', select "eMMC Flash"
### For 'Target Flash', select "eMMC Flash"


### For 'FILES_DIR', manually set to "../../output_smarc-rzg2l" or "../../output_smarc-rzv2l"
### For 'FILES_DIR', manually set to the location of your Yocto output files (full path)


### Do the follow operations:
### Do the follow operations:


Step 1. Select "Show Switches" to show how to put board into SCIF Download mode
Step 1. Select "Show Switches" to show how to put board into SCIF Download mode, then press the RESET button on the board.
Step 2. Select "Download F.W."
Step 2. Select "Download F.W."
Step 3. Select "eMMC boot setup"
Step 3. Select "eMMC boot setup"
Line 570: Line 459:
|}
|}


=Program On-Board eMMC Flash =
=Program On-Board eMMC Flash=


*To program the eMMC Flash device on the SOM board, you can follow the instructions below.
*To program the eMMC Flash device on the SOM board, you can follow the instructions below.
Line 636: Line 525:
</pre>
</pre>


=Fix qmake missing in BSP v1.1 and BSP v1.3=
=SD card boot=
To created an SDK package that can build Qt applications, you use this command:
'''''<big>Note: SD card boot is supported out of the box since VLP3.0.2 (and corresponding Arm Trusted Firmware version), the files to be programmed are available in the Yocto image folder. You can jump to [[RZ-G/RZ-G2L SMARC#SD Card Preparation|this section]] if you already have the files.</big>'''''
Β 
RZ/G2L-LC-UL and RZ/V2L can also boot from a (micro) SD card, this is boot mode 0 called "Booting from eSD" in the User Manual.
Β 
This procedure is similar to what reported above for [[RZ-G/RZ-G2L SMARC#Enable eMMC Boot|eMMC boot]], we are not using Yocto to build (not supported in VLP3.0.0).
Β 
Assuming that the host PC is already configured to cross-build:
mkdir sd_boot
cd sd_boot
Now let's clone and patch RZ/G Trusted Firmware:
git clone <nowiki>https://github.com/renesas-rz/rzg_trusted-firmware-a</nowiki>
cd rzg_trusted-firmware-a
git checkout v2.6/rz
wget <nowiki>https://raw.githubusercontent.com/seebe/rzg_stuff/master/tfa_patches/0001-SD-boot-support.patch</nowiki>
patch -p1 < 0001-SD-boot-support.patch
cd ..
Clone u-boot:
git clone <nowiki>https://github.com/renesas-rz/renesas-u-boot-cip</nowiki>
cd renesas-u-boot-cip/
git checkout v2021.10/rz
cd ..
Retrieve some useful scripts to ease the TF-A and u-boot builds, as well as the generation of the binary files we need:
wget <nowiki>https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/build_scripts/build_common.sh</nowiki>
wget <nowiki>https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/build_scripts/build_tfa.sh</nowiki>
wget <nowiki>https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/build_scripts/build_uboot.sh</nowiki>
wget <nowiki>https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/build_scripts/build.sh</nowiki>
wget <nowiki>https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/usb_sd_partition/usb_sd_partition.sh</nowiki>
chmod +x *.sh
Select toolchain that you have:
./build.sh s
Let's build u-boot:
./build.sh u
Then TF-A, normally you can leave the default parameters (smarc rz/g2l is the default board) and boot device does not matter:
./build.sh t
Β 
==SD Card Preparation==
Now we have to prepare the (micro) SD card. We can optionally zero it out ('''<u>WARNING: THE SD CARD CONTENT WILL BE DESTROYED</u>'''):
sudo dd if=/dev/zero of=/dev/sda bs=1M status=progress
Then, assuming you want to use the same SD card to store kernel and device tree, we can (optionally) partition it:
./usb_sd_partition.sh
We are ready to write the boot files to some specific sectors of the SD card (MBR and partitions won't be touched):
cd output_smarc-rzg2l/
sudo dd if=bootparams-smarc-rzg2l.bin of=/dev/sda seek=1 count=1
sudo dd if=bl2-smarc-rzg2l.bin of=/dev/sda seek=8
sudo dd if=fip-smarc-rzg2l.bin of=/dev/sda seek=128
sync
[[File:SD card.png|frameless|1160x1160px]]
Β 
''(*) Note: the size of the files and SD card reported in this picture are just examples. Actual output files size may be different and there is no limitation on the SD card capacity.''
Β 
==Board Preparation==
If you are using the SMARC board you can insert the micro SD card in the SOM module slot:
Β 
[[File:smarc micro sd.png|frameless|328x328px]]
Β 
Change the switches to eSD boot on the carrier board acting on SW11 (SW11-1 ON, SW11-2 ON, SW11-3 OFF, SW11-4 ON):
Β 
[[File:SW11 - sd boot.png|frameless]]
Β 
Change SW1 on the module to select micro sd card slot (SW1-1 ON, SW1-2 ON):
Β 
[[File:SW1 - sd boot.png|frameless]]
Β 
and finally the board is ready to boot from the micro SD card:
NOTICE:Β  BL2: v2.6(release):7e8696ff4-dirty
NOTICE:Β  BL2: Built : 12:07:55, SepΒ  8 2022
NOTICE:Β  BL2: SD boot from partition 0
NOTICE:Β  BL2: Load dst=0x1f7c0 src=(p:0)0x10000(128) len=0x10(1)
NOTICE:Β  BL2: SD boot from partition 0
NOTICE:Β  BL2: Load dst=0x1f920 src=(p:0)0x10010(128) len=0x28(1)
NOTICE:Β  BL2: SD boot from partition 0
NOTICE:Β  BL2: Load dst=0x44000000 src=(p:0)0x10090(128) len=0x6069(49)
NOTICE:Β  BL2: SD boot from partition 0
NOTICE:Β  BL2: Load dst=0x1f7c0 src=(p:0)0x10000(128) len=0x10(1)
NOTICE:Β  BL2: SD boot from partition 0
NOTICE:Β  BL2: Load dst=0x1f920 src=(p:0)0x10010(128) len=0x28(1)
NOTICE:Β  BL2: Load dst=0x1f920 src=(p:0)0x10038(128) len=0x28(1)
NOTICE:Β  BL2: SD boot from partition 0
NOTICE:Β  BL2: Load dst=0x50000000 src=(p:0)0x16100(176) len=0xa9878(1357)
NOTICE:Β  BL2: Booting BL31
NOTICE:Β  BL31: v2.6(release):7e8696ff4-dirty
NOTICE:Β  BL31: Built : 12:07:55, SepΒ  8 2022
U-Boot 2021.10-g90edad6e00 (Sep 08 2022 - 11:55:48 +0200)
CPU:Β  Renesas Electronics K rev 6.15
Model: smarc-rzg2l
DRAM:Β  1.9 GiB
MMC:Β  sd@11c00000: 0, sd@11c10000: 1
Loading Environment from MMC... MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment
In:Β  Β  serial@1004b800
Out:Β  serial@1004b800
Err:Β  serial@1004b800
Net:
Error: ethernet@11c20000 address not set.
No ethernet found.
Please note that u-boot by default is configured to store the environment variables on the eMMC boot partition 2. On the Smarc EVKs the SD card slot is shared with eMMC, so environment variables cannot be loaded / saved.
Β 
==Use SD card for u-boot environment variables==
Please note that u-boot by default is configured to store the environment variables on the eMMC boot partition 2.
It is possible to configure u-boot to use the SD card also as env variable storage device. We can take advantage of the spare space between the end of FIP and first partition:
Β 
[[File:sd boot env variables.png|frameless|400x400px]]
Β 
Β 
To do that it is sufficient to modify the u-boot configuration:
./build.sh u menuconfig
Navigate to "Environment --->" and change:
Β 
'''mmc partition number -> 0''': there is only one physical partition on a sd card, so select it.
Β 
'''Environment size -> 0x10000''': use 64K space for u-boot environment variables, i.e 128 sectors (512 bytes)
Β 
'''Environment offset -> 0xF0000''': this is the offset starting from the base. We want to start from 2048 (first logical partition) - 128 (size) = 1920. 1920 * 512 = 983.040 = 0xF0000
Β 
[[File:sd boot env variables menuconfig.png|frameless|800x800px]]
Β 
Exit and save.
Β 
==Change Bus Width==
Β 
You also need to configure bus width to 4, instead of 8. This can be done by modifying the device tree (arch/arm/dts/smarc-rzg2l.dts):
&sdhi0 {
Β  Β  Β  Β  /* pinctrl placeholder
Β  Β  Β  Β  Β * If this channel is used for interfacing with a SD card, a power enable
Β  Β  Β  Β  Β * pin (SD0_PWR_EN) must be defined.
Β  Β  Β  Β  Β * The SD0_PWR_EN pin is associated with P4_1.
Β  Β  Β  Β  Β * A HIGH signal on SD0_PWR_EN will enable supply voltage for SD card.
Β  Β  Β  Β  */
Β  Β  Β  Β  bus-width = <4>;
Β  Β  Β  Β  status = "okay";
};
Exit and save, then rebuild both u-boot and TF-A and reprogram bl2 and fip binaries as documented in the previous section.
Β 
You can also program your own environment variables, creating a binary as described in [[RZ-G/RZ-G2L Flash Programming#Generating u-boot variables binary|this section]] and then program it:
sudo dd if=u-boot-env.bin of=/dev/sda seek=1920
Β 
=RZG2L Cortex-M33 Multi-OS Package=
Instructions for RZV Cortex-M33 Multi-OS Package is located below.
Β 
'''[[Cortex-M33 Multi-OS Package Support]]'''
=US108 2D Barcode Scanner Carrier Board=
*2D Barcode Scanner Demo
*'''[[RZ-G/US108 | Please Click Here...]]'''
Β 
=Importing Orcad design files into Altium=
SMARC board schematics and layout are provided in Orcad format only, .dns and .brd respectively. These files can be imported into Altium designer using [https://www.altium.com/documentation/altium-designer/orcad-import this guide] and/or [https://www.altium.com/documentation/knowledge-base/altium-designer/how-to-import-allegro-binary-file-brd-to-altium this guide].
Β 
Β 
=RZ/G2UL Type2 VLP=
A RZ/G2UL Type2 EVK is not available for purchase.
For evaluation, it's recommended to use the RZ/G2UL Type1 or the RZ/G2LC EVK.
Β 
RZ/G2UL VLP releases are prepared for the RZ/G2UL Type1 EVK.
Β 
In case the RZ/G2LC EVK is equipped with RZ/G2UL Type2, the following VLP v3.0.1 patch is suitable to build the device tree.
[[File:0001-Added-VLP-v3.0.1-based-RZ-G2UL-Type2-Smarc-board-sup.patch]]
Β 
= DirectFB for RZ/G2UL =
<html><img width=150px align=right src="https://avatars.githubusercontent.com/u/80045286?v=4"></html>
'''What is DirectFB?'''
Β 
* Since the RZ/G2UL does not have a GPU, the Weston desktop cannot be used. Instead, graphical applications are required to use the traditional legacy Frame Buffer (/dev/fb0) Linux interface.
* There is an old graphic framework call '''DirectFB''' that used to be very popular for the /dev/fb0 interface. You can read it about it here: https://elinux.org/DirectFB
* The project is no longer active, however you can still enable and build the code in Yocto and it is still quite useful for validating LCDs
Β 
<br>
Β 
'''What is DirectFB2?'''
Β 
* Someone has decided to keep the project going as "DirectFB2" ([https://www.cnx-software.com/2022/01/26/directfb2-project-brings-back-directfb-graphics-library-for-linux-embedded-systems/ Article])
* On github, you can find the code (https://github.com/directfb2) and documentations (https://github.com/directfb2/directfb2.github.io)
Β 
<br>
Β 
'''Instructions for adding the original DirectFB to Yocto:'''
* DirectFB recipes are included in the standard '''meta-openembedded''' layer (meta-openembedded/meta-oe/recipes-graphics/directfb/)
* The source files are downloaded from the Yocto Mirror server since the DirectFB website and repo have been gone for years.
* The Yocto recipes will also apply various patches to fix bugs that were in the final v1.7.7 release of DirectFB.
Β 
Β 
1. Edit your local.conf file and add these lines:
<pre>
DISTRO_FEATURES_append = " directfb"
IMAGE_INSTALL_append = " directfb directfb-examples "
</pre>
Β 
2. Build (bitbake) a '''core-image-minimal''' or '''core-image-bsp'''. Then program your board with that new image.
Β 
3. After booting your board, log in as root and create a file '''/home/root/<font color=blue>.directfbrc</font>''' . Add the below contents to the .directfbrc file. Of course, change the resolution of the mode to match your LCD.
<pre>
system=fbdev
module-dir=/usr/lib64/directfb-1.7-7/
fbdev=/dev/fb0
mode=1280x720
depth=32
</pre>
4. Log out, then log back in.
Β 
5. Now you can run the directfb examples you build. For example: Β 
<pre>
<pre>
bitbake core-image-qt -c populate_sdk
$ df_andi
</pre>
</pre>
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.
Generally, most of the examples start with "df_" . Here are some that are interesting.
Β 
* df_dok
** A benchmark demo that uses all the DirectFB APIs. People used to use this to compare CPU performance.
* df_andi
** Penguin walking demo
* df_knuckles
A 3D skull with rotate light. If you have a mouse, you can rotate the skull.
* df_neo
** Fly icons that change color and size
* df_input
** Used for checking the touchscreen or mouse inputs
* df_windows
** You can move windows around with touch screen or mouse
<br>


This can be fixed by editing the file:
= Enable 2 Ethernet ports on EVK =
*rzg2l_bsp_v1.3/meta-rzg2/dynamic-layers/qt5-layer/images/core-image-qt.bb
* There are 2 Ethernet on EVK board. Add-on networking functions may require users to use both ethernet cables. For doing so, please
and adding the following lines to the file:
Β 
1. Enable the ETHER0 port in the device tree. For example, enable Eth0 on RZ/Five:
<pre>
<pre>
inherit populate_sdk_qt5
# <kernel dir>/arch/riscv/boot/dts/renesas/r9a07g043f01-smarc.dts
TOOLCHAIN_HOST_TASK_append = " nativesdk-qtwayland-tools "
10
FEATURE_PACKAGES_tools-sdk += " packagegroup-qt5-toolchain-target kernel-devsrc " Β 
11 /*
12Β  * DIP-Switch SW1 setting
13Β  * 1 : High; 0: Low
14Β  * SW1-2 : SW_SD0_DEV_SELΒ  (1: eMMC; 0: uSD)
15Β  * SW1-3 : SW_ET0_EN_NΒ  Β  Β  (0: ETHER0; 1: CAN0,CAN1,SSI1,RSPI1)
16Β  * Please change below MACROs corespondingly to SW1 setting
17Β  */
18
19 #define SW_SW0_DEV_SELΒ  1
20 #define SW_ET0_EN_N 0
21 //#defineΒ  SW_ET0_EN_N 1
22
23 #include "rzfive-smarc.dtsi"
24
25 / {
</pre>
</pre>
This will be fixed for BSP v1.4


=Fix Exit Code 134 Error in BSP v1.4=
2. For RZ/Five and RZ/G2UL, please turn switch SW1_3 OFF on the smarc module:
*Sometimes when building, you will get a pseudo abort exit 134 error in Yocto.
Β 
*The build will fail with the error message below.
[[File:smarc_sw1_3_off.png|SW1_3 OFF]]
Β 
= Playing and Recording Audio =
* The RZ/G2L SMARC has a WM8978 audio codec. By default, some ASLA settings are not configured so playing and recording is not available.
* For example, if you play audio, you will not hear anything because the volume is set to 0%.
* Before you can play or record audio, please enter the commands below.
<pre>
<pre>
ERROR: Task (virtual:multilib:lib32:/home/renesas/rzg2l_bsp_v1.4/build/../meta-rzg2/recipes-debian/glibc/glibc_debian.bb:do_package) failed with exit code '134'
$ amixer cset name='Left Input Mixer L2 Switch' on
ERROR: glibc-2.28-r0 do_package: Error executing a python function in exec_func_python() autogenerated:
$ amixer cset name='Right Input Mixer R2 Switch' on
$ amixer cset name='Headphone Playback Volume' 100
$ amixer cset name='PCM Volume' 100%
$ amixer cset name='Input PGA Volume' 25
</pre>
</pre>
*We fix that by adding the Debian packages pseudo and attr to the BSP v1.4. Then, it will build correctly.
* Then, you can record audio by using the command below
*Please follow the instructions below download and apply addition patches to add debian pseudo and attr by entering the commands in a terminal at the base of your BSP v1.4.
<pre>
<pre>
$ cd meta-rzg2
$ arecord -M -twav -fS16_LE -r8000 /tmp/sample.wav
$ wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/boards/rzg2l_smarc/gecko91_for_bsp_v1.4/add-debian-pseudo-and-attr.patch
$ patch -p1 < add-debian-pseudo-and-attr.patch
$ cd ..
</pre>
</pre>
*Simply restart your build and it should be OK.


=RZG2L Cortex-M33 Multi-OS Package=
= Note about playing 48KHz and 44.1KHz audio files =
The RZG2L includes a ARM CM33 MCU. This section describes how to build applications and communication between the CV55 and the CM33.
The RZ/G2L SMARC EVK is designed to handle both 48KHz and 44.1KHz audio files seamlessly. These two sampling frequencies require 12.288MHz and 11.2896MHz master clock respectively (256x the sample rate). On the SMARC EVK we have a versaclock3 that provides the different clocks. When it comes to audio this is the configuration:[[File:Smarc audio clock.png|frameless|707x707px]]
Β 
The versaclock3 clock generator generates audio_clk1 (SE1 output), audio_clk2 (Diff2 output), required by the RZ/G2L SSI (I2S peripheral), and audio_mclk (SE2) that is fed into the WM8978 codec as master clock. However the versaclock3 can be reconfigured to switch the audio_mclk dynamically between 11.2896MHz and 12.288MHz. This is done seamlessly because audio_mclk [https://github.com/renesas-rz/rz_linux-cip/blob/4f3d2d21ad698667c9ea6331923612effab4e1c9/arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi#L37 is not a fixed clock], the ALSA framework "sends" the reconfiguration request to both the SSI driver and the versaclock3 driver. The first driver switches reference clock input from audio_clk1 and audio_clk2 and viceversa, the latter driver sets the best clock parent for audio_mclk, that is in fact done by switching from DIV4 to DIV5 via I2C.


'''[https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-arm-based-high-end-32-64-bit-mpus/rzg2l-multi-os-package Official RZG2L Cortex-M33 Multi-OS Package]'''
[[File:image timing commander.png|frameless|640x640px]]
*Please review the downloads and documents [[RZ-V2L_SMARC#CM33_e2studio_GDB_Debug|here]]
'''The Cortex-M33 supports the the Reness FSP ( Flexible Software Package )'''.
*Documentation for the FSP can be found on the Official RZG2L Cortex-M33 Multi-OS Package
*Release Note for RZG2L Flexible Software Package PDF
*RZG2L FSP Documentation V1.00 PDF
'''Renesas e2studio IDE supports application development and debugging for the Cortex-CM33'''
*Please review the RZG2L Getting Started Guide. This document includes information about setting up the IDE for RZG2L/CM33 Development, loading, and running Cortex-CM33 Applications
'''Information on how to Debug on the CM33 is''' [[RZ-V/RZ-V2L SMARC#CM33_e2studio_GDB_Debug|here]]


=US108 2D Barcode Scanner Carrier Board=
This is the screenshot of the versaclock3 Timing Commander utility, that shows the default configuration stored in the OTP.
*2D Barcode Scanner Demo
*'''[[RZ-G/US108 | Please Click Here...]]'''

Latest revision as of 13:16, 5 February 2024

← RZ-G

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

General Information

Getting Started

πŸ“„ Board User Manual

  • The User Manual for the boards can be found their website pages on renesas.com.
  • Check the 'General Information' section on this page for the links.

πŸ“¦ What is included in the kit

  • A Micro USB cable for serial console.

πŸ›’ What you will need to purchase

  • Power: (Required) USB Type-C power supply. 5V or 9V can be used. To use 9V, switch SW11-4 change is needed (please see the board manual).
  • HDMI LCD: An LCD monitor with an HMDI input. Here is a list of tested touchscreen monitors: RZ-G/RZ-G2L_SMARC#LCD_Monitors
  • mini-HDMI Adapter: The connector on the board is type mini-HDMI.
  • USB Camera: A camera supporting USB Video Class (UVC) such as Logitec C270, C920, C922, BRIO Ultra HD Pro.
  • USB Mouse: In the case that you do not have a touchscreen LCD monitor.

⭐ Pre-Built Binaries ⭐

  • If you prefer to program pre-built binaries into your board, you can download them from renesas.com
  • The package includes a complete SD Card image that can be written using Windows or Linux.
  • Boot loaders are also included in the package.
  • On the RZ/G Verified Linux Package [5.10-CIP ] BSP download page, look for "Pre-built Images" downloads for RZ/G2L, RZ/G2LC, RZ/G2UL.
  • ⚠️ The instructions in the package for v3.0.5 are wrong and incomplete. Please use these instead.

For a Windows PC:

1. Use 7-Zip to extract/convert the .wic file ( core-image-qt-smarc-rzg2l.wic.gz β†’ core-image-qt-smarc-rzg2l.wic )

2. Use Balena Etcher to program the .wic file into and SD Card. The card needs to be 4GB or larger.

3. Insert the SD card into the socket on Carrier Board.

β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”‚     β”‚ SOM β”‚     β”‚
β”‚     β””β”€β”€β”€β”€β”€β”˜     β”‚
β”‚  Carrier Board  β”‚
β”‚     β”Œβ”€β”         β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       ↑
 SD Card Socket

4. Power the board and connect a terminal program (like Tera Term) to the USB-Serial connect. The Baud is 115,200. Stop the autoboot by pressing the space board on your keyboard before the count down stops. Note, even if you don't press the space, you will be OK because the auto-boot will fail and will leave you at the u-boot prompt " => "

5. Copy/paste these commands below (without the " => ") to create and save a new boot command.

=> setenv sd_boot1 'mmc dev 1 ; ext4load mmc 1:2 0x48080000 /boot/Image ; ext4load mmc 1:2 0x48000000 /boot/r9a07g044l2-smarc.dtb'

=> setenv sd_boot2 'setenv bootargs 'root=/dev/mmcblk1p2 rootwait' ; booti 0x48080000 - 0x48000000'

=> setenv bootcmd 'run sd_boot1 sd_boot2'

=> saveenv

6. Reset your board with the blue button, and it should now count down and then automatically boot into Linux. The Linux username will be "root", no password is needed.


πŸ’» Build Environment

⚠️ The BSP will only build in Ubuntu 20.04
  • To build the BSP, you will need a Linux PC running Ubuntu 20.04. This was the only host OS that was tested and that specific version is a requirement of Yocto 3.1 (dunfell). Using Ubuntu 22.04 will not work
  • You can use a Linux PC (recommended) or a Virtual Machine. If using a Virtual Machine, 200GB of hard drive space is recommended for the minimum build.
  • If you are not currently running Ubuntu 20.04, you can use a docker container.
    • Example: Host Machine = Ubuntu 22.04 + Docker Container running Ubuntu 20.04 inside of it
  • Some docker setup instructions and scripts are provided to make it easy to get started.

πŸ’Ύ Downloading the Linux BSP

  • Download the RZ/G2L Board Support Package from renesas.com. Links to all the downloads can be found on the πŸ“¦ RZ/G2 Linux BSP on this site. Please refer to the sections that support RZ/G2L.
  • The Linux-5.10 BSP is recommended.
  • You will need to downloaded multiple packages for the full build. You will need to download the "RZ/G2L Mali Graphic Library" package to enable graphics and "RZ/G2L Codec Library" package to enable video encode/decode.

πŸ”¨ Building the BSP

  • Build Instructions: The instructions for building the BSP are located in the Release Note document that is included in the ZIP file download from renesas.com.
  • Board Versions: 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 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.
  • Graphics Libraries: If you are building core-image-weston or core-image-qt, you need to add Mali Graphics library mentioned in step 1. Note that RZ/GUL and RZ/Five do not have a GPU, so you cannot run Weston or Qt.
  • Enable Qt Demos: To build the Qt demos (core-image-qt) you must edit the file build/conf/local.conf and remove the comment marker # to set QT_DEMO = "1" . Please build (bitbake) core-image-weston first, then bitbake core-image-qt. If you buid core-image-qt first, you will get an error. Also, if you get a build error, just keep running the bitbake command again until it completes (there seems to be some issue in the order that packages build).
  • Hint: To make the build faster, you can copy the downloads directory from an older BSP (rzg2l_bsp_vx.xx.0/build/downloads -> rzg2l_bsp_vx.xx.1/build/downloads) to skip downloading the same open source packages again.

⚑ Programing the Board

SD Card Loading and Booting

  • These instructions are for using the output files from the Yocto build to prepare an SD Card and boot into Linux.
  • The evaluation boards boot from SPI Flash (boot loaders), then can run Linux from either eMMC on the board or an external SD Card.

Format the SD Card

  • The SD Card must be formatted by a Linux PC, and contain 2 partitions:
    • Partition 1 = FAT16
    • Partition 2 = ext4
  • 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 from github 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


Copy files to SD Card

  • 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.
  • Choose the correct command for RZ/G2L or RZ/G2LC or RZ/G2UL
# Change to the Yocto output directory that contains the files
$ cd build/tmp/deploy/images/smarc-rzg2l   # RZ/G2L
$ cd build/tmp/deploy/images/smarc-rzg2lc  # RZ/G2LC
$ cd build/tmp/deploy/images/smarc-rzg2ul  # RZ/G2UL

# Copy the Linux kernel to partition 1
$ sudo cp -v Image-smarc-rzg2l.bin  /media/$USER/RZ_FAT  # RZ/G2L
$ sudo cp -v Image-smarc-rzg2lc.bin /media/$USER/RZ_FAT  # RZ/G2LC
$ sudo cp -v Image-smarc-rzg2ul.bin /media/$USER/RZ_FAT  # RZ/G2UL

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

# 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          # RZ/G2L
$ sudo tar -xvf core-image-minimal-smarc-rzg2lc.tar.gz  -C /media/$USER/RZ_ext          # RZ/G2LC
$ sudo tar -xvf core-image-minimal-smarc-rzg2ul.tar.gz  -C /media/$USER/RZ_ext          # RZ/G2UL
    (or if using graphics)
$ sudo tar -xvf core-image-weston-smarc-rzg2l.tar.gz   -C /media/$USER/RZ_ext           # RZ/G2L
$ sudo tar -xvf core-image-weston-smarc-rzg2lc.tar.gz   -C /media/$USER/RZ_ext          # RZ/G2LC
$ sudo tar -xvf core-image-bsp-smarc-rzg2ul.tar.gz   -C /media/$USER/RZ_ext             # RZ/G2UL

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

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.
  • ⚠️ 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.
  • Use the Recommended Settings below. It is the default of how the board was shipped.
[Recommended Settings]                        [Advanced Users Only]
 SOM board uses eMMC                           Flash SOM board uses SD Card socket
 SW1-1 = ON/OFF(JTAG)                          SW1-1 = ON/OFF(JTAG)
 SW1-2 = OFF                                   SW1-2 = ON
      +-----+                                       +-----+
      | ON  |                                       | ON  |
      | =   |                                       | = = |
      |   = |                                       |     |
      | 1 2 |                                       | 1 2 |
      +-----+                                       +-----+

Power the Board and Connect to the Serial Port

  • On the Carrier Board, set switches SW11 as follows because the boot loaders are stored in QSPI Flash.
SW11-1 = OFF
SW11-2 = OFF
SW11-3 = OFF
SW11-4 = ON
      +---------+
      | ON      |
      |       = |
      | = = =   |
      | 1 2 3 4 |
      +---------+
  • Supply power the board using the USB-C connection on the carrier board labeled "Power Input". You will only see 2 green LEDs lit.
  • On the carrier board, press and hold the red power button for 2 seconds to turn ON (or OFF) power to the board. The green LED labeled "Carrier PWR On" will be lit when power is on (making a total of 3 green LEDs lit).
  • Now that the board is powered and the onboard USB-to-Serial chip is also 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.

Insert SD Card and Boot

  • 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 Booting Commands:

   # Create command macros and save them:
=> setenv sd_boot1 'mmc dev 1 ; fatload mmc 1:1 0x48080000 Image-smarc-rzg2l.bin ; fatload mmc 1:1 0x48000000 /Image-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 Booting Commands:

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

RZ/G2UL EVK Booting Commands:

   # Create command macros and save them:
=> setenv sd_boot1 'mmc dev 1 ; fatload mmc 1:1 0x48080000 Image-smarc-rzg2ul.bin ; fatload mmc 1:1 0x48000000 /Image-r9a07g043u11-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

Linux Login

  • The login will be root (no password is needed)
  • You can plug in a USB Mouse or USB Touchscreen

Board Version Identification

This section is only for RZ/G2L boards. (not RZ/G2LC or RZ/G2UL)

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.

Sample and Demo Code

General Sample Code

Camera Image Overlay Demos

Camera Data Receive Unit (CRU) Sample Application

GStreamer Application Note

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
 
RZG2UL SW1 setting.png
Smarc RZ/G2UL DIP Switch(SW1) Settings
RZG2LC SW1 setting.png
Smarc RZ/G2LC DIP Switch(SW1) Settings

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 HDMI LCD screens were tested with this board.

LCD Monitors
Resolution Touchscreen Description Link Comments
πŸ™‚ 1920x1080 Yes Wimaxit 14 Inch πŸ›’ buy This is a very nice screen. Good color and easy to press the icons. The LCD input is mini-HDMI and comes with a mini-HDMI to HDMI cable. The RZ board is micro-HDMI. You will also need to buy a HDMI to micro-HDMI adapter. Or, buy a mini-HDMI to HDMI-micro cable. Note the the micro-USB connection on the LCD for touchscreen does not work, but the USB-C connector does work for touchscreen. You will simply need a USB-C to USB-A cable or adapter.
πŸ™‚ 1920x1080 Yes ELECROW 10.1 Inch πŸ›’ buy This is a very nice screen. You will also need to buy a HDMI to micro-HDMI cable.
😐 1920x1080 Yes/No(issues) EVICIV 10.1 Inch πŸ›’ buy ⚠️ The display works, USB touch is detected and shows up as /dev/input/event0, but does not work 100%. You can 'scroll' in a web page by dragging your finger on the screen, but actually touches (mouse clicks) do not work for some reason. There is also a noisy fan inside for an R-pi that you'll need to unplug. You will also need to buy a HDMI to micro-HDMI cable. I would not recommend his one.
πŸ™‚ 1280x800 Yes SunFounder 10.1 inch πŸ›’ buy All the cables that you will need are included.
πŸ™‚ 1024x600 Yes Ingcool 7 inch
7IP-CAPLCD
πŸ›’ buy If you attach the 'Touch' USB connection on the LCD to the RZ/G2L board, it will both power the LCD board as well as enable touch support. This kit comes with HDMI cables.
πŸ™‚ 800x480 Yes GeeekPi 5 Inch
EP-0081
πŸ›’ buy HDMI cable not included.
😐 800x480 Yes/No(Header) Kuman 5 Inch
β€ŽSC5A-US-KFBA
πŸ›’ buy ⚠️ The Touchscreen comes out on a header and no easy way to hook it up. HDMI cable not included.
☹️ 800x480 Yes ELECROW 5 inch πŸ›’ buy ⚠️ This screen flickers with the RZ/G2L board. The reason is not known.

Using the Coral MIPI Camera

GStreamer can be used to capture camera images from a Coral MIPI Camera.

Below is a User's Manual (Application Note) explains GStreamer and the custom plug-ins created by Renesas.

Usage examples are also included.


Additional information on camera setup can be found on page RZ-G/RZG_camera

Building Qt Demos

Support for building Qt v5.6.3 is included in BSP v3.0.0 and later by build core-image-qt

bitbake core-image-qt

However, if you would like to build and install the Qt demos in the BSP, you must enable them in our local.conf file.

  • 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/expand 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.

Note that eMMC Flash is always used to store the u-boot environment variables, even when boot from SPI Flash is enabled. SPI Flash is never used to store the u-boot environment variables as there is not code to support that. This means that when you switch between SPI Flash booting and eMMC Flash booting, your u-boot environment variables will remain the same.

But default, the boot loader (TrustedFirmware-A) contains both support to boot from both SPI or eMMC Flash. During boot, the code will read a boot register to determine if it should load from SPI Flash or eMMC Flash. This means you can use the same default Yocto output for either SPI Flash boot or eMMC boot.

However, you will need to program the eMMC Flash boot partitions and configure the eMMC device with the proper boot configuration to match the RZ/G2L.

The follow commands (copy/paste) and instructions will allow you to program the eMMC device on your board using the Flash Writer that was built in Yocto, and a helpful script (flash_writer_tool) that will automate the programming.

Instructions                              
#---------------------------------------------------
# Download and run '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
./flash_writer_tool.sh

### For 'Board', select the board you are using.

### For 'Target Flash', select "eMMC Flash"

### For 'FILES_DIR', manually set to the location of your Yocto output files (full path)

### Do the follow operations:

Step 1. Select "Show Switches" to show how to put board into SCIF Download mode, then press the RESET button on the board.
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 r9a07g054l2-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

SD card boot

Note: SD card boot is supported out of the box since VLP3.0.2 (and corresponding Arm Trusted Firmware version), the files to be programmed are available in the Yocto image folder. You can jump to this section if you already have the files.

RZ/G2L-LC-UL and RZ/V2L can also boot from a (micro) SD card, this is boot mode 0 called "Booting from eSD" in the User Manual.

This procedure is similar to what reported above for eMMC boot, we are not using Yocto to build (not supported in VLP3.0.0).

Assuming that the host PC is already configured to cross-build:

mkdir sd_boot
cd sd_boot

Now let's clone and patch RZ/G Trusted Firmware:

git clone https://github.com/renesas-rz/rzg_trusted-firmware-a
cd rzg_trusted-firmware-a
git checkout v2.6/rz
wget https://raw.githubusercontent.com/seebe/rzg_stuff/master/tfa_patches/0001-SD-boot-support.patch
patch -p1 < 0001-SD-boot-support.patch
cd ..

Clone u-boot:

git clone https://github.com/renesas-rz/renesas-u-boot-cip
cd renesas-u-boot-cip/
git checkout v2021.10/rz
cd ..

Retrieve some useful scripts to ease the TF-A and u-boot builds, as well as the generation of the binary files we need:

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_tfa.sh
wget https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/build_scripts/build_uboot.sh
wget https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/build_scripts/build.sh
wget https://raw.githubusercontent.com/renesas-rz/rzg2_bsp_scripts/master/usb_sd_partition/usb_sd_partition.sh
chmod +x *.sh

Select toolchain that you have:

./build.sh s

Let's build u-boot:

./build.sh u

Then TF-A, normally you can leave the default parameters (smarc rz/g2l is the default board) and boot device does not matter:

./build.sh t

SD Card Preparation

Now we have to prepare the (micro) SD card. We can optionally zero it out (WARNING: THE SD CARD CONTENT WILL BE DESTROYED):

sudo dd if=/dev/zero of=/dev/sda bs=1M status=progress

Then, assuming you want to use the same SD card to store kernel and device tree, we can (optionally) partition it:

./usb_sd_partition.sh

We are ready to write the boot files to some specific sectors of the SD card (MBR and partitions won't be touched):

cd output_smarc-rzg2l/
sudo dd if=bootparams-smarc-rzg2l.bin of=/dev/sda seek=1 count=1
sudo dd if=bl2-smarc-rzg2l.bin of=/dev/sda seek=8
sudo dd if=fip-smarc-rzg2l.bin of=/dev/sda seek=128
sync

SD card.png

(*) Note: the size of the files and SD card reported in this picture are just examples. Actual output files size may be different and there is no limitation on the SD card capacity.

Board Preparation

If you are using the SMARC board you can insert the micro SD card in the SOM module slot:

smarc micro sd.png

Change the switches to eSD boot on the carrier board acting on SW11 (SW11-1 ON, SW11-2 ON, SW11-3 OFF, SW11-4 ON):

SW11 - sd boot.png

Change SW1 on the module to select micro sd card slot (SW1-1 ON, SW1-2 ON):

SW1 - sd boot.png

and finally the board is ready to boot from the micro SD card:

NOTICE:  BL2: v2.6(release):7e8696ff4-dirty
NOTICE:  BL2: Built : 12:07:55, Sep  8 2022
NOTICE:  BL2: SD boot from partition 0
NOTICE:  BL2: Load dst=0x1f7c0 src=(p:0)0x10000(128) len=0x10(1)
NOTICE:  BL2: SD boot from partition 0
NOTICE:  BL2: Load dst=0x1f920 src=(p:0)0x10010(128) len=0x28(1)
NOTICE:  BL2: SD boot from partition 0
NOTICE:  BL2: Load dst=0x44000000 src=(p:0)0x10090(128) len=0x6069(49)
NOTICE:  BL2: SD boot from partition 0
NOTICE:  BL2: Load dst=0x1f7c0 src=(p:0)0x10000(128) len=0x10(1)
NOTICE:  BL2: SD boot from partition 0
NOTICE:  BL2: Load dst=0x1f920 src=(p:0)0x10010(128) len=0x28(1)
NOTICE:  BL2: Load dst=0x1f920 src=(p:0)0x10038(128) len=0x28(1)
NOTICE:  BL2: SD boot from partition 0
NOTICE:  BL2: Load dst=0x50000000 src=(p:0)0x16100(176) len=0xa9878(1357)
NOTICE:  BL2: Booting BL31
NOTICE:  BL31: v2.6(release):7e8696ff4-dirty
NOTICE:  BL31: Built : 12:07:55, Sep  8 2022


U-Boot 2021.10-g90edad6e00 (Sep 08 2022 - 11:55:48 +0200)

CPU:   Renesas Electronics K rev 6.15
Model: smarc-rzg2l
DRAM:  1.9 GiB
MMC:   sd@11c00000: 0, sd@11c10000: 1
Loading Environment from MMC... MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment

In:    serial@1004b800
Out:   serial@1004b800
Err:   serial@1004b800
Net:
Error: ethernet@11c20000 address not set.
No ethernet found.

Please note that u-boot by default is configured to store the environment variables on the eMMC boot partition 2. On the Smarc EVKs the SD card slot is shared with eMMC, so environment variables cannot be loaded / saved.

Use SD card for u-boot environment variables

Please note that u-boot by default is configured to store the environment variables on the eMMC boot partition 2. It is possible to configure u-boot to use the SD card also as env variable storage device. We can take advantage of the spare space between the end of FIP and first partition:

sd boot env variables.png


To do that it is sufficient to modify the u-boot configuration:

./build.sh u menuconfig

Navigate to "Environment --->" and change:

mmc partition number -> 0: there is only one physical partition on a sd card, so select it.

Environment size -> 0x10000: use 64K space for u-boot environment variables, i.e 128 sectors (512 bytes)

Environment offset -> 0xF0000: this is the offset starting from the base. We want to start from 2048 (first logical partition) - 128 (size) = 1920. 1920 * 512 = 983.040 = 0xF0000

sd boot env variables menuconfig.png

Exit and save.

Change Bus Width

You also need to configure bus width to 4, instead of 8. This can be done by modifying the device tree (arch/arm/dts/smarc-rzg2l.dts):

&sdhi0 {
        /* pinctrl placeholder
         * If this channel is used for interfacing with a SD card, a power enable
         * pin (SD0_PWR_EN) must be defined.
         * The SD0_PWR_EN pin is associated with P4_1.
         * A HIGH signal on SD0_PWR_EN will enable supply voltage for SD card.
        */
        bus-width = <4>;
        status = "okay";
};

Exit and save, then rebuild both u-boot and TF-A and reprogram bl2 and fip binaries as documented in the previous section.

You can also program your own environment variables, creating a binary as described in this section and then program it:

sudo dd if=u-boot-env.bin of=/dev/sda seek=1920

RZG2L Cortex-M33 Multi-OS Package

Instructions for RZV Cortex-M33 Multi-OS Package is located below.

Cortex-M33 Multi-OS Package Support

US108 2D Barcode Scanner Carrier Board

Importing Orcad design files into Altium

SMARC board schematics and layout are provided in Orcad format only, .dns and .brd respectively. These files can be imported into Altium designer using this guide and/or this guide.


RZ/G2UL Type2 VLP

A RZ/G2UL Type2 EVK is not available for purchase. For evaluation, it's recommended to use the RZ/G2UL Type1 or the RZ/G2LC EVK.

RZ/G2UL VLP releases are prepared for the RZ/G2UL Type1 EVK.

In case the RZ/G2LC EVK is equipped with RZ/G2UL Type2, the following VLP v3.0.1 patch is suitable to build the device tree. File:0001-Added-VLP-v3.0.1-based-RZ-G2UL-Type2-Smarc-board-sup.patch

DirectFB for RZ/G2UL

What is DirectFB?

  • Since the RZ/G2UL does not have a GPU, the Weston desktop cannot be used. Instead, graphical applications are required to use the traditional legacy Frame Buffer (/dev/fb0) Linux interface.
  • There is an old graphic framework call DirectFB that used to be very popular for the /dev/fb0 interface. You can read it about it here: https://elinux.org/DirectFB
  • The project is no longer active, however you can still enable and build the code in Yocto and it is still quite useful for validating LCDs


What is DirectFB2?


Instructions for adding the original DirectFB to Yocto:

  • DirectFB recipes are included in the standard meta-openembedded layer (meta-openembedded/meta-oe/recipes-graphics/directfb/)
  • The source files are downloaded from the Yocto Mirror server since the DirectFB website and repo have been gone for years.
  • The Yocto recipes will also apply various patches to fix bugs that were in the final v1.7.7 release of DirectFB.


1. Edit your local.conf file and add these lines:

DISTRO_FEATURES_append = " directfb" 
IMAGE_INSTALL_append = " directfb directfb-examples " 

2. Build (bitbake) a core-image-minimal or core-image-bsp. Then program your board with that new image.

3. After booting your board, log in as root and create a file /home/root/.directfbrc . Add the below contents to the .directfbrc file. Of course, change the resolution of the mode to match your LCD.

system=fbdev
module-dir=/usr/lib64/directfb-1.7-7/
fbdev=/dev/fb0
mode=1280x720
depth=32

4. Log out, then log back in.

5. Now you can run the directfb examples you build. For example:

$ df_andi

Generally, most of the examples start with "df_" . Here are some that are interesting.

  • df_dok
    • A benchmark demo that uses all the DirectFB APIs. People used to use this to compare CPU performance.
  • df_andi
    • Penguin walking demo
  • df_knuckles

A 3D skull with rotate light. If you have a mouse, you can rotate the skull.

  • df_neo
    • Fly icons that change color and size
  • df_input
    • Used for checking the touchscreen or mouse inputs
  • df_windows
    • You can move windows around with touch screen or mouse


Enable 2 Ethernet ports on EVK

  • There are 2 Ethernet on EVK board. Add-on networking functions may require users to use both ethernet cables. For doing so, please

1. Enable the ETHER0 port in the device tree. For example, enable Eth0 on RZ/Five:

 # <kernel dir>/arch/riscv/boot/dts/renesas/r9a07g043f01-smarc.dts
 10
 11 /*
 12  * DIP-Switch SW1 setting
 13  * 1 : High; 0: Low
 14  * SW1-2 : SW_SD0_DEV_SEL   (1: eMMC; 0: uSD)
 15  * SW1-3 : SW_ET0_EN_N      (0: ETHER0; 1: CAN0,CAN1,SSI1,RSPI1)
 16  * Please change below MACROs corespondingly to SW1 setting
 17  */
 18
 19 #define SW_SW0_DEV_SEL  1
 20 #define SW_ET0_EN_N 0
 21 //#define   SW_ET0_EN_N 1
 22
 23 #include "rzfive-smarc.dtsi"
 24 
 25 / {

2. For RZ/Five and RZ/G2UL, please turn switch SW1_3 OFF on the smarc module:

SW1_3 OFF

Playing and Recording Audio

  • The RZ/G2L SMARC has a WM8978 audio codec. By default, some ASLA settings are not configured so playing and recording is not available.
  • For example, if you play audio, you will not hear anything because the volume is set to 0%.
  • Before you can play or record audio, please enter the commands below.
$ amixer cset name='Left Input Mixer L2 Switch' on
$ amixer cset name='Right Input Mixer R2 Switch' on
$ amixer cset name='Headphone Playback Volume' 100
$ amixer cset name='PCM Volume' 100%
$ amixer cset name='Input PGA Volume' 25
  • Then, you can record audio by using the command below
$ arecord -M -twav -fS16_LE -r8000 /tmp/sample.wav 

Note about playing 48KHz and 44.1KHz audio files

The RZ/G2L SMARC EVK is designed to handle both 48KHz and 44.1KHz audio files seamlessly. These two sampling frequencies require 12.288MHz and 11.2896MHz master clock respectively (256x the sample rate). On the SMARC EVK we have a versaclock3 that provides the different clocks. When it comes to audio this is the configuration:Smarc audio clock.png

The versaclock3 clock generator generates audio_clk1 (SE1 output), audio_clk2 (Diff2 output), required by the RZ/G2L SSI (I2S peripheral), and audio_mclk (SE2) that is fed into the WM8978 codec as master clock. However the versaclock3 can be reconfigured to switch the audio_mclk dynamically between 11.2896MHz and 12.288MHz. This is done seamlessly because audio_mclk is not a fixed clock, the ALSA framework "sends" the reconfiguration request to both the SSI driver and the versaclock3 driver. The first driver switches reference clock input from audio_clk1 and audio_clk2 and viceversa, the latter driver sets the best clock parent for audio_mclk, that is in fact done by switching from DIV4 to DIV5 via I2C.

image timing commander.png

This is the screenshot of the versaclock3 Timing Commander utility, that shows the default configuration stored in the OTP.