Skip to content

How To Build Linux BSP Plus

Introduction

This page explains how to build Linux BSP Plus source code.

Requirement

  1. To build Linux BSP Plus (Yocto Linux), the equipment below should be prepared.

    Equipment

    Details

    Linux PC



    Approximately 110GB free space is necessary.

    OS

    Ubuntu 22.04 LTS

    64bit OS must be used.

Step 1: Obtain Renesas RZ Linux BSP Plus source code

Note

Renesas RZ Linux BSP Plus (Yocto Linux) source code is available from GitHub repository.

How to get the source code is explained in the next step.

Regarding Graphics and Video Codecs packages, please download from Renesas.com website.

Once downloaded, please check the Release Note included inside each package.

Step 2: Build Renesas RZ Linux BSP Plus source code

This step explains how to build Linux environment with Renesas RZ Linux BSP Plus source code.

Note

In the following instructions, text in angle brackets should be replaced with a character string that depends on your environment.

The brackets < and > are unnecessary in the text.

  1. Install the required packages

    Install some packages into your Linux PC, which are necessary in the following steps.

    sudo apt-get update
    sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping libsdl1.2-dev xterm p7zip-full libyaml-dev libssl-dev bmap-tools
    
  2. Set up your git environment

    Set up your git environment if you have never done it.

    git config --global user.email "<Your email address>"
    git config --global user.name "<Your user name>"
    

    Note

    For more information, refer to Yocto Project Quick Build.

  3. Set environment variables

    Set the following environment variables.

    export WORK=<A directory path for building>
    export BOARD=smarc-rzg2l
    
  4. Clone Yocto recipe package

    Create a working directory, and clone Yocto recipe package.

    mkdir ${WORK}
    cd ${WORK}
    

    git clone https://git.yoctoproject.org/git/poky
    cd poky
    git checkout -b tmp dc4827b3660bc1a03a2bc3b0672615b50e9137ff
    cd ${WORK}
    

    git clone https://git.yoctoproject.org/meta-arm
    cd meta-arm
    git checkout -b tmp 950a4afce46a359def2958bd9ae33fc08ff9bb0d
    cd ${WORK}
    

    git clone https://git.openembedded.org/meta-openembedded
    cd meta-openembedded
    git checkout -b tmp  67ad83dd7c2485dae0c90eac345007af6195b84d
    cd ${WORK}
    

    git clone https://github.com/renesas-rz/meta-renesas
    cd meta-renesas
    git checkout -b tmp a50fccc0d577195ea258e7557d8fa01bad176c23
    cd ${WORK}
    
  5. Enable Graphics and Video Codec

    The graphics package and the video codec package can be used at the same time, or just one of the packages can be used individually.

    Note

    You need to download Graphics and Video Codec packages for this step.

    See Step 1: Obtain Renesas RZ Linux BSP Plus source code.

    Graphics package is RTK0EF0045Z14001ZJ-*.zip.

    Video Codec package is RTK0EF0045Z16002ZJ_*.zip.

    • Graphics package

      Note

      If you want to enable the Graphics on RZ/G2L when building core-image-weston, please copy the Graphics package to working directory and run the commands below.

      If you build core-image-minimal, please ignore this step.

      After copying the Graphics package, please extract the package as below.

      cd ${WORK}
      unzip ./RTK0EF0045Z14001ZJ-*.zip
      tar zxvf ./RTK0EF0045Z14001ZJ-*/meta-rz-features_graphics_*.tar.gz
      
    • Video Codec package

      After copying the Video Codec package, please extract the package as below.

      cd ${WORK}
      unzip ./RTK0EF0045Z16002ZJ_*.zip
      tar zxvf ./RTK0EF0045Z16002ZJ_*/meta-rz-features_codec_*.tar.gz
      
  6. Initialize build environment

    Run an environment setup script as follows.

    cd ${WORK}
    TEMPLATECONF=${PWD}/meta-renesas/meta-rz-distro/conf/templates/rz-bsp-plus-conf/ source poky/oe-init-build-env build
    
  7. Add layers

    Add necessary Yocto meta-layers layer as follows.

    • Graphics: Please run the command below if you need the Graphics library.

      cd ${WORK}/build
      bitbake-layers add-layer ../meta-rz-features/meta-rz-graphics
      
    • Video Codec: Please run the command below if you need the video codec library.

      cd ${WORK}/build
      bitbake-layers add-layer ../meta-rz-features/meta-rz-codecs
      
  8. Enable mke2fs (Make Extended Filesystem) command sets

    If you need to create the filesystem for the block devices on the evaluation board, please add mke2fs command sets to root filesystem by local.conf.

    Caution

    If eMMC boot is required, this step is mandatory.

    cd ${WORK}/build
    echo 'IMAGE_INSTALL:append = " e2fsprogs-mke2fs"'>> conf/local.conf
    
  9. Build images

    Run bitbake command to build images.

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake <image name>
    

    Note

    Available build options (<image name>) are:

    • core-image-minimal
    • core-image-weston

    Note

    After building images, you can find them in the following directories.

    • Images: ${WORK}/build/tmp/deploy/images/${BOARD}/

    Device

    Category

    File name

    RZ/G2L













    Linux kernel

    Image-smarc-rzg2l.bin

    Device tree file

    r9a07g044l2-smarc.dtb

    Root filesystem

    <image name>-smarc-rzg2l.rootfs.tar.bz2

    Boot loader


    • bl2_bp_esd-smarc-rzg2l_pmic.bin
    • bl2_bp_mmc-smarc-rzg2l_pmic.srec
    • bl2_bp_spi-smarc-rzg2l_pmic.srec
    • fip-smarc-rzg2l_pmic.srec

    Flash Writer

    Flash_Writer_SCIF_RZG2L_SMARC_PMIC_DDR4_2GB_1PCS.mot

    SD image (wic)

    • <image name>-smarc-rzg2l.rootfs.wic.gz
    • <image name>-smarc-rzg2l.rootfs.wic.bmap