R-Car/Boards/ADAS-View-Solution-Kit

From eLinux.org
< R-Car
Revision as of 14:50, 24 February 2017 by Cogente (talk | contribs)
Jump to: navigation, search

Introduction

This is the official Wiki for Renesas R-Car ADAS View Solution Kit.


Refer to R-Car Starter Kit Pro page
Refer to R-Car Starter Kit Premier page

Where to buy

TBD

ADAS View Solution Kit Documentation

TBD

System with LVDS cameras

TBD

Quick Start

Build image

First please visit R-Car Yocto Gen3 and perform necessary preparation steps 1-12. Then:

  1. Clone demo layer to allow support of ADAS applications
    git clone https://github.com/CogentEmbedded/meta-renesas-quick-start.git
    git checkout -b bsp_v212
    
  2. Add necessary layers to $WORK/build/conf/bblayers.conf
      ${TOPDIR}/../meta-openembedded/meta-networking \
      ${TOPDIR}/../meta-openembedded/meta-multimedia \
      ${TOPDIR}/../meta-renesas-quick-start \
    
  3. Add necessary features to $WORK/build/conf/local.conf
    DISTRO_FEATURES_append = " surroundview "
    DISTRO_FEATURES_append = " opencv-sdk "
    DISTRO_FEATURES_append = " wayland"
    
    
  4. Build and install image as it's described in [1] steps 13-16.
    bitbake core-image-weston
    

After all these steps you can start working with boards and apps.

Build SDK

After building image run this command to build SDK

bitbake core-image-weston -c populate_sdk

After build success the SDK installation script must appears in ./tmp/deploy/sdk directory:

 tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-toolchain-2.0.2.sh

To install SDK run this command and follow instructions on the screen:

./tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-toolchain-2.0.2.sh

Build scripts example

#!/bin/sh

mkdir build || exit
cd build
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


#cp $WORK/meta-renesas-quick-start/docs/sample/conf/m3ulcb/*.conf ./conf/.
#cp $WORK/meta-renesas-quick-start/docs/sample/conf/salvator-x/*.conf ./conf/.
#cp $WORK/meta-renesas-quick-start/docs/sample/conf/ttardrive/*.conf ./conf/.
cp $WORK/meta-renesas-quick-start/docs/sample/conf/h3ulcb/*.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

bitbake core-image-weston
bitbake core-image-weston -c populate_sdk

Flashing firmware

In case you have absolutely new R-Car H3 or M3 board, you need to update firmware. Please refer to page R-Car H3SK or R-Car M3SK for the instructions on flashing firmware.

U-Boot Environment

For using view board you need to use *-view.dtb file. The example of setting U-Boot environment for booting from SD card:

# In U-Boot prompt
setenv bootargs 'console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait consoleblank log_buf_len=1M'
setenv bootcmd 'ext4load mmc 0 48080000 /boot/Image; ext4load mmc 0 48000000 /boot/r8a7795-h3ulcb-view.dtb; booti 48080000 - 48000000'
saveenv

ADAS test applications

SurroundView GPU version

  1. Clone and build sv-utest application (see the README.md file as well):
    git clone https://github.com/CogentEmbedded/sv-utest.git
    cd sv-utest
    . <SDK_INSTALL_PATH>/environment-setup-aarch64-poky-linux 
    mkdir build
    cd build
    cmake -DSV_TARGET_PLATFORM=GEN3 ../
    make
    
  2. Copy the resulted binaries on rootfs. As example, for SD card:
    mkdir <mountpoint>/home/root/sv
    sudo cp sv-utest/bin/sv-utest <mountpoint>/usr/bin/
    sudo cp sv-utest/libs/gen3/libsv.so <mountpoint>/usr/lib/
    sudo cp -r sv-utest/resources/* <mountpoint>/home/root/sv/
    
  3. See the manual for instructions R-Car Surround View manual on how to run and use SurroundView application. In short:
    cd /home/root/sv
    sv-utest -v /dev/video0,/dev/video1,/dev/video2,/dev/video3 
    

SuroundView IMR version

  1. Save mesh object file from the GPU SurroundView: after calibartion and sphere adjusting are done, press S on the main 3d view to save mesh file. Mesh object file name is "meshFull.obj" in the current working directory of SurroundView.
  2. Clone and build imr-sv-utest application (see the README.md file as well):
    git clone https://github.com/CogentEmbedded/imr-sv-utest.git
    cd imr-sv-utest
    . <SDK_INSTALL_PATH>/environment-setup-aarch64-poky-linux 
    mkdir build
    cd build
    cmake -DIMR_TARGET_PLATFORM=GEN3 ../
    make
    

    IMR SuroundView executable stored ../bin directory.

  3. It's need to generate png files with car model images before running IMR SurroundView. Copy executable "gen" from "prebuilt/GEN3" directory to the H3 board. Example of generation png files with car (avalaible only for Gen3):
    ./gen -w <width> -h <height> -c <color> -o <path to store> -s <positions> -m <car object> \
    -l <car length> -S <shadow rectangle> -d <debug>
    ./gen -w 1920 -h 1080  -c 0x404040FF -o ./data/model -s 8:32:8 -m Car.obj -l 1.0  -S -0.2:-0.10:0.2:0.10
    
  4. Run the IMR SurroundView with the generated png files:
    ./imr-wl -f uyvy -v /dev/video0,/dev/video1,/dev/video2,/dev/video3 -w 1280 -h 800 -W 1920 -H 1080 \
    	-r /dev/video4,/dev/video5,/dev/video6,/dev/video7,/dev/video4,/dev/video5,/dev/video6,/dev/video7 -m ./data/model \
           -M meshFull.obj -X 1920 -Y 1080 -S -0.30:-0.10:0.30:0.10 -g 1.0 -s 8:32:8
    

    Run "./imr-wl -h" for options explanation.

8 Camera Demo (GPU + IMR version)

TBD