RNX-RZG2UL-OSM Yocto Linux: Difference between revisions
(Add programming of bootloaders) |
(Add writing of Linux Kernel and RootFS to a uSD card) |
||
Line 164: | Line 164: | ||
SpiFlashMemory End Address : H'000D19DF | SpiFlashMemory End Address : H'000D19DF | ||
=========================================================== | =========================================================== | ||
== Write Linux Kernel and RootFS to a uSD card == | |||
The simplest way to write Linux Kernel and RootFS is using the bmaptool:<br> | |||
$ sudo bmaptool copy tmp/deploy/images/rnx-rzg2ul-osm/core-image-bsp-rnx-rzg2ul-osm.wic.gz /dev/sdX | |||
* Select QSPI Boot mode and reset the board: | * Select QSPI Boot mode and reset the board: | ||
Line 187: | Line 191: | ||
Net: eth0: ethernet@11c20000 | Net: eth0: ethernet@11c20000 | ||
Hit any key to stop autoboot: 0 | Hit any key to stop autoboot: 0 | ||
switch to partitions #0, OK | |||
mmc1 is current device | |||
17699328 bytes read in 1461 ms (11.6 MiB/s) | |||
27809 bytes read in 4 ms (6.6 MiB/s) | |||
Moving Image from 0x48080000 to 0x48200000, end=49350000 | |||
## Flattened Device Tree blob at 48000000 | |||
Booting using the fdt blob at 0x48000000 | |||
Loading Device Tree to 0000000057ff6000, end 0000000057fffca0 ... OK | |||
Starting kernel ... | |||
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x412fd050] | |||
[ 0.000000] Linux version 5.10.184-cip36-yocto-standard (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 8.3.01 | |||
[ 0.000000] Machine model: Ronetix RNX-RZG2UL-OSM based on r9a07g043u11 | |||
= See also = | = See also = |
Revision as of 13:20, 6 November 2023
Overview
The Yocto Project is an open source collaboration project that helps developers create custom Linux-based systems for embedded products, regardless of the hardware architecture.
This article show how to build Yocto Image for RNX-RZG2UL-OSM CPU module using:
Yocto | Linux Kernel | U-BOOT |
---|---|---|
Poky | 5.10.184 | 2021.10 |
Installing required packages
Please make sure your host PC is running Ubuntu 20.04+ 64-bit and install the following packages:
$ sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python3 python3-pip python3-pexpect \ xz-utils debianutils iputils-ping libsdl1.2-dev xterm $ sudo apt-get install autoconf libtool libglib2.0-dev libarchive-dev python-git-doc \ sed cvs subversion coreutils texi2html docbook-utils \ help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev \ mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils pv \ libncurses5 libncurses5-dev libncursesw5-dev libelf-dev zlib1g-dev bmap-tools
More details about the Yocto Environment Setup can be found on the Yocto official site
Download Yocto based on Renesas Verified Linux Package
$ git config --global user.name "Your Name" $ git config --global user.email "Your Email"
$ mkdir ~/yocto-renesas $ cd ~/yocto-renesas
- Download the Renesas Verified Linux Package
$ git clone https://github.com/ronetix/rzg_vlp.git $ cd rzg_vlp
Setup and build Yocto
$ TEMPLATECONF=$PWD/meta-renesas/meta-rzg2l/docs/template/conf/ source poky/oe-init-build-env build $ MACHINE=rnx-rzg2ul-osm bitbake core-image-bsp
Build Results
The resulted images are located in tmp/deploy/images/rnx-rzg2ul-osm
Programming images
The bootloaders (BL2, BL3 and U-BOOT) and the Linux Kernel can be programmed on the QSPI Flash or on the eMMC.
The RoorFS can be programmed on the eMMC or on a SD card (J41 on the carrier board).
More information can be found in "r01us0616ej0100-rz-g(Linux Start-up Guide RZG2L,LC,UL).pdf" which is part of
the Renesas RZG Verified Linux Package:
or
Serial terminal connection
A serial terminal connection through USB to UART bridge is required. On the carrier board, set the boot mode to "SCIF Download mode".
J31, pin 1-2 | J31, pin 3-4 | |
---|---|---|
SCIF Download mode | close | open |
QSPI Boot mode | open | close |
eMMC Boot mode | close | close |
- Connect a USB Type-microAB cable to J3 (UART DBG).
- Start a terminal app (for example minicom) and configure to use the second FTDI port.
- After power up, the CPU reports:
(C) Renesas Electronics Corp. -- Load Program to System RAM --------------- please send !
Programming Bootloaders and Linux Kernel on the QSPI Flash
Download Flash Writer to RAM
In minicom, press Ctrl-A S and then select "ascii" upload protocol.
Select the file tmp/deploy/images/rnx-rzg2ul-osm/Flash_Writer_SCIF_RZG2UL_SMARC_DDR4_1GB_1PCS.mot
After successfully downloading the binary, Flash Writer starts automatically and shows a message
like below on the terminal.
DDR init done. === DDR R/W CHECK ==== Check: 41000000, Length: 01000000 Pass! Flash writer for RZ/G2 Series V1.06 Aug.10,2022 Product Code : RZ/G2UL Type1 >
Programming Bootloaders
For the boot operation, two bootloader files need to be written to the target board:
- tmp/deploy/images/rnx-rzg2ul-osm/bl2_bp-rnx-rzg2ul-osm.srec (BL2 bootloader + boot parameters)
- tmp/deploy/images/rnx-rzg2ul-osm/fip-rnx-rzg2ul-osm.srec (BL3 + U-BOOT)
“XLS2” command of Flash Writer is used to write bootloader binary files. This command receives binary data from the serial port and writes the data to a specified address of the Flash ROM with information where the data should be loaded on the address of the main memory.
>xls2 ===== Qspi writing of RZ/G2 Board Command ============= Load Program to Spiflash Writes to any of SPI address. Dialog : AT25QL128A Program Top Address & Qspi Save Address ===== Please Input Program Top Address ============ Please Input : H'11E00
===== Please Input Qspi Save Address === Please Input : H'0 Work RAM(H'50000000-H'53FFFFFF) Clear.... please send ! ('.' & CR stop load)
- Send the data of bl2_bp-rnx-rzg2ul-osm.srec from terminal software after the message “please send !” is shown.
After successfully download the binary, messages like below are shown on the terminal.
OK SAVE SPI-FLASH....... ======= Qspi Save Information ================= SpiFlashMemory Stat Address : H'00000000 SpiFlashMemory End Address : H'0000CA38 ===========================================================
Next, write another loader file by using XLS2 command again.
>xls2 ===== Qspi writing of RZ/G2 Board Command ============= Load Program to Spiflash Writes to any of SPI address. Dialog : AT25QL128A Program Top Address & Qspi Save Address ===== Please Input Program Top Address ============ Please Input : H'0
===== Please Input Qspi Save Address === Please Input : H'1D200 Work RAM(H'50000000-H'53FFFFFF) Clear.... please send ! ('.' & CR stop load)
- Send the data of fip-rnx-rzg2ul-osm.srec from terminal software after the message "please send !" is shown.
After successfully download the binary, messages like below are shown on the terminal.
OK SAVE SPI-FLASH....... ======= Qspi Save Information ================= SpiFlashMemory Stat Address : H'0001D200 SpiFlashMemory End Address : H'000D19DF ===========================================================
Write Linux Kernel and RootFS to a uSD card
The simplest way to write Linux Kernel and RootFS is using the bmaptool:
$ sudo bmaptool copy tmp/deploy/images/rnx-rzg2ul-osm/core-image-bsp-rnx-rzg2ul-osm.wic.gz /dev/sdX
- Select QSPI Boot mode and reset the board:
NOTICE: BL2: v2.9(release):215afc594-dirty NOTICE: BL2: Built : 14:25:58, Oct 31 2023 NOTICE: BL2: Booting BL31 NOTICE: BL31: v2.9(release):215afc594-dirty NOTICE: BL31: Built : 14:25:58, Oct 31 2023 U-Boot 2021.10 (Oct 30 2023 - 16:04:05 +0000) CPU: Renesas Electronics K rev 8.7 Model: rnx-rzg2ul-osm DRAM: 896 MiB WDT: watchdog@0000000012800800 WDT: Started with servicing (60s timeout) MMC: sd@11c00000: 0, sd@11c10000: 1 Loading Environment from MMC... OK In: serial@1004b800 Out: serial@1004b800 Err: serial@1004b800 U-boot WDT started! Net: eth0: ethernet@11c20000 Hit any key to stop autoboot: 0 switch to partitions #0, OK mmc1 is current device 17699328 bytes read in 1461 ms (11.6 MiB/s) 27809 bytes read in 4 ms (6.6 MiB/s) Moving Image from 0x48080000 to 0x48200000, end=49350000 ## Flattened Device Tree blob at 48000000 Booting using the fdt blob at 0x48000000 Loading Device Tree to 0000000057ff6000, end 0000000057fffca0 ... OK Starting kernel ... [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x412fd050] [ 0.000000] Linux version 5.10.184-cip36-yocto-standard (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 8.3.01 [ 0.000000] Machine model: Ronetix RNX-RZG2UL-OSM based on r9a07g043u11