Difference between revisions of "R-Car/Boards/CCPF-SK/Yocto-Gen3/v5.1.0"

From eLinux.org
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{Template:R-Car-Gen3-Navbox}}
 
{{Template:R-Car-Gen3-Navbox}}
 
{{TOC right}}
 
{{TOC right}}
<!--
+
 
 
[[Category:R-Car]]
 
[[Category:R-Car]]
 
[[Category:R-Car Gen3]]
 
[[Category:R-Car Gen3]]
-->
 
  
 
== Introduction ==
 
== Introduction ==
Line 458: Line 457:
 
=== How to test some capabilities ===
 
=== How to test some capabilities ===
 
==== CAN ====
 
==== CAN ====
connect pin2 and pin6, pin3 and pin7
+
Ex.) loop back</br>
:[[File:CCPF-SK-CAN.png|350px]]
+
:connect pin2 and pin6, pin3 and pin7
<syntaxhighlight lang=bash>
+
::[[File:CCPF-SK-CAN.png|350px]]
 +
:<syntaxhighlight lang=bash>
 
root@h3ulcb:~# ip link set can0 up type can bitrate 125000
 
root@h3ulcb:~# ip link set can0 up type can bitrate 125000
 
root@h3ulcb:~# ip link set can1 up type can bitrate 125000
 
root@h3ulcb:~# ip link set can1 up type can bitrate 125000

Latest revision as of 21:33, 7 October 2021


Introduction

This page contains information abot building and running Yocto on:

If prebuilt binary of Yocto BSP is needed, please refer to the following:

Topic

The new version of R-Car Starter Kit Premier is now on sale !!

  • Equipped with R-Car H3e-2G
    (En) https://www.renesas.com/jp/en/about/press-room/renesas-launches-r-car-gen3e-20-percent-higher-cpu-speed-automotive-infotainment-cockpit-and-digital
    (Zh) https://www.renesas.com/jp/zh/about/press-room/renesas-launches-r-car-gen3e-20-percent-higher-cpu-speed-automotive-infotainment-cockpit-and-digital
    (Jp) https://www.renesas.com/jp/ja/about/press-room/renesas-launches-r-car-gen3e-20-percent-higher-cpu-speed-automotive-infotainment-cockpit-and-digital
  • CPU performance is increased 20% by supporting up to 2GHz frequency over past products.
  • You can buy from here.

SW Release Information

Board name SW name Release date Note
R-Car Starter Kit ( Premier / Pro ) Yocto v5.5.0 (latest) [New!!] 2021/10/01
Yocto v3.21.0 (stable) 2019/07/09 R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) is supported from 2020/07/10.
meta-renesas was updated on 2021/08/03.
Kingfisher Infotainment Board Yocto v5.5.0 (latest) [New!!] 2021/10/01 To check for latest information, please refer to the meta-rcar/tree/v5.5.0.
Yocto v3.21.0 (stable) 2019/08/07 To check for latest information, please refer to the meta-rcar/tree/v3.21.0.
R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) is supported from 2020/08/02.
meta-renesas was updated on 2021/08/03.
Android 10 (stable) [New!!] 2021/07/26 R-Car Starter Kit Premier(R-Car H3) + Kingfisher is supported.
R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) + Kingfisher is also supported from 2021/11/25.
Android P (stable) 2020/09/29 R-Car Starter Kit Premier(R-Car H3) + Kingfisher is supported.
R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) + Kingfisher is also supported from 2021/03/16.
CCPF-SK Board Yocto v5.1.0 (latest) [New!!] 2021/10/01 Prebuilt binary is availeble in Quick startup guide page.


Software revisions

Software Revision
Yocto Project 3.1.4
aarch64-poky-linux-gcc (GCC) 9.3
Wayland/Weston 1.18.0/8.0.0
GStreamer 1.16.3
Kernel Ver 5.10
Userland 64/32bit 64
U-Boot 2020.10
OP_TEE 3.8.0
OpenGL ES 3.2

Environment

Host PC

Ubuntu 18.04/20.04 LTS (64bit) is recommended as OS. 32bit version is not supported.

Confirmed Board

Board SoC Confirmed
R-Car Starter Kit Premier H3 v3.0 (1rank DDR) OK
R-Car Starter Kit Premier H3 v3.0 (2rank DDR) OK
R-Car Starter Kit Premier H3 v2.0 with 8GB DDR NT
R-Car Starter Kit Premier H3 v2.0 with 4GB DDR NT
R-Car Starter Kit Pro M3 v3.0 OK
R-Car Starter Kit Pro M3 v1.0 NT

