Skip to content

Building the HMI SDK with Yocto

Introduction

This page guides you through building the HMI SDK with Yocto. You will be able to modify the source code and customize the Linux environment according to your needs.

To build Yocto Linux, the following equipment should be prepared.

Equipment

Details

Linux PC





Approximately the following free space is required.
- 150 GB for RZ/G2L EVK
- 150 GB for RZ/G2LC EVK
- 85 GB for RZ/G2UL EVK

OS

Ubuntu 22.04 LTS, 64-bit version

Notice

Several updated OSS components, released to address security vulnerabilities and enhance driver performance, are now available on Renesas' GitHub. Please refer to How to Update Linux Packages in the HMI SDK for instructions on how to replace them.

Step 1: Obtain the RZ/G HMI SDK Yocto Build Package

Please download the HMI SDK Yocto Build Package using the button below.

During the build process, the source code of HMI SDK modules will be downloaded over a network connection. Alternatively, you can also manually download the same source code used to create the HMI SDK binaries and use it offline. Download the HMI SDK Source Code using the button below.

Source Code
for all RZ/G devices

Notice

  • The Source Code supplement is very large, so downloading may take some time.
  • Additional setup in Step 2-7 Set up the environment for an offline build is required if you choose to download the source code manually.

Note

Refer to File Contents for details about the HMI SDK Yocto Build Package and Source Code.
After downloading the package, please review the included Release Note.

Step 2: Build HMI SDK with Yocto

Tip

