Renesas
RZ/V AI

5.00

The best solution for
starting your AI applications.

Provided by Renesas Electronics Corporation




To keep you updated,
Watch our GitHub repository
Watch



This project is maintained by renesas-rz

Hosted on GitHub Pages — Theme by orderedlist

How to build RZ/V2H AI SDK Source Code



This page explains how to build Linux with RZ/V2H AI SDK Source Code.
Supported version: RZ/V2H AI SDK v5.00

Introduction

AI SDK is a quick and easy AI Application development environment.
It is specifically made for RZ/V2H Evaluation Board Kit with fixed Linux components.
(For more information, please refer to Getting Started and AI SDK.)

To modify Linux component, you need to build AI SDK from source code.
AI SDK Source Code can generate the same Linux environment as AI SDK.

AI Application and AI SDK software

This page explains how to build AI SDK Source Code.
After you have completed this page, you would be able to change the source code and customize Linux environment (i.e., memory map, additional OSS etc...).
To customize the Linux environment, please refer to RZ/V2H BSP Manual Set.

Requirement
  1. Users have launched RZ/V2H Evaluation Board Kit according to Getting Started, which means they can run AI Application on the board.
  2. To build Yocto Linux, the below equipment should be prepared.
    Equipment Details
    Linux PC Approximately 120GB free space is necessary.
    OS Ubuntu 20.04 LTS
    64bit OS must be used.

Now you are ready to build your Linux development environment.
Let's get started!!


Step 1: Obtain RZ/V2H AI SDK Source Code

Download the RZ/V2H AI SDK Source Code from the link below.

Download Link

AI SDK Source Code (RTK0EF0180F*_linux-src.zip) contains following files:
File name Description
README.txt README file.
rzv2h_ai-sdk_yocto_recipe_v*.tar.gz Yocto recipe.
Yocto recipes are text files that contains necessary information to build Yocto Linux.


Step 2: Extract RZ/V2H AI SDK Source Code


This step explains how to extract RZ/V2H AI SDK Source Code zip file.

  1. On your Linux PC, check you have already registered the environment variable WORK with the below command.
    printenv WORK

  2. Make the working directory on your Linux PC.
    mkdir -p ${WORK}/src_setup
  3. Move to the working directory.
    cd ${WORK}/src_setup
  4. Extract RZ/V2H AI SDK Sorce Code zip file.
    unzip <Path to the file>/RTK0EF0180F*_linux-src.zip -d ${WORK}/src_setup
  5. Check the working directory to confirm the package contents.
    ls -1 ${WORK}/src_setup
    • If the above command prints followings, the package is extracted correctly.
      README.txt
      rzv2h_ai-sdk_yocto_recipe_v*.tar.gz


Step 3: Build RZ/V2H AI SDK Source Code

