R-Car/Boards/Kingfisher/Yocto-Gen3/v2.12.0

From eLinux.org
Jump to: navigation, search


This page is out of date.
Please refer to the Kingfisher-Yocto-Gen3 page for the latest version.

Introduction

This page contains information on building and running Yocto on:

Yocto versions

Poky-2.0.2 is supported with Yocto v2.12.0.
Specific commit of meta-openembedded is required.

Host PC

Ubuntu 14.04 LTS (64bit) is recommended as OS. 32bit version is not supported.

Preliminary steps

  1. Download evaluation version of proprietary graphics and multimedia drivers from Renesas.
    To download Multimedia and Graphics library and related Linux drivers, please use the following link:
    https://www.renesas.com/us/en/solutions/automotive/rcar-download/rcar-demoboard.html
    Download two files:
    R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20160906.zip
    R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20160906.zip

    Graphic drivers are required for Wayland. Multimedia drivers are optional.
  2. Install required packages
    Ubuntu and Debian
    sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
         build-essential chrpath socat libsdl1.2-dev xterm python-crypto cpio python python3 \
         python3-pip python3-pexpect xz-utils debianutils iputils-ping libssl-dev
    
    Fedora
    sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
         diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
         ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat \
         SDL-devel xterm python-crypto cpio python python3 python3-pip python3-pexpect \
         ghc-lzma-conduit iputils openssl
    
    Refer to Yocto Project Quick Start for more information.

Building the BSP for Kingfisher

Build using script