In the following instructions, text shown in angle brackets should be replaced with values specific to your environment.
The angle brackets < and > should not be included when you enter the text.

  1. Install the required packages.

    Run the following command to install the required packages on your Linux PC.

    sudo apt-get update
    sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio 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 the git environment.

    Run the following command to set up the git environment if it has not been configured yet.

    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.

    Please set the following environment variables.

    export WORK=<A directory path for building>
    export PLATFORM=rzg2l
    export BOARD=smarc-rzg2l
    export SDK_PKG_DIR=<A directory path for HMI SDK Yocto Build packages>
    

    export WORK=<A directory path for building>
    export PLATFORM=rzg2l
    export BOARD=smarc-rzg2lc
    export SDK_PKG_DIR=<A directory path for HMI SDK Yocto Build Packages>
    

    export WORK=<A directory path for building>
    export PLATFORM=rzg2l
    export BOARD=smarc-rzg2ul
    export SDK_PKG_DIR=<Directory path for the HMI SDK Yocto Build Package>
    

    Tip

    The SDK_PKG_DIR should point to the directory where you have downloaded your HMI SDK Yocto Build Packages, including RTK0EF0195F*SJ_${PLATFORM}_yocto-and-pre-built-image.zip and RTK0EF0195F*SJ_linux-src.zip.

  4. Extract the Yocto recipe package.

    Decompress the Yocto recipe and pre-built binary image packages.

    cd ${SDK_PKG_DIR}
    unzip RTK0EF0195F*SJ_${PLATFORM}_yocto-and-pre-built-image.zip
    

    Create a working directory.

    mkdir -p ${WORK}
    

    Extract the Yocto recipe package.

    cd ${WORK}
    tar xf ${SDK_PKG_DIR}/RTK0EF0195F*SJ_${PLATFORM}_yocto-and-pre-built-image/yocto_recipe_rzg2_hmi-sdk_v*.tar.gz --strip-components 1
    
  5. Initialize the build environment.

    Run the given environment setup script with the command shown below.

    cd ${WORK}
    TEMPLATECONF=${PWD}/meta-renesas/meta-${PLATFORM}/docs/template/conf/ source poky/oe-init-build-env build
    
  6. Add layers.

    Add necessary Yocto meta-layers using the following commands.

    cd ${WORK}/build
    bitbake-layers add-layer ../meta-rz-features/meta-rz-graphics
    bitbake-layers add-layer ../meta-rz-features/meta-rz-codecs
    bitbake-layers add-layer ../meta-clang
    bitbake-layers add-layer ../meta-browser/meta-chromium
    bitbake-layers add-layer ../meta-openembedded/meta-networking
    bitbake-layers add-layer ../meta-browser-hwdecode
    bitbake-layers add-layer ../meta-rz-demos
    

    cd ${WORK}/build
    bitbake-layers add-layer ../meta-rz-features/meta-rz-graphics
    bitbake-layers add-layer ../meta-clang
    bitbake-layers add-layer ../meta-browser/meta-chromium
    bitbake-layers add-layer ../meta-openembedded/meta-networking
    bitbake-layers add-layer ../meta-browser-hwdecode
    bitbake-layers add-layer ../meta-rz-demos
    

    cd ${WORK}/build
    bitbake-layers add-layer ../meta-rz-demos
    
  7. Set up the environment for an offline build.

    Notice

    This step configures the environment for offline building when you choose to download the Source Code manually.

    If you prefer to obtain the source code via the network while building the HMI SDK with Yocto, you can skip this Step 2-7 and continue directly with Step 2-8.

    Change the environment variable BB_NO_NETWORK in local.conf from 0 to 1 using the sed command.

    cd ${WORK}/build
    sed -i "s|\(BB_NO_NETWORK =.*\)\"0\"|\1\"1\"|" "conf/local.conf"
    

    Decompress the downloaded Source Code and set it up in the build environment.

    cd ${SDK_PKG_DIR}
    unzip RTK0EF0195F*SJ_linux-src.zip
    cd ${SDK_PKG_DIR}/RTK0EF0195F*SJ_linux-src/
    7z x oss-souce-code-pkg_rzg2_hmi-sdk_v*.7z
    mv downloads/ ${WORK}/build/
    
  8. Modify the configurations for the build environment.

    Add IMAGE_INSTALL_append and other settings to local.conf using the command shown below.

    cd ${WORK}/build
    sed -i '$aIMAGE_INSTALL_append = \" packagegroup-lvgl-demo packagegroup-benchmark-tools packagegroup-chromium-demo packagegroup-rzg-hmi-sdk-demo \"' "conf/local.conf"
    sed -i '$aWHITELIST_GPL-3.0 += \" glmark2 \"' "conf/local.conf"
    sed -i '$aPREFERRED_VERSION_nodejs-native = \"14.%\"' "conf/local.conf"
    

    cd ${WORK}/build
    sed -i '$aIMAGE_INSTALL_append = \" packagegroup-lvgl-demo packagegroup-benchmark-tools packagegroup-chromium-demo packagegroup-rzg-hmi-sdk-demo \"' "conf/local.conf"
    sed -i '$aWHITELIST_GPL-3.0 += \" glmark2 \"' "conf/local.conf"
    sed -i '$aPREFERRED_VERSION_nodejs-native = \"14.%\"' "conf/local.conf"
    

    cd ${WORK}/build
    sed -i '$aIMAGE_INSTALL_append = \" packagegroup-lvgl-demo packagegroup-benchmark-tools packagegroup-rzg-hmi-sdk-demo \"' "conf/local.conf"
    
  9. Build images.

    Run the bitbake command to build the images.

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake core-image-weston
    

    After completing the build process above, change the eMMC setting from 1 to 0.

    cd ${WORK}/build/tmp/work-shared/${BOARD}/kernel-source
    vi arch/arm64/boot/dts/renesas/rzg2l-smarc-som.dtsi
        (change EMMC setting)
            before) #define EMMC	1
            after)  #define EMMC	0
    

    After making the change above, perform the additional build process as follows.

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake linux-renesas -C compile
    MACHINE=${BOARD} bitbake core-image-weston
    

    Tip

    The SDK build may fail depending on the build environment. If this happens, try running the build again after some time, or rebuild it from scratch using the commands below.

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake core-image-weston -c cleanall
    MACHINE=${BOARD} bitbake core-image-weston
    

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake core-image-weston
    

    After the above build process, change the setting of SW_SD0_DEV_SEL from 1 to 0.

    cd ${WORK}/build/tmp/work-shared/${BOARD}/kernel-source
    vi arch/arm64/boot/dts/renesas/r9a07g044c2-smarc.dts
        (change SW_SD0_DEV_SEL setting)
            before) #define SW_SD0_DEV_SEL 1
            after)  #define SW_SD0_DEV_SEL 0
    

    After the change above, perform the additional build process as follows.

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake linux-renesas -C compile
    MACHINE=${BOARD} bitbake core-image-weston
    

    Tip

    The SDK build may fail depending on the build environment. If this happens, try running the build again after some time, or rebuild it from scratch using the commands below.

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake core-image-weston -c cleanall
    MACHINE=${BOARD} bitbake core-image-weston
    

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake core-image-bsp
    

    Tip

    The SDK build may fail depending on the build environment. If this happens, try running the build again after some time, or rebuild it from scratch using the commands below.

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake core-image-bsp -c cleanall
    MACHINE=${BOARD} bitbake core-image-bsp
    

    Tip

    The build may take several hours, depending on the PC specifications.

    This completes the build of the Linux environment.

  10. Create the SDK toolchain.

    If you want to further deploy sample or your customized applications, building the toolchain is also required. Create the SDK toolchain using the following command.

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake core-image-weston -c populate_sdk
    

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake core-image-weston -c populate_sdk
    

    cd ${WORK}/build
    MACHINE=${BOARD} bitbake core-image-bsp -c populate_sdk
    

This concludes the Building the HMI SDK with Yocto guide.

Tip

Your newly built images and SDK toolchain will be generated in the following directories.
Images: ${WORK}/build/tmp/deploy/images/${BOARD}/
SDK toolchain: ${WORK}/build/tmp/deploy/sdk/

To flash the image to the SD card using bmaptool, refer to Step 4: Create SD Cards with the Prebuilt Image.

To boot your device using the prepared SD card, refer to EVK DIP Switch Setup for your boot mode setup.

For detailed information about each demo application, see Demo Applications.
For further development of sample applications, see Sample Applications.
For additional customizations, see Wiki.