This step explains how to build Linux environment with RZ/V2H AI SDK Source Code

  1. To install necessary sofware, run the following commands 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 python python3 python3-pip python3-pexpect \
    xz-utils debianutils iputils-ping libsdl1.2-dev xterm p7zip-full libyaml-dev \
    libssl-dev 
  2. Run the following commands and set the user name and email address before starting the build procedure.
    It is needed to avoid errors when using git command to apply patches.
    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"
  3. Register the working directory path to an environment variable.
    export YOCTO_WORK=${WORK}/src_setup/yocto
    mkdir -p ${YOCTO_WORK}
  4. Extract Yocto recipe package.
    cd ${YOCTO_WORK}
    tar zxvf ${WORK}/src_setup/rzv2h_ai-sdk_yocto_recipe_v*.tar.gz
  5. Run the following procedures to apply the patch file.
    1. Get e-CAM22_CURZH camera driver (MIPI) from e-con Systems.
      The e-CAM22_CURZH camera driver (MIPI) used in AI SDK is not included in the RZ/V2H AI SDK Source Code. The required driver needs to be obtained through the following procedure.
      1. To build the e-CAM22_CURZH camera driver (MIPI) for RZ/V2H Evaluation Board Kit, contact e-con Systems at this link to obtain the patch file below.
        File name Description
        e-CAM22_CURZ*.patch e-CAM22_CURZH camera driver (MIPI) Yocto patch file for RZ/V2H
      2. Copy and apply the patch file.
        cp <Path to the file>/e-CAM22_CURZ*.patch ${YOCTO_WORK}
        cd ${YOCTO_WORK}
        patch -p1 -i e-CAM22_CURZ*.patch
  6. Check the working directory to confirm Yocto recipes content.
    ls -1 ${YOCTO_WORK}
    • If the above command prints followings, Yocto recipes are extracted correctly.
      0001-tesseract.patch
      0002-sd-image-size-16gb.patch
      e-CAM22_CURZ*.patch
      meta-econsys
      meta-gplv2
      meta-openembedded
      meta-renesas
      meta-rz-features
      meta-virtualization
      poky
    Note Evaluation version of Graphics Library has restriction on their running time.
    If you would like to use unrestricted version of Graphics Library, please refer to D1. For RZ/V2H: Change the Graphics Library to the Unrestricted Version.
  7. Initialize a build using the oe-init-build-env script in Poky and set environment variable TEMPLATECONF to the below path.
    cd ${YOCTO_WORK}
    TEMPLATECONF=${PWD}/meta-renesas/meta-rzv2h/docs/template/conf/ source poky/oe-init-build-env
  8. Run the following commands to add necessary layers for AI application to ${YOCTO_WORK}/build/conf/bblayers.conf (configration file for layers).
    bitbake-layers add-layer ../meta-rz-features/meta-rz-graphics
    bitbake-layers add-layer ../meta-rz-features/meta-rz-drpai
    bitbake-layers add-layer ../meta-rz-features/meta-rz-opencva
    bitbake-layers add-layer ../meta-rz-features/meta-rz-codecs
    bitbake-layers add-layer ../meta-econsys
  9. Apply a patch file to add Tesseract Open Source OCR Engine for AI applications.
    patch -p1 < ../0001-tesseract.patch
  10. Apply a patch file to change SD card image size.
    patch -p1 < ../0002-sd-image-size-16gb.patch
    Note The default size of the microSD card image created in this guide is approximately 16 GB.
    If you would like to change the microSD card image size, please refer to D2. For RZ/V2H: Change the size of the microSD card image in WIC format.
  11. Run the following command to build the Linux kernel files.
    (It takes a few hours to finish building depending on the user's host PC performance)
    MACHINE=rzv2h-evk-ver1 bitbake core-image-weston
    All necessary files listed below will be generated by the build command and they will be located in ${YOCTO_WORK}/build/tmp/deploy/images/rzv2h-evk-ver1 directory.
    File name Description
    core-image-weston-rzv2h-evk-ver1.wic.bmap
    core-image-weston-rzv2h-evk-ver1.wic.gz
    WIC format SD card image
    Flash_Writer_SCIF_RZV2H_DEV_INTERNAL_MEMORY.mot
    bl2_bp_spi-rzv2h-evk-ver1.srec
    fip-rzv2h-evk-ver1.srec
    Boot loader used when booting from xSPI
  12. Run the following command to build cross compiler installer.
    MACHINE=rzv2h-evk-ver1 bitbake core-image-weston -c populate_sdk
    A necessary file listed below will be generated by the build command and the cross compiler installer will be located in ${YOCTO_WORK}/build/tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-rzv2h-evk-ver1-toolchain-*.sh.
    File name Description
    poky-glibc-x86_64-core-image-weston-aarch64-rzv2h-evk-ver1-toolchain-*.sh Cross compiler installer
    Note If some errors occurred during the build, please clean the directory and rebuild it after a period of time according to the below commands.
    cd ${YOCTO_WORK}/build
    MACHINE=rzv2h-evk-ver1 bitbake core-image-weston -c cleanall
    And run the build command again.
    • For Linux kernel files
      MACHINE=rzv2h-evk-ver1 bitbake core-image-weston
    • For cross compiler installer
      MACHINE=rzv2h-evk-ver1 bitbake core-image-weston -c populate_sdk


This is the end of how to build AI SDK Source Code.

You have prepared following files, which is same as the one provided in Step 3: Obtain RZ/V2H AI SDK in Getting Started, and you can run AI Applications according to Getting Started.

Path File name Description
${YOCTO_WORK}/build/tmp/deploy/images/rzv2h-evk-ver1 core-image-weston-rzv2h-evk-ver1.wic.bmap
core-image-weston-rzv2h-evk-ver1.wic.gz
WIC format SD card image
Flash_Writer_SCIF_RZV2H_DEV_INTERNAL_MEMORY.mot
bl2_bp_spi-rzv2h-evk-ver1.srec
fip-rzv2h-evk-ver1.srec
Boot loader used when booting from xSPI
${YOCTO_WORK}/build/tmp/deploy/sdk poky-glibc-x86_64-core-image-weston-aarch64-rzv2h-evk-ver1-toolchain-*.sh Cross compiler installer
Note 1 For more Yocto Project information, please refer the link below:
https://docs.yoctoproject.org/3.1.31/brief-yoctoprojectqs/brief-yoctoprojectqs.html
Note 2 When customizing Linux development environment, following information may help.
Note 3 To add more functionality to AI SDK, please refer to following URL.
Note 4 Regarding the eSD (Embedded SD) booting, please note the following:
  • The eSD boot procedure using microSD card described in this guide is for evaluation purposes only.
  • If you use the eSD boot, please implement the eSD on your board according to the standard "SD Specification Part 1 eSD Addendum (version 2.10)".
  • The reboot command cannot be used when using the eSD boot procedure using microSD card described in this guide.


If you have any questions about AI SDK Source Code,
please add new issues to AI SDK GitHub issues.

Go to GitHub issues