This example is for Kingfisher with H3ULCB board.
If you use other board, you need to modify the script.

  1. Directory Structure
    |--build.sh
    `--proprietary
       |--R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20160906.tar.gz
       `--R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20160906.tar.gz
    
  2. Build script(build.sh)
    #!/bin/bash
    
    #Set the target board
    TARGET_BOARD=h3ulcb
    #TARGET_BOARD=m3ulcb
    
    # Create a directory and switch to it
    mkdir $TARGET_BOARD
    cd $TARGET_BOARD
    WORK=`pwd`
    echo $WORK
    
    git clone git://git.yoctoproject.org/poky
    git clone git://git.linaro.org/openembedded/meta-linaro.git
    git clone git://git.openembedded.org/meta-openembedded
    git clone git://github.com/CogentEmbedded/meta-rcar.git meta-renesas -b v2.12.0
    git clone git://github.com/CogentEmbedded/meta-renesas-quick-start.git meta-renesas-quick-start -b bsp_v212
    
    cd $WORK/poky
    git checkout -b tmp 40376446904ae3529be41737fed9a0b650ed167d
    cd $WORK/meta-linaro
    git checkout -b tmp 9b1fd178309544dff1f7453e796a9437125bc0d9
    cd $WORK/meta-openembedded
    git checkout -b tmp 8ab04afbffb4bc5184cfe0655049de6f44269990
    
    cd $WORK/meta-renesas
    export PATCH_DIR=meta-rcar-gen3/docs/sample/patch/patch-for-linaro-gcc
    patch -p1 < ${PATCH_DIR}/0001-rcar-gen3-add-readme-for-building-with-Linaro-Gcc.patch
    unset PATCH_DIR
    
    cd $WORK/
    PKGS_DIR=$WORK/../proprietary
    cd $WORK/meta-renesas
    #sh meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh -f $PKGS_DIR
    sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $PKGS_DIR
    cd $WORK
    source poky/oe-init-build-env $WORK/build
    
    #cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/linaro-gcc/bsp/*.conf ./conf/.
    #cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/linaro-gcc/gfx-only/*.conf ./conf/.
    cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/linaro-gcc/mmp/*.conf ./conf/.
    
    cd $WORK/build
    cp conf/local-wayland.conf conf/local.conf
    echo "DISTRO_FEATURES_append = \" use_eva_pkg\"" >> $WORK/build/conf/local.conf
    
    echo "MACHINE_FEATURES_append = \" ${TARGET_BOARD}-kf\"" >>  $WORK/build/conf/local.conf
    
    bitbake core-image-weston
    
  3. build
    ./build.sh
    
    If the build completes successfully, all the necessary files are generated in a following directory:
    ./build/build/tmp/deploy/images/<target_board_name>
    

Build using manual steps

  1. Create a directory and switch to it
    Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.
    mkdir build
    cd build
    export WORK=`pwd`
    
  2. Clone basic Yocto layers:
    cd $WORK
    git clone git://git.yoctoproject.org/poky
    git clone git://git.linaro.org/openembedded/meta-linaro.git
    git clone git://git.openembedded.org/meta-openembedded
    git clone git://github.com/CogentEmbedded/meta-rcar.git meta-renesas -b v2.12.0
    git clone git://github.com/CogentEmbedded/meta-renesas-quick-start.git meta-renesas-quick-start -b bsp_v212
    
  3. Switch to proper branches/commits
    cd $WORK/poky
    git checkout -b tmp 40376446904ae3529be41737fed9a0b650ed167d
    cd $WORK/meta-linaro
    git checkout -b tmp 9b1fd178309544dff1f7453e796a9437125bc0d9
    cd $WORK/meta-openembedded
    git checkout -b tmp 8ab04afbffb4bc5184cfe0655049de6f44269990
    
    Another versions are not tested for compatibility.
    Legacy BSP instruction can be found here R-Car Kingfisher Yocto Gen3 legacy
  4. Apply Linaro-GCC patch file:
    cd $WORK/meta-renesas
    export PATCH_DIR=meta-rcar-gen3/docs/sample/patch/patch-for-linaro-gcc
    patch -p1 < ${PATCH_DIR}/0001-rcar-gen3-add-readme-for-building-with-Linaro-Gcc.patch
    unset PATCH_DIR
    
  5. Unzip downloaded proprietary driver modules to $WORK/proprietary folder.
    You should see the following files:
    $ ls -1 $WORK/proprietary/*.zip
    R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20160906.tar.gz
    R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20160906.tar.gz
    
  6. Populate meta-renesas with proprietary software packages.
    export PKGS_DIR=$WORK/proprietary
    cd $WORK/meta-renesas
    sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $PKGS_DIR
    unset PKGS_DIR
    
  7. Setup build environment
    cd $WORK
    source poky/oe-init-build-env $WORK/build
    
  8. Prepare default configuration files.
    # [m3ulcb]
    cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/m3ulcb/linaro-gcc/mmp/*.conf ./conf/
    # [h3ulcb]
    # cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/linaro-gcc/mmp/*.conf ./conf/
    cd $WORK/build
    cp conf/local-wayland.conf conf/local.conf
    
    NOTE: extra configuration examples are available in the following directory:
    $WORK/meta-rcar/meta-rcar-gen3-adas/docs/sample/conf/
    
  9. (Edit $WORK/build/conf/local.conf to enable/disable graphics and multimedia proprietary drivers support)
  10. Edit local.conf to choose machine extension variant
    # [m3ulcb]
    MACHINE_FEATURES_append = " m3ulcb-kf" (use this append for Kingfisher IO configuration)
    # [h3ulcb]
    # MACHINE_FEATURES_append = " h3ulcb-kf" (use this append for Kingfisher IO configuration)
    
  11. Edit local.conf with evaluation packages requirements:
    DISTRO_FEATURES_append = " use_eva_pkg"
    
  12. Add layer meta-rcar
    bitbake-layers add-layer ../meta-rcar/meta-rcar-gen3-adas
    
  13. Start the build
    bitbake core-image-weston
    
  14. Building image can take up to a few hours depending on your host system performance.
    After the build has been completed successfully, you should see the output similar to:
    NOTE: Tasks Summary: Attempted 4704 tasks of which 31 didn't need to be rerun and all succeeded.
    
    and the command prompt should return.
  15. Bitbake has generated all the necessary files in ./tmp/deploy/images directory.
    You can verify its content:
    $ ls -1 `find ./tmp/deploy/images/m3ulcb/ -maxdepth 1 -type l -print`
    ./tmp/deploy/images/m3ulcb/core-image-weston-m3ulcb.cpio.gz
    ./tmp/deploy/images/m3ulcb/core-image-weston-m3ulcb.ext4
    ./tmp/deploy/images/m3ulcb/core-image-weston-m3ulcb.manifest
    ./tmp/deploy/images/m3ulcb/core-image-weston-m3ulcb.tar.bz2
    ./tmp/deploy/images/m3ulcb/Image
    ./tmp/deploy/images/m3ulcb/Image-m3ulcb.bin
    ./tmp/deploy/images/m3ulcb/Image-r8a7796-m3ulcb-kf.dtb
    ./tmp/deploy/images/m3ulcb/modules-m3ulcb.tgz
    ./tmp/deploy/images/m3ulcb/u-boot.bin
    ./tmp/deploy/images/m3ulcb/u-boot-elf-m3ulcb.srec
    ./tmp/deploy/images/m3ulcb/u-boot-elf.srec
    ./tmp/deploy/images/m3ulcb/u-boot-m3ulcb.bin
    
    Image is a Kernel image, *.dtb is a blob file, core-image-weston-m3ulcb.tar.bz2 is the rootfs, modules-m3ulcb.tgz are kernel modules.
  16. You can now proceed with running Yocto images

Build SDK

  • After building BSP you may build SDK:
    bitbake core-image-weston -c populate_sdk
    
  • After build finished the SDK installation script may be found in following path:
    tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-toolchain-*.sh
    
  • Install SDK by run the following command and follow instructions on the screen:
    ./tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-toolchain-*.sh
    

Running Yocto images

Refer to Running Yocto images of Yocto-Gen3.
[NOTE]

DTB file for Kingfisher:
Image-r8a7795-h3ulcb-kf.dtb
Image-r8a7795-h3ulcb-4x2g-kf.dtb(*)
Image-r8a7796-m3ulcb-kf.dtb
(*) The "4x2g" means DDR8GiB SK board. Refer to H3 SK variation.

FAQ

Discussion site

http://elinux.org/Talk:R-Car/Boards/Yocto-Gen3