Note Note: NT='Not Tested'

See also:

Required packages

  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:
    Download two files:
    • R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20210428.zip
    • R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20210428.zip

    Graphic drivers are required for Wayland. Multimedia drivers are optional.
  2. Install required packages
    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 python3-git python3-jinja2 libegl1-mesa \
    libsdl1.2-dev pylint3 xterm
    
    Refer to Yocto Project Quick Start for more information.

Building the BSP for CCPF-SK

What is different between "MMP" and "MMP-dist".

  • MMP is minimal BSP which contains GFX/MMP evaluation package.
  • MMP-dist is MMP + some additional packages(For debug, development, benchmark, and so on).
  • MMP-dist release package(core-image-weston-release) is distributed on R-Car/Boards/CCPF-SK/GettingStarted

MMP case

Using build script

  1. Directory Structure
    |--build.sh
    `--proprietary
       |--R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20210428.zip
       `--R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20210428.zip
    
  2. Build script(build.sh)
    #!/bin/bash
    
    BOARD_LIST=("h3ulcb" "m3ulcb")
    TARGET_BOARD=$1
    PROPRIETARY_DIR=`pwd`/proprietary
    WORK=`pwd`/${TARGET_BOARD}
    
    POKY_COMMIT=424296bf9bb4bae27febf91bce0118df09ce5fa1
    META_OE_COMMIT=f2d02cb71eaff8eb285a1997b30be52486c160ae
    META_RENESAS_COMMIT=fd8ab2bb1b5ca98483c6f4aecf09a85c4d6bc016
    META_RENESAS_CCPF_COMMIT=271d6501a777edc474f74716ddc3caa310da927d
    
    GFX_MMP_LIB=R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20210428.zip
    GFX_MMP_DRIVER=R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20210428.zip
    
    Usage () {
        echo "Usage: $0 \${TARGET_BOARD_NAME}"
        echo "BOARD_NAME list: "
        for i in ${BOARD_LIST[@]}; do echo "  - $i"; done
        echo "BUILD_DIR is $BUILD_TYPE"
        exit
    }
    
    # Check Param.
    if ! `IFS=$'\n'; echo "${BOARD_LIST[*]}" | grep -qx "${TARGET_BOARD}"`; then
        Usage
    fi
    
    mkdir -p ${WORK}
    cd ${WORK}
    
    # Clone basic Yocto layers in parallel
    git clone git://git.yoctoproject.org/poky &
    git clone git://git.openembedded.org/meta-openembedded &
    git clone git://github.com/renesas-rcar/meta-renesas &
    git clone git://github.com/renesas-rcar/meta-renesas-ccpf &
    
    # Wait for all clone operations
    wait
    
    # Switch to proper branches/commits
    cd ${WORK}/poky
    git checkout -b tmp ${POKY_COMMIT}
    cd ${WORK}/meta-openembedded
    git checkout -b tmp ${META_OE_COMMIT}
    cd ${WORK}/meta-renesas
    git checkout -b tmp ${META_RENESAS_COMMIT}
    cd ${WORK}/meta-renesas-ccpf
    git checkout -b tmp ${META_RENESAS_CCPF_COMMIT}
    
    # Apply patch
    cd ${WORK}
    curl -sO https://elinux.org/images/6/6a/Update-meta-rcar-for-Yv510-20210531.patch.zip
    unzip -qo Update-meta-rcar-for-Yv510-20210531.patch.zip
    cd ${WORK}/meta-renesas
    patch -p1 -N < ../Update-meta-rcar-for-Yv510-20210531.patch
    
    # Populate meta-renesas with proprietary software packages
    WORK_PROP_DIR=${WORK}/proprietary
    mkdir -p ${WORK_PROP_DIR}
    unzip -qo ${PROPRIETARY_DIR}/${GFX_MMP_LIB} -d ${WORK_PROP_DIR}
    unzip -qo ${PROPRIETARY_DIR}/${GFX_MMP_DRIVER} -d ${WORK_PROP_DIR}
    cd ${WORK}/meta-renesas
    sh meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh -f ${WORK_PROP_DIR}
    
    cd ${WORK}
    TEMPLATECONF=$PWD/meta-renesas-ccpf/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}-ccpf-sk/mmp/ \
        source poky/oe-init-build-env ${WORK}/build
    
    bitbake core-image-weston
    
  3. build
    ./build.sh <target_board_name>
    
    Note Note: target_board_name is "h3ulcb" or "m3ulcb".
    If the build completes successfully, all the necessary files are generated in a following directory:
    ./<target_board_name>/build/tmp/deploy/images/<target_board_name>
    

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.openembedded.org/meta-openembedded
    git clone git://github.com/renesas-rcar/meta-renesas
    git clone git://github.com/renesas-rcar/meta-renesas-ccpf
    
  3. Switch to proper branches/commits
    cd $WORK/poky
    git checkout -b tmp 424296bf9bb4bae27febf91bce0118df09ce5fa1
    cd $WORK/meta-openembedded
    git checkout -b tmp f2d02cb71eaff8eb285a1997b30be52486c160ae
    cd $WORK/meta-renesas
    git checkout -b tmp fd8ab2bb1b5ca98483c6f4aecf09a85c4d6bc016
    cd $WORK/meta-renesas-ccpf
    git checkout -b tmp 271d6501a777edc474f74716ddc3caa310da927d
    
    Another versions are not tested for compatibility.
  4. Apply patch to update meta-rcar(patch file: File:Update-meta-rcar-for-Yv510-20210531.patch.zip)
    cd ${WORK}
    curl -sO https://elinux.org/images/6/6a/Update-meta-rcar-for-Yv510-20210531.patch.zip
    unzip -qo Update-meta-rcar-for-Yv510-20210531.patch.zip
    cd ${WORK}/meta-renesas
    patch -N -p1 < ../Update-meta-rcar-for-Yv510-20210531.patch
    
  5. Create $WORK/../proprietary folder, then download proprietary driver modules to it.
    See also Required_packages
    You should see the following files:
    $ ls -1 $WORK/../proprietary/*.zip
    R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20210428.zip
    R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20210428.zip
    
  6. Populate meta-renesas with proprietary software packages.
    export PKGS_DIR=$WORK/../proprietary
    cd $PKGS_DIR
    unzip -qo R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20210428.zip 
    unzip -qo R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20210428.zip
    cd $WORK/meta-renesas
    sh meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh -f $PKGS_DIR
    unset PKGS_DIR
    
  7. Setup build environment
    cd $WORK
    TEMPLATECONF=$PWD/meta-renesas-ccpf/meta-rcar-gen3/docs/sample/conf/<h3ulcb|m3ulcb>-ccpf-sk/mmp/ \
        source poky/oe-init-build-env ${WORK}/build
    
  8. Start the build
    bitbake core-image-weston
    
  9. 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.
  10. Bitbake has generated all the necessary files in ./tmp/deploy/images directory.
    You can verify its content:
    bash $ ls -1 `find ./tmp/deploy/images/h3ulcb/ -maxdepth 1 -type l -print`
    ./tmp/deploy/images/h3ulcb/Image
    ./tmp/deploy/images/h3ulcb/Image-h3ulcb.bin
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.ext4
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.manifest
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.tar.bz2
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.testdata.json
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.wic.bmap
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.wic.xz
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.wic.xz.sha256sum
    ./tmp/deploy/images/h3ulcb/modules-h3ulcb.tgz
    ./tmp/deploy/images/h3ulcb/r8a77950-ulcb-h3ulcb.dtb
    ./tmp/deploy/images/h3ulcb/r8a77950-ulcb.dtb
    ./tmp/deploy/images/h3ulcb/r8a77951-ulcb-ccpf-sk-h3ulcb.dtb
    ./tmp/deploy/images/h3ulcb/r8a77951-ulcb-ccpf-sk.dtb
    ./tmp/deploy/images/h3ulcb/r8a77951-ulcb-h3ulcb.dtb
    ./tmp/deploy/images/h3ulcb/r8a77951-ulcb.dtb
    ./tmp/deploy/images/h3ulcb/r8a779m1-ulcb-h3ulcb.dtb
    ./tmp/deploy/images/h3ulcb/r8a779m1-ulcb.dtb
    ./tmp/deploy/images/h3ulcb/u-boot-elf-h3ulcb.srec
    ./tmp/deploy/images/h3ulcb/u-boot-h3ulcb.bin
    ./tmp/deploy/images/h3ulcb/u-boot-h3ulcb.bin-r8a7795_h3ulcb
    ./tmp/deploy/images/h3ulcb/u-boot-initial-env-h3ulcb-r8a7795_h3ulcb
    ./tmp/deploy/images/h3ulcb/u-boot-initial-env-r8a7795_h3ulcb
    ./tmp/deploy/images/h3ulcb/u-boot.bin
    ./tmp/deploy/images/h3ulcb/u-boot.bin-r8a7795_h3ulcb
    
    Image is a Kernel image, *.dtb is a blob file, core-image-<image_type>-<board_name>.tar.bz2 is the rootfs, modules-<board_name>.tgz are kernel modules.
  11. You can now proceed with running Yocto images

MMP-dist case

build script

  1. Build script(build.sh)
    #!/bin/bash
    
    BOARD_LIST=("h3ulcb" "m3ulcb")
    TARGET_BOARD=$1
    PROPRIETARY_DIR=`pwd`/proprietary
    WORK=`pwd`/${TARGET_BOARD}
    
    POKY_COMMIT=424296bf9bb4bae27febf91bce0118df09ce5fa1
    META_OE_COMMIT=f2d02cb71eaff8eb285a1997b30be52486c160ae
    META_RENESAS_COMMIT=fd8ab2bb1b5ca98483c6f4aecf09a85c4d6bc016
    META_RENESAS_CCPF_COMMIT=271d6501a777edc474f74716ddc3caa310da927d
    YOCTO_PROJECT_CODENAME="dunfell"
    META_BROWSER_COMMIT=157c2dcc26304edc2543e5f45e74daf70ef2b7a6 # m92
    META_CLANG_COMMIT=76c6751d721a4265e01bb71d8dc4fb46dca6602f
    META_PYTHON2_COMMIT=b901080cf57d9a7f5476ab4d96e56c30db8170a8
    
    GFX_MMP_LIB=R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20210428.zip
    GFX_MMP_DRIVER=R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20210428.zip
    
    Usage () {
        echo "Usage: $0 \${TARGET_BOARD_NAME}"
        echo "BOARD_NAME list: "
        for i in ${BOARD_LIST[@]}; do echo "  - $i"; done
        echo "BUILD_DIR is $BUILD_TYPE"
        exit
    }
    
    # Check Param.
    if ! `IFS=$'\n'; echo "${BOARD_LIST[*]}" | grep -qx "${TARGET_BOARD}"`; then
        Usage
    fi
    
    mkdir -p ${WORK}
    cd ${WORK}
    
    # Clone basic Yocto layers in parallel
    git clone git://git.yoctoproject.org/poky &
    git clone git://git.openembedded.org/meta-openembedded &
    git clone git://github.com/renesas-rcar/meta-renesas &
    git clone git://github.com/renesas-rcar/meta-renesas-ccpf &
    git clone git://github.com/OSSystems/meta-browser &
    git clone git://github.com/kraj/meta-clang -b ${YOCTO_PROJECT_CODENAME} &
    git clone git://git.openembedded.org/meta-python2 -b ${YOCTO_PROJECT_CODENAME} &
    
    # Wait for all clone operations
    wait
    
    # Switch to proper branches/commits
    cd ${WORK}/poky
    git checkout -b tmp ${POKY_COMMIT}
    cd ${WORK}/meta-openembedded
    git checkout -b tmp ${META_OE_COMMIT}
    cd ${WORK}/meta-renesas
    git checkout -b tmp ${META_RENESAS_COMMIT}
    cd ${WORK}/meta-renesas-ccpf
    git checkout -b tmp ${META_RENESAS_CCPF_COMMIT}
    cd ${WORK}/meta-browser
    git checkout -B tmp ${META_BROWSER_COMMIT}
    cd ${WORK}/meta-clang
    git checkout -B tmp ${META_CLANG_COMMIT}
    cd ${WORK}/meta-python2
    git checkout -B tmp ${META_PYTHON2_COMMIT}
    
    # Apply patch
    cd ${WORK}
    curl -sO https://elinux.org/images/6/6a/Update-meta-rcar-for-Yv510-20210531.patch.zip
    unzip -qo Update-meta-rcar-for-Yv510-20210531.patch.zip
    cd ${WORK}/meta-renesas
    patch -p1 -N < ../Update-meta-rcar-for-Yv510-20210531.patch
    
    # Populate meta-renesas with proprietary software packages
    WORK_PROP_DIR=${WORK}/proprietary
    mkdir -p ${WORK_PROP_DIR}
    unzip -qo ${PROPRIETARY_DIR}/${GFX_MMP_LIB} -d ${WORK_PROP_DIR}
    unzip -qo ${PROPRIETARY_DIR}/${GFX_MMP_DRIVER} -d ${WORK_PROP_DIR}
    cd ${WORK}/meta-renesas
    sh meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh -f ${WORK_PROP_DIR}
    
    cd ${WORK}
    rm -rf ${WORK}/build/conf
    TEMPLATECONF=$PWD/meta-renesas-ccpf/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}-ccpf-sk/mmp-dist/ \
        source poky/oe-init-build-env ${WORK}/build
    
    ulimit -n 8192
    
    bitbake core-image-weston
    
    ### For building binary package which is released on eLinux ###
    #cp -f ${WORK}/meta-renesas-ccpf/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}-ccpf-sk/mmp-dist/site.conf.sample \
    #    ${WORK}/build/conf/site.conf
    #bitbake core-image-weston-release
    

Note Note: Building mmp-dist release package(core-image-weston-release)

If it needs to build core-image-weston-release, please uncomment following code in build script.
core-image-weston-release: See also R-Car/Boards/CCPF-SK/Yocto-Gen3/v5.1.0#Building_the_BSP_for_CCPF-SK.
#cp -f ${WORK}/meta-renesas-ccpf/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}-ccpf-sk/mmp-dist/site.conf.sample \
#    ${WORK}/build/conf/site.conf
#bitbake core-image-weston-release
If the build completes successfully, all the necessary files are generated in a following directory:
./<target_board_name>/build/tmp/deploy/release/

Build SDK

Refer to Build SDK on the Yocto-Gen3 page.

Running Yocto images

Refer to Running Yocto images on the Yocto-Gen3 page.

Relationship diagram between each SK board and DTB file

Board name SoC version DTB file
H3SK 2.0/3.0 r8a77951-ulcb-ccpf-sk.dtb
M3SK 1.0 r8a77960-ulcb-ccpf-sk.dtb
M3SK 3.0 r8a77961-ulcb-ccpf-sk.dtb

S/W support status

Support list

Functions Status
CAN ok
USB2.0 ok
USB3.0 ok
HDMI1(only H3SK) ok
Camera 0 Not supported
Camera 1 Not supported
NVMe ok
S2RAM(Suspend to RAM) ok

Note:

"ok" - Function succeeded in the simple test as below.
"NT" - Function wasn't tested
Please connect USB 3.0 device to USB 3.0 port and USB2.0 device to USB 2.0 port.

How to test some capabilities

CAN

Ex.) loop back

connect pin2 and pin6, pin3 and pin7
CCPF-SK-CAN.png
root@h3ulcb:~# ip link set can0 up type can bitrate 125000
root@h3ulcb:~# ip link set can1 up type can bitrate 125000
root@h3ulcb:~# candump can0&
root@h3ulcb:~# cangen can1 -I i -L i -D i
(Ctrl+C)
root@h3ulcb:~# candump can1&
root@h3ulcb:~# cangen can0 -I i -L i -D i


NVMe

root@h3ulcb:~# dmesg | grep nvme
nvme nvme0: pci function 0000:01:00.0
nvme 0000:01:00.0: enabling device (0000 -> 0002)
nvme nvme1: pci function 0001:01:00.0
nvme 0001:01:00.0: enabling device (0000 -> 0002)
nvme nvme0: 8/0/0 default/read/poll queues
nvme nvme1: 8/0/0 default/read/poll queues
root@h3ulcb:~# mount /dev/nvme0n1p1 /mnt
EXT4-fs (nvme0n1p1): mounted filesystem with ordered data mode. Opts: (null)
root@h3ulcb:~# ls /mnt
root@h3ulcb:~# umount /mnt
root@h3ulcb:~# mount /dev/nvme1n1p1 /mnt
EXT4-fs (nvme1n1p1): mounted filesystem with ordered data mode. Opts: (null)
root@h3ulcb:~# ls /mnt
root@h3ulcb:~# umount /mnt

S2RAM

Push SW6 or execute 'systemctl suspend' to enter Suspend to RAM. it can wake-up by SW4.

Known issues and limitations

  1. Refer to R-Car/Boards/CCPF-SK#Known_Issues.
  2. Refer to R-Car/Boards/Yocto-Gen3/v5.1.0#Known_issues_and_limitations.


Q&A site

https://renesasrulz.com/r-car-h3-m3-cockpit/

FAQ site