Difference between revisions of "R-Car/Boards/Yocto-Gen3-ADAS"

From eLinux.org
Jump to: navigation, search
(V3x Windows SDK instructions)
(88 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
* [[R-Car/Boards/H3SK | Renesas R-Car-H3 Starter Kit Premier]] (unofficial name - H3ULCB), see https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/r-car-starter-kit.html
 
* [[R-Car/Boards/H3SK | Renesas R-Car-H3 Starter Kit Premier]] (unofficial name - H3ULCB), see https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/r-car-starter-kit.html
 
* [[R-Car/Boards/ADAS-View-Solution-Kit | ADAS View Solution Kit]] (unofficial name - H3ULCB.View), see details here: https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/adas-view-solution-kit.html
 
* [[R-Car/Boards/ADAS-View-Solution-Kit | ADAS View Solution Kit]] (unofficial name - H3ULCB.View), see details here: https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/adas-view-solution-kit.html
* [[R-Car/Boards/H3SK-HAD | HAD Solution Kit]] (unofficial name - H3 H3ULCB.HAD), see https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/had-solution-kit.html
+
* [[R-Car/Boards/HAD-Solution-Kit | HAD Solution Kit]] (unofficial name - H3 H3ULCB.HAD), see https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/had-solution-kit.html
 
* [[R-Car/Boards/M3SK | Renesas R-Car-M3 Starter Kit Pro]] (unofficial name - M3ULCB) https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/r-car-starter-kit.html
 
* [[R-Car/Boards/M3SK | Renesas R-Car-M3 Starter Kit Pro]] (unofficial name - M3ULCB) https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/r-car-starter-kit.html
 
* [[R-Car/Boards/M3SK-View | Renesas R-Car-M3 M3ULCB.View]] boards.
 
* [[R-Car/Boards/M3SK-View | Renesas R-Car-M3 M3ULCB.View]] boards.
 +
* [[R-Car/Boards/Kingfisher | Kingfisher Infotainment Board]].
 +
* [[R-Car/Boards/Videobox | Videobox Infotainment Board]].
 +
* [[R-Car/Boards/Eagle | Renesas R-Car-V3M Eagle Evaluation Board]].
 +
* [[R-Car/Boards/V3MSK | Renesas R-Car-V3M Starter Kit Board]].
 +
* [[R-Car/Boards/Condor | Renesas R-Car-V3H Condor Evaluation Board]].
 +
* [[R-Car/Boards/V3HSK | Renesas R-Car-V3H Starter Kit Board]].
  
 
'''NOTE: USE OFFICIAL DOCUMENTATION provided with R-Car BSPs FOR Renesas ADAS boards'''
 
'''NOTE: USE OFFICIAL DOCUMENTATION provided with R-Car BSPs FOR Renesas ADAS boards'''
 
== Yocto versions ==
 
== Yocto versions ==
[http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-2.1.2 Poky-2.1.2] is supported. Specific commit of meta-openembedded is required.
+
[http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-2.1.3 Poky-2.1.3] is supported with Yocto v2.23.1 <br/>
 +
[http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-2.4.2 Poky-2.4.2] is supported with Yocto v3.9.0 <br/>
 +
[http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-2.4.3 Poky-2.4.3] is supported with Yocto v3.13.0, v3.15.0, v3.19.0, and 3.21.0 <br/>
 +
Specific commit of meta-openembedded is required.
  
 
== Preliminary steps ==
 
== Preliminary steps ==
Line 23: Line 32:
 
</li>
 
</li>
  
<li> Install required packages
+
<li> Install required packages <br/>
===== Ubuntu and Debian =====
+
<br/>
 +
Ubuntu and Debian
 
<pre>
 
<pre>
 
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
 
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
     build-essential chrpath socat libsdl1.2-dev xterm python-crypto
+
     build-essential chrpath socat libsdl1.2-dev xterm python-crypto cpio python python3 \
 +
    python3-pip python3-pexpect xz-utils debianutils iputils-ping libssl-dev
 
</pre>
 
</pre>
===== Fedora =====
+
Fedora
 
<pre>
 
<pre>
 
sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
 
sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
 
     diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
 
     diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
 
     ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat \
 
     ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat \
     SDL-devel xterm
+
     SDL-devel xterm python-crypto cpio python python3 python3-pip python3-pexpect \
 +
    ghc-lzma-conduit iputils openssl
 
</pre>
 
</pre>
 
Refer to [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html#packages Yocto Project Quick Start] for more information.
 
Refer to [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html#packages Yocto Project Quick Start] for more information.
Line 40: Line 52:
 
</ol>
 
</ol>
  
== Building the BSP for Renesas Salvator-X.View H3/M3, H3ULCB, H3ULCB.View, H3ULCB.HAD, M3ULCB, M3ULCB.View ==
+
== Building the BSP for Renesas ADAS boards ==
 
<ol>
 
<ol>
 
<li>Create a directory and switch to it <br/>
 
<li>Create a directory and switch to it <br/>
Line 65: Line 77:
 
<ol>
 
<ol>
 
<li>
 
<li>
For Yocto v2.19.0
+
For Yocto v2.23.1
 
<pre>
 
<pre>
 
cd $WORK/poky
 
cd $WORK/poky
git checkout -b tmp yocto-2.1.2
+
git checkout -b tmp yocto-2.1.3
 
cd $WORK/meta-openembedded
 
cd $WORK/meta-openembedded
 
git checkout -b tmp 55c8a76da5dc099a7bc3838495c672140cedb78e
 
git checkout -b tmp 55c8a76da5dc099a7bc3838495c672140cedb78e
Line 74: Line 86:
 
git checkout -b tmp 2f51d38048599d9878f149d6d15539fb97603f8f
 
git checkout -b tmp 2f51d38048599d9878f149d6d15539fb97603f8f
 
cd $WORK/meta-renesas
 
cd $WORK/meta-renesas
git checkout -b tmp 95cb48ba09bc7e55fd549817e3e26723409e68d5
+
git checkout -b tmp 7acbf5e2f99c59478adbc73c6a40d314589a3009
 +
</pre>
 +
 
 +
For BSPv1:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v2.23.1 dd06e952c5efab2914849b703a94f8b5e63bec86
 +
</pre>
 +
For BSPv2:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v2.23.1 6e20109305ec77801f98e3a5e720ccbf507dc738
 +
</pre>
 +
For BSPv3:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v2.23.1 ccb06bb38ecd0907867b8f81ef610c5bfefd02ab
 +
</pre>
 +
[[File:Rn 3.0 base 20181017.pdf]]
 +
</li>
 +
<li>
 +
For Yocto v3.9.0
 +
<pre>
 +
cd $WORK/poky
 +
git checkout -b tmp 342fbd6a3e57021c8e28b124b3adb241936f3d9d
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp dacfa2b1920e285531bec55cd2f08743390aaf57
 +
cd $WORK/meta-linaro
 +
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
 +
cd $WORK/meta-renesas
 +
git checkout -b tmp fd078b6ece537d986852cb827bd21e022a797b2f
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.9.0 remotes/origin/v3.9.0
 +
</pre>
 +
 
 +
For BSPv4:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.9.0-release4 4dc3c67469b5dc53d2e33f966eb8043e47087d0a
 +
</pre>
 +
[[File:Rn 4.0 base 20181120.pdf|thumb]]
 +
</li>
 +
<li>
 +
For Yocto v3.13.0
 +
<pre>
 +
cd $WORK/poky
 +
git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
 +
cd $WORK/meta-linaro
 +
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
 +
cd $WORK/meta-renesas
 +
git checkout -b tmp 00f70f062aace04c051fa92d3cd7b887718fc313
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.13.0 remotes/origin/v3.13.0
 +
</pre>
 +
</li>
 +
<li>
 +
For Yocto v3.15.0
 +
<pre>
 +
cd $WORK/poky
 +
git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
 +
cd $WORK/meta-linaro
 +
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
 +
cd $WORK/meta-renesas
 +
git checkout -b tmp 8af0b7d6e445b532088a068dc012757001be3a1f
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.15.0 remotes/origin/v3.15.0
 +
</pre>
 +
</li>
 +
<li>
 +
For Yocto v3.19.0
 +
<pre>
 +
cd $WORK/poky
 +
git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
 +
cd $WORK/meta-linaro
 +
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
 +
cd $WORK/meta-renesas
 +
git checkout -b tmp 20fcc94a8d05eda80250f27e87aaa3cfc3275300
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.19.0 remotes/origin/v3.19.0
 +
</pre>
 +
 
 +
For BSPv5:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.19.0-release5 remotes/origin/v3.19.0-release5
 +
</pre>
 +
[[File:Rn 5.0.1 base.pdf|Release 5 Notes]]
 +
 
 +
For BSPv5.0.2:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.19.0-release5.0.2 remotes/origin/v3.19.0-release5.0.2
 +
</pre>
 +
Prebuild binaries of v5.0.2: (https://www2.renesas.eu/products/micro/download/?oc=Y-R-CAR_V3x_LINUX_BSP#packageInfo)[https://www2.renesas.eu/products/micro/download/?oc=Y-R-CAR_V3x_LINUX_BSP#packageInfo]
 +
</li>
 +
<li>
 +
For Yocto v3.21.0
 +
<pre>
 +
cd $WORK/poky
 +
git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
 +
cd $WORK/meta-linaro
 +
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
 +
cd $WORK/meta-renesas
 +
git checkout -b tmp ad3a8cfee5b6a6fab17cf1c6e5af851eaec75bd7
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.21.0 remotes/origin/v3.21.0
 +
</pre>
 +
 
 +
For BSPv6:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.21.0-release6 remotes/origin/v3.21.0-release6
 +
</pre>
 +
[[File:Rn 6.0 base.pdf|Release 6 Notes]]
 +
 
 +
 
 +
For BSPv6.0:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.21.0-release6 1d61dac2ab213cf0e05e2ec97ddae6c66bcfe533
 +
</pre>
 +
 
 +
For BSPv6.0.1:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.21.0-release6 9cbf72851424d19cb733469796a0812086e7307d
 +
</pre>
 +
 
 +
For BSPv6.0.2:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.21.0-release6 f2dfd93d926e67897c6b558d68e5b0f8742ced19
 +
</pre>
 +
 
 +
</li>
 +
 
 +
<li>
 +
For Yocto v4.1.0
 +
<pre>
 +
cd $WORK/poky
 +
git checkout -b tmp 5e1f52edb7a9f790fb6cb5d96502f3690267c1b1
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp 9e60d30669a2ad0598e9abf0cd15ee06b523986b
 +
cd $WORK/meta-renesas
 +
git checkout -b tmp f6ccae7cfb669937aac221ff5cb6a13b36eff951
 
cd $WORK/meta-rcar
 
cd $WORK/meta-rcar
git checkout -b v2.19.0 remotes/origin/v2.19.0
+
git checkout -b v4.1.0 remotes/origin/v4.1.0
 
</pre>
 
</pre>
 +
 +
For BSPv7:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v4.1.0-release7 remotes/origin/v4.1.0-release7
 +
</pre>
 +
 +
For BSPv7.0.0-rc2:
 +
<pre>
 +
cd $WORK/meta-rcar
 +
git checkout -b v4.1.0-release7 b79be678e648a485c8db5eff47c9945337e79d63
 +
</pre>
 +
[[File:rn_7.0.0.pdf|Release 7.0.0 Notes]]
 +
 
</li>
 
</li>
 +
 
</ol>
 
</ol>
 
Another versions are not tested for compatibility.
 
Another versions are not tested for compatibility.
 
Legacy BSP instruction can be found here [[R-Car/Boards/Yocto-Gen3-legacy | R-Car Yocto Gen3 legacy]]
 
Legacy BSP instruction can be found here [[R-Car/Boards/Yocto-Gen3-legacy | R-Car Yocto Gen3 legacy]]
 
</li>
 
</li>
 
 
<li>
 
<li>
Apply Linaro-GCC patch file:
+
Apply patches:
 +
<ol>
 +
<li>
 +
Prepare ''PATCH_DIR'' environment variable:
 +
<pre>
 +
export PATCH_DIR=$WORK/meta-rcar/meta-rcar-gen3-adas/docs/sample/patch
 +
</pre>
 +
</li>
 +
<li>
 +
Mandatory step for Yocto v2.23.1 (not needed for v3.9.0 or later).
 +
Git repository of ca-certification package moved to another location.
 +
This patch changes to right mirror:
 +
<pre>
 +
cd $WORK/poky
 +
patch -p1 < ${PATCH_DIR}/0004-ca-certificates-git-repo-moved-to-another-location.patch
 +
</pre>
 +
</li>
 +
<li>
 +
Optional step only for Yocto v2.23.1 (not needed for v3.9.0 or later).
 +
Apply Linaro-GCC patch file and patches for out of network build ability:
 
<pre>
 
<pre>
 
cd $WORK/meta-renesas
 
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
 
patch -p1 < ${PATCH_DIR}/0001-rcar-gen3-add-readme-for-building-with-Linaro-Gcc.patch
 +
cd $WORK/meta-linaro
 +
patch -p1 < ${PATCH_DIR}/0001-meta-linaro-python-wand-fix-BB_NO_NETWORK-build.patch
 +
cd $WORK/meta-renesas
 +
patch -p1 < ${PATCH_DIR}/0002-meta-renesas-gstreamer-fix-BB_NO_NETWORK-build.patch
 +
cd $WORK/poky
 +
patch -p1 < ${PATCH_DIR}/0003-poky-bitbake-gitsm-fix-BB_NO_NETWORK-build.patch
 +
</pre>
 +
</li>
 +
<li>
 +
Optional step only for Yocto v3.9.0. Host GCC 8.2 and GLIBC 2.27 support:
 +
<pre>
 +
cd $WORK/poky
 +
patch -p1 < ${PATCH_DIR}/0001-uninative-Add-allow-shlib-undefined-to-BUILD_LDFLAGS.patch
 +
patch -p1 < ${PATCH_DIR}/0002-uninative-Add-compatiblity-version-check.patch
 +
</pre>
 +
</li>
 +
<li>
 +
Unset ''PATCH_DIR'' when all necessary patches are applied:
 +
<pre>
 
unset PATCH_DIR
 
unset PATCH_DIR
 
</pre>
 
</pre>
 
</li>
 
</li>
 +
</ol>
 
<li>
 
<li>
 
Download proprietary driver modules to $WORK/proprietary folder.<br/>
 
Download proprietary driver modules to $WORK/proprietary folder.<br/>
Line 98: Line 314:
 
<ol>
 
<ol>
 
<li>
 
<li>
For Yocto v2.19.0
+
For Yocto v2.23.1
 
<pre>
 
<pre>
 
$ ls -1 $WORK/proprietary
 
$ ls -1 $WORK/proprietary
R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20170427.zip
+
R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20170828.zip
R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20170427.zip
+
R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20170828.zip
 +
</pre>
 +
</li>
 +
<li>
 +
For Yocto v3.9.0
 +
<pre>
 +
$ ls -1 $WORK/proprietary/*.zip
 +
R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20180627.zip
 +
R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20180627.zip
 +
</pre>
 +
</li>
 +
<li>
 +
For Yocto v3.13.0
 +
<pre>
 +
$ ls -1 $WORK/proprietary/*.zip
 +
R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20181029.zip
 +
R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20181029.zip
 +
</pre>
 +
</li>
 +
<li>
 +
For Yocto v3.15.0
 +
<pre>
 +
$ ls -1 $WORK/proprietary/*.zip
 +
R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20181225.zip
 +
R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20181225.zip
 +
</pre>
 +
</li>
 +
<li>
 +
For Yocto v3.19.0
 +
<pre>
 +
$ ls -1 $WORK/proprietary/*.zip
 +
R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20190507.zip
 +
R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20190507.zip
 +
</pre>
 +
</li>
 +
<li>
 +
For Yocto v3.21.0
 +
<pre>
 +
$ ls -1 $WORK/proprietary/*.zip
 +
R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20190722.zip
 +
R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20190722.zip
 
</pre>
 
</pre>
 
</li>
 
</li>
Line 128: Line 384:
 
<li>
 
<li>
 
Prepare default configuration files.
 
Prepare default configuration files.
 +
<ol>
 +
<li>
 +
For Yocto v2.23.1
 
<pre>
 
<pre>
 
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/<salvator-x|h3ulcb|m3ulcb>/linaro-gcc/mmp/*.conf ./conf/
 
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/<salvator-x|h3ulcb|m3ulcb>/linaro-gcc/mmp/*.conf ./conf/
Line 133: Line 392:
 
cp conf/local-wayland.conf conf/local.conf
 
cp conf/local-wayland.conf conf/local.conf
 
</pre>
 
</pre>
 
<li>
 
Edit $WORK/build/conf/local.conf to enable/disable graphics and multimedia proprietary drivers support
 
 
</li>
 
</li>
 
 
<li>
 
<li>
Edit local.conf to choose machine extension variant
+
For Yocto v3.9.0 or later
</li>
 
 
 
'''For H3ULCB board only:'''<br />
 
 
 
<ol>
 
<li>
 
Edit local.conf to select IO configuration (by default only H3ULCB board peripherals are enabled):
 
 
<pre>
 
<pre>
MACHINE_FEATURES_append = " h3ulcb-view" (use this append for View IO configuration)
+
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/<h3ulcb|m3ulcb>/poky-gcc/mmp/*.conf ./conf/
</pre>
+
cd $WORK/build
or
+
cp conf/local-wayland.conf conf/local.conf
<pre>
 
MACHINE_FEATURES_append = " h3ulcb-had" (use this append for HAD IO configuration)
 
</pre>
 
or
 
<pre>
 
MACHINE_FEATURES_append = " h3ulcb-kf" (use this append for Kingfisher IO configuration)
 
 
</pre>
 
</pre>
 
</li>
 
</li>
 
</ol>
 
</ol>
 
+
NOTE: ADAS configuration examples are available in the following directory:
'''For Salvator-X board only:'''<br />
 
 
 
<ol>
 
<li>
 
Edit local.conf to select IO configuration (by default only Salvator-X board peripherals are enabled):
 
 
<pre>
 
<pre>
MACHINE_FEATURES_append = " salvator-x-view" (use this append for View IO configuration)
+
$WORK/meta-rcar/meta-rcar-gen3-adas/docs/sample/conf/
SOC_FAMILY = "r8a7796" (make this change only for M3 Salvator-X, since the default is H3 Salvator-X)
 
 
</pre>
 
</pre>
 
</li>
 
</li>
</ol>
+
<li>
 
+
Edit $WORK/build/conf/local.conf to enable/disable graphics and multimedia proprietary drivers support
 
</li>
 
</li>
  
'''For M3ULCB board only:'''<br />
+
<li>
 
+
Edit local.conf to choose machine extension variant
 +
<br />'''For ULCB ADAS boards only:'''
 
<ol>
 
<ol>
 
<li>
 
<li>
Edit local.conf to select IO configuration (by default only M3ULCB board peripherals are enabled):
+
Edit local.conf to select special IO configuration:
 
<pre>
 
<pre>
MACHINE_FEATURES_append = " m3ulcb-view" (use this append for View IO configuration)
+
MACHINE_FEATURES_append = " h3ulcb-had" (use this append for ADAS HAD IO configuration)
</pre>
 
or
 
<pre>
 
MACHINE_FEATURES_append = " m3ulcb-kf" (use this append for Kingfisher IO configuration)
 
 
</pre>
 
</pre>
 
</li>
 
</li>
 
</ol>
 
</ol>
 
 
 
</li>
 
</li>
  
Line 197: Line 428:
 
<ol>
 
<ol>
 
<li>
 
<li>
For Yocto v2.16.0 (to enable EVA_ prefix during packages install)
+
For Yocto v2.23.1 and later (to enable EVA_ prefix during packages install)
 
<pre>
 
<pre>
 
DISTRO_FEATURES_append = " use_eva_pkg"
 
DISTRO_FEATURES_append = " use_eva_pkg"
Line 203: Line 434:
 
</li>
 
</li>
 
</ol>
 
</ol>
 +
</li>
 +
 +
<li>
 +
Add layer meta-rcar (if not present in sample bblayers.conf - e.g. not needed for BSPv7) <br/>
 +
<pre>
 +
bitbake-layers add-layer ../meta-rcar/meta-rcar-gen3-adas
 +
</pre>
 
</li>
 
</li>
  
 
<li>
 
<li>
 
Start the build <br />
 
Start the build <br />
 +
<ol>
 +
<li> R-Car Gen3 boards with GPU support:
 
<pre>
 
<pre>
 
bitbake core-image-weston
 
bitbake core-image-weston
 
</pre>
 
</pre>
 
</li>
 
</li>
 
+
<li> R-Car Gen3 V3x boards with no GPU support:
 +
<pre>
 +
bitbake core-image-minimal
 +
</pre>
 +
</li>
 +
</ol>
 
<li>
 
<li>
 
Building image can take up to a few hours depending on your host system performance.<br>
 
Building image can take up to a few hours depending on your host system performance.<br>
Line 232: Line 477:
 
./tmp/deploy/images/h3ulcb/Image
 
./tmp/deploy/images/h3ulcb/Image
 
./tmp/deploy/images/h3ulcb/Image-h3ulcb.bin
 
./tmp/deploy/images/h3ulcb/Image-h3ulcb.bin
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb
+
./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb-had-alfa.dtb
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-had.dtb
+
./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb-had-beta.dtb
 +
./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb-kf.dtb
 +
./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb-view.dtb
 +
./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb-vb.dtb
 +
./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb.dtb
 +
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-had-alfa.dtb
 +
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-had-beta.dtb
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-kf.dtb
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-kf.dtb
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-view.dtb
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-view.dtb
 +
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-vb.dtb
 +
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb
 
./tmp/deploy/images/h3ulcb/modules-h3ulcb.tgz
 
./tmp/deploy/images/h3ulcb/modules-h3ulcb.tgz
 
./tmp/deploy/images/h3ulcb/u-boot.bin
 
./tmp/deploy/images/h3ulcb/u-boot.bin
Line 245: Line 498:
 
</li>
 
</li>
 
<li>
 
<li>
You can now proceed with running Yocto images
+
You can now proceed with running Yocto images:
 +
<ol>
 +
<li>
 +
For View ADAS Starter Kit board:
 +
<pre>
 +
Image-es1-r8a7795-h3ulcb-view.dtb
 +
Image-r8a7795-h3ulcb-view.dtb
 +
</pre>
 +
</li>
 +
<li>
 +
For HAD ADAS board:
 +
<pre>
 +
Image-es1-r8a7795-h3ulcb-had-alfa.dtb
 +
Image-es1-r8a7795-h3ulcb-had-beta.dtb
 +
Image-r8a7795-h3ulcb-had-alfa.dtb
 +
Image-r8a7795-h3ulcb-had-beta.dtb
 +
</pre>
 +
</li>
 +
<li>
 +
For ULCB [[R-Car/Boards/Kingfisher | Kingfisher ]] ADAS boards:
 +
<pre>
 +
Image-r8a7795-es1-h3ulcb-kf.dtb
 +
Image-r8a7795-h3ulcb-kf.dtb
 +
Image-r8a7796-m3ulcb-kf.dtb
 +
</pre>
 +
<ul>
 +
<li>
 +
Yocto v2.23.1:
 +
<pre>
 +
Image-r8a7797-es1-v3msk-kf.dtb
 +
Image-r8a7797-v3msk-kf.dtb
 +
</pre>
 +
</li>
 +
<li>
 +
Yocto v3.9.0, v3.19.0, v3.21.0:
 +
<pre>
 +
Image-r8a7795-h3ulcb-4x2g-kf.dtb
 +
Image-r8a77965-m3nulcb-kf.dtb
 +
Image-r8a77970-es1-v3msk-kf.dtb
 +
Image-r8a77970-v3msk-kf.dtb
 +
</pre>
 +
</li>
 +
</ul>
 +
</li>
 +
<li>
 +
For Videobox ADAS board:
 +
<pre>
 +
Image-es1-r8a7795-h3ulcb-vb.dtb
 +
Image-r8a7795-h3ulcb-vb.dtb
 +
</pre>
 +
</li>
 +
<li>
 +
For V3M Eagle board:
 +
<ul>
 +
<li>
 +
Yocto v2.23.1:
 +
<pre>
 +
Image-r8a7797-es1-eagle.dtb
 +
Image-r8a7797-eagle.dtb
 +
</pre>
 +
</li>
 +
<li>
 +
Yocto v3.9.0, v3.19.0, 3.21.0:
 +
<pre>
 +
Image-r8a77970-es1-eagle.dtb
 +
Image-r8a77970-eagle.dtb
 +
</pre>
 +
</li>
 +
</ul>
 +
</li>
 +
<li>
 +
For V3M Starter Kit board:
 +
<ul>
 +
<li>
 +
Yocto v2.23.1:
 +
<pre>
 +
Image-r8a7797-es1-v3msk.dtb
 +
Image-r8a7797-v3msk.dtb
 +
</pre>
 +
</li>
 +
<li>
 +
Yocto v3.9.0, v3.19.0, 3.21.0:
 +
<pre>
 +
Image-r8a77970-es1-v3msk.dtb
 +
Image-r8a77970-v3msk.dtb
 +
</pre>
 +
</li>
 +
</ul>
 +
</li>
 +
<li>
 +
For V3H Condor board:
 +
<ul>
 +
<li>
 +
Yocto v2.23.1:
 +
<pre>
 +
Image-r8a7798-condor.dtb
 +
</pre>
 +
</li>
 +
<li>
 +
Yocto v3.9.0, v3.19.0, 3.21.0:
 +
<pre>
 +
Image-r8a77980-condor.dtb
 +
</pre>
 +
</li>
 +
</ul>
 +
</li>
 +
<li>
 +
For V3H Starter Kit board:
 +
<ul>
 +
<li>
 +
Yocto v2.23.1:
 +
<pre>
 +
Image-r8a7798-v3hsk.dtb
 +
</pre>
 +
</li>
 +
<li>
 +
Yocto v3.9.0, v3.19.0, 3.21.0:
 +
<pre>
 +
Image-r8a77980-v3hsk.dtb
 +
</pre>
 +
</li>
 +
</ul>
 
</li>
 
</li>
 +
</ol>
 +
<li>
 +
NOTES:
 +
* prefix -es1- is a blob to be used with ws1.0/ws1.1 silicon. The blob without prefix is for ws2.0 silicon.
 +
* v3.9.0 and later supports m3nulcb board along with the h3ulcb-4x2g board variant.
 +
</li>
 +
 
</ol>
 
</ol>
 +
 +
==OpenCV support==
 +
 +
OpenCV version 2.4.11 is enabled in build by default on Yocto v2.23.1
 +
OpenCV version 3.2 is enabled in build by default on Yocto v3.9.0 or later
 +
To disable Opencv add this line in your local.conf:
 +
<pre>
 +
DISTRO_FEATURES_remove = " opencv-sdk "
 +
</pre>
 +
To build with OpenCV 3.2, don't add the previous line, but provide preffered version 3.2 in local.conf:
 +
<pre>
 +
PREFERRED_VERSION_opencv = "3.2+git%"
 +
</pre>
 +
 +
==OpenCL support==
 +
 +
The following page describes how to enable OpenCL and Caffe support:
 +
[[R-Car/Boards/Yocto-Gen3/OpenCL]]
 +
 +
== Build SDK ==
 +
After building BSP you may build SDK:
 +
<ol>
 +
<li> R-Car Gen3 boards with GPU support:
 +
<pre>
 +
bitbake core-image-weston -c populate_sdk
 +
</pre>
 +
</li>
 +
<li> R-Car Gen3 V3x boards with no GPU support (Linux SDK):
 +
<pre>
 +
bitbake core-image-minimal -c populate_sdk
 +
</pre>
 +
</li>
 +
<li> R-Car Gen3 V3x boards with no GPU support (Windows SDK):
 +
<ol>
 +
<li> Checkout appropriate meta-mingw layer:
 +
<pre>
 +
cd $WORK
 +
git clone git://git.yoctoproject.org/meta-mingw
 +
cd meta-mingw
 +
git checkout -b <branch> origin/<branch>
 +
</pre>
 +
Branch to be used:
 +
{| class="wikitable"
 +
|-
 +
! Yovto version !! Branch name
 +
|-
 +
| v3.21.0 (BSPv6) || rocko
 +
|-
 +
| v4.1.0 (BSPv7) || zeus
 +
|}
 +
</li>
 +
<li> Remove nativesdk-perl from SDK packagegroup to avoid build failures.
 +
Add following lines to meta-mingw/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend:
 +
<pre>
 +
RDEPENDS_${PN}_remove_mingw32 = "\
 +
    nativesdk-perl \
 +
    nativesdk-perl-dev \
 +
    nativesdk-perl-modules \
 +
"
 +
</pre>
 +
</li>
 +
<li> Build Windows SDK archive:
 +
<pre>
 +
SDKMACHINE="x86_64-mingw32" bitbake core-image-minimal -c populate_sdk
 +
</pre>
 +
</li>
 +
<li> Windows SDK may need to be re-packed using 'zip' or 'tar' to de-reference symbolic links.<br>
 +
For tar:<br>
 +
<ol>
 +
<li> Cleanup unpacked SDK to avoid broken and cyclic symlinks:
 +
<pre>
 +
cd <SDK unpack folder>
 +
rf sysroots/aarch64-poky-linux/usr/include/gphoto2/gphoto2
 +
rm `find . -xtype l`
 +
</pre>
 +
</li>
 +
<li> Create compressed SDK tarball with dereferenced symlinks:
 +
<pre>
 +
cd <SDK unpack folder>
 +
tar hJcf <new SDK archive path and name>.tar.xz *
 +
</pre>
 +
</li>
 +
</ol>
 +
</li>
 +
</ol>
 +
</li>
 +
</ol>
 +
After build finished the SDK installation script may be found in following path:
 +
<pre>
 +
tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-toolchain-*.sh
 +
</pre>
 +
Install SDK by run the following command and follow instructions on the screen:
 +
<pre>
 +
./tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-toolchain-*.sh
 +
</pre>
 +
 +
== Build BSP without network ==
 +
Supported only in Ycoto v2.23.1 yet.<br/>
 +
After building BSP you may archive gits and download cache and proceed developing without network.<br/>
 +
Make sure that build that you completed online included all patches from step#4 of http://elinux.org/R-Car/Boards/Yocto-Gen3-ADAS#Building_the_BSP_for_Renesas_ADAS_boards<br/>
 +
Archive the following folders:
 +
<pre>
 +
cd $WORK/build
 +
tar cfj bsp.v2.23.1.tar.bz2 meta-linaro meta-openembedded meta-rcar meta-renesas poky build/downloads
 +
</pre>
 +
Unpack archive on machine without network access and proceed building starting from step#5 of http://elinux.org/R-Car/Boards/Yocto-Gen3-ADAS#Building_the_BSP_for_Renesas_ADAS_boards<br/>
 +
Before step #13 add this option to local.conf: BB_NO_NETWORK=1
 +
<pre>
 +
mkdir build
 +
cd build
 +
tar xfj <path_to_archive>/bsp.v2.23.1.tar.bz2
 +
</pre>
  
 
== Running Yocto images ==
 
== Running Yocto images ==
Line 291: Line 784:
  
 
<li>
 
<li>
Copy '''Image''' and '''Image-r8a7795-h3ulcb.dtb''' from $WORK/build/tmp/deploy/images/h3ulcb/ to TFTP server root.
+
Copy Image and Image-r8a7795-h3ulcb.dtb (for ws2.0 silicon) and/or Image-r8a7795-es1-h3ulcb.dtb (for ws1.1) from $WORK/build/tmp/deploy/images/h3ulcb/ to TFTP server root.  
 
==== Ubuntu ====
 
==== Ubuntu ====
 
<pre>
 
<pre>
Line 608: Line 1,101:
  
 
Proper U-Boot command to boot from SD:
 
Proper U-Boot command to boot from SD:
  # setenv bootargs 'rw root=/dev/mmcblk1p1 rootfstype=ext3 rootwait'
+
  # setenv bootargs 'rw root=/dev/mmcblk1p1 rootfstype=ext3 rootwait consoleblank=0 log_buf_len=1M'
 
  # ext2load mmc 0:1 0x48080000 /boot/Image
 
  # ext2load mmc 0:1 0x48080000 /boot/Image
 
  # ext2load mmc 0:1 0x48000000 /boot/Image-r8a7795-h3ulcb.dtb
 
  # ext2load mmc 0:1 0x48000000 /boot/Image-r8a7795-h3ulcb.dtb
Line 663: Line 1,156:
 
<li> Build preparation
 
<li> Build preparation
 
<ol>
 
<ol>
<li> For Yocto v2.16.0
+
<li> For Yocto v2.23.1
 +
<pre>
 +
#!/bin/sh
 +
 
 +
mkdir sources || exit
 +
cd sources
 +
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/renesas-rcar/meta-renesas.git
 +
git clone git://github.com/CogentEmbedded/meta-rcar.git
 +
 
 +
cd $WORK/poky
 +
git checkout -b tmp yocto-2.1.3
 +
cd $WORK/meta-linaro
 +
git checkout -b tmp 2f51d38048599d9878f149d6d15539fb97603f8f
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp 55c8a76da5dc099a7bc3838495c672140cedb78e
 +
cd $WORK/meta-renesas
 +
git checkout -b tmp 7acbf5e2f99c59478adbc73c6a40d314589a3009
 +
cd $WORK/meta-rcar
 +
git checkout -b v2.23.1-release3 remotes/origin/v2.23.1-release3
 +
 
 +
cd $WORK/poky
 +
export PATCH_DIR=${WORK}/meta-rcar/meta-rcar-gen3-adas/docs/sample/patch
 +
patch -p1 < ${PATCH_DIR}/0004-ca-certificates-git-repo-moved-to-another-location.patch
 +
unset PATCH_DIR
 +
</pre>
 +
</li>
 +
<li> For Yocto v3.9.0
 +
<pre>
 +
#!/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/renesas-rcar/meta-renesas
 +
git clone git://github.com/CogentEmbedded/meta-rcar.git
 +
 
 +
cd $WORK/poky
 +
git checkout -b tmp 342fbd6a3e57021c8e28b124b3adb241936f3d9d
 +
cd $WORK/meta-linaro
 +
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp dacfa2b1920e285531bec55cd2f08743390aaf57
 +
cd $WORK/meta-renesas
 +
git checkout -b tmp fd078b6ece537d986852cb827bd21e022a797b2f
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.9.0 remotes/origin/v3.9.0
 +
 
 +
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
 +
</pre>
 +
</li>
 +
<li> For Yocto v3.13.0
 +
<pre>
 +
#!/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/renesas-rcar/meta-renesas
 +
git clone git://github.com/CogentEmbedded/meta-rcar.git
 +
 
 +
cd $WORK/poky
 +
git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
 +
cd $WORK/meta-linaro
 +
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
 +
cd $WORK/meta-renesas
 +
git checkout -b tmp 00f70f062aace04c051fa92d3cd7b887718fc313
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.13.0 remotes/origin/v3.13.0
 +
 
 +
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
 +
</pre>
 +
</li>
 +
<li> For Yocto v3.15.0
 
<pre>
 
<pre>
 
#!/bin/sh
 
#!/bin/sh
Line 675: Line 1,266:
 
git clone git://git.linaro.org/openembedded/meta-linaro.git
 
git clone git://git.linaro.org/openembedded/meta-linaro.git
 
git clone git://git.openembedded.org/meta-openembedded
 
git clone git://git.openembedded.org/meta-openembedded
git clone git://github.com/CogentEmbedded/meta-rcar.git meta-renesas -b v2.16.0
+
git clone git://github.com/renesas-rcar/meta-renesas
 +
git clone git://github.com/CogentEmbedded/meta-rcar.git
  
 
cd $WORK/poky
 
cd $WORK/poky
git checkout -b tmp yocto-2.1.2
+
git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
 
cd $WORK/meta-linaro
 
cd $WORK/meta-linaro
git checkout -b tmp 2f51d38048599d9878f149d6d15539fb97603f8f
+
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
 +
cd $WORK/meta-renesas
 +
git checkout -b tmp 8af0b7d6e445b532088a068dc012757001be3a1f
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.15.0 remotes/origin/v3.15.0
 +
 
 +
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
 +
</pre>
 +
</li>
 +
<li> For Yocto v3.19.0
 +
<pre>
 +
#!/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/renesas-rcar/meta-renesas
 +
git clone git://github.com/CogentEmbedded/meta-rcar.git
 +
 
 +
cd $WORK/poky
 +
git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
 
cd $WORK/meta-openembedded
 
cd $WORK/meta-openembedded
git checkout -b tmp 55c8a76da5dc099a7bc3838495c672140cedb78e
+
git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
 +
cd $WORK/meta-linaro
 +
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
 +
cd $WORK/meta-renesas
 +
git checkout -b tmp 20fcc94a8d05eda80250f27e87aaa3cfc3275300
 +
cd $WORK/meta-rcar
 +
git checkout -b v3.19.0 remotes/origin/v3.19.0
 +
 
 +
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
 +
</pre>
 +
</li>
 +
<li> For Yocto v3.21.0
 +
<pre>
 +
#!/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/renesas-rcar/meta-renesas
 +
git clone git://github.com/CogentEmbedded/meta-rcar.git
  
 +
cd $WORK/poky
 +
git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
 +
cd $WORK/meta-openembedded
 +
git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
 +
cd $WORK/meta-linaro
 +
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
 
cd $WORK/meta-renesas
 
cd $WORK/meta-renesas
export PATCH_DIR=meta-rcar-gen3/docs/sample/patch/patch-for-linaro-gcc
+
git checkout -b tmp ad3a8cfee5b6a6fab17cf1c6e5af851eaec75bd7
patch -p1 < ${PATCH_DIR}/0001-rcar-gen3-add-readme-for-building-with-Linaro-Gcc.patch
+
cd $WORK/meta-rcar
unset PATCH_DIR
+
git checkout -b v3.21.0 remotes/origin/v3.21.0
  
 
cd $WORK/
 
cd $WORK/
Line 699: Line 1,356:
 
</li>
 
</li>
  
<li> Building yocto for H3ULCB.View board
+
<li> Building yocto
 +
<ol>
 +
<li> For Yocto v2.23.1
 +
<pre>
 +
#!/bin/sh
 +
 
 +
case "$1" in
 +
"eagle" | "v3hsk" | "v3msk" | "condor")
 +
    echo "Use build configuration for $1 board"
 +
    ;;
 +
*)
 +
    echo "Provide board name. Supported boards: eagle, v3hsk, v3msk, condor."
 +
    exit -1
 +
    ;;
 +
esac
 +
 
 +
BOARD=$1
 +
 
 +
cd sources || exit -1
 +
 
 +
WORK=`pwd`
 +
echo $WORK
 +
 
 +
cd $WORK
 +
source poky/oe-init-build-env
 +
 
 +
cp $WORK/meta-rcar/meta-rcar-gen3-adas/docs/sample/conf/$BOARD/linaro-gcc/bsp/*.conf ./conf/.
 +
 
 +
echo "The build directory is $(pwd) "
 +
 
 +
bitbake-layers add-layer ../meta-rcar/meta-rcar-gen3-adas
 +
 
 +
bitbake core-image-minimal
 +
bitbake core-image-minimal -c populate_sdk
 +
</pre>
 +
</li>
 +
</ol>
 
<ol>
 
<ol>
<li> For Yocto v2.16.0
+
<li> For Yocto v3.9.0 or later
 
<pre>
 
<pre>
 
#!/bin/sh
 
#!/bin/sh
Line 712: Line 1,405:
 
source poky/oe-init-build-env
 
source poky/oe-init-build-env
  
#cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/linaro-gcc/bsp/*.conf ./conf/.
+
# R-Car Gen3 ADAS boards
#cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/linaro-gcc/gfx-only/*.conf ./conf/.
+
#cp $WORK/meta-rcar/meta-rcar-gen3-adas/docs/sample/conf/condor/poky-gcc/bsp/*.conf ./conf/.
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/linaro-gcc/mmp/*.conf ./conf/.
+
 
 +
# R-Car Gen3 boards
 +
#cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/poky-gcc/bsp/*.conf ./conf/.
 +
#cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/poky-gcc/gfx-only/*.conf ./conf/.
 +
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/poky-gcc/mmp/*.conf ./conf/.
  
 
cd $WORK/build
 
cd $WORK/build
 
cp conf/local-wayland.conf conf/local.conf
 
cp conf/local-wayland.conf conf/local.conf
 
echo "DISTRO_FEATURES_append = \" use_eva_pkg\"" >> $WORK/build/conf/local.conf
 
echo "DISTRO_FEATURES_append = \" use_eva_pkg\"" >> $WORK/build/conf/local.conf
 +
# uncomment for ADAS HAD board only:
 +
#echo "MACHINE_FEATURES_append = \" h3ulcb-had\"" >> $WORK/build/conf/local.conf
  
echo "MACHINE_FEATURES_append = \" h3ulcb-view\"" >> $WORK/build/conf/local.conf
+
bitbake-layers add-layer ../meta-rcar/meta-rcar-gen3-adas
  
 +
# R-Car Gen3 boards
 
bitbake core-image-weston
 
bitbake core-image-weston
 +
bitbake core-image-weston -c populate_sdk
 +
 +
# R-Car Gen3 V3x boards
 +
#bitbake core-image-minimal
 +
#bitbake core-image-minimal -c populate_sdk
 +
 
</pre>
 
</pre>
 +
</li>
 +
</ol>
 +
 
</li>
 
</li>
  
 
</ol>
 
</ol>
 +
 +
== 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/Boards/H3SK |R-Car H3SK]] or [[R-Car/Boards/M3SK |R-Car M3SK]] for the instructions
 +
on flashing firmware.
 +
 +
== CMA (contiguous memory allocator) ==
 +
'''Available in BSPv3 and later versions only'''
 +
 +
For V3M and V3H based boards (Eagle, Condor, V3MSK and V3HSK) size of default CMA area
 +
used by generic Linux drivers (such as VIN, USB, etc.) and MMNGR driver
 +
(to allocate contiguous buffers on user-space e.g. for IMP and IMR) can be adjusted
 +
using standard 'cma' command line option.
 +
See 'Documentation/kernel-parameters.txt' file in Linux kernel source code for details.
 +
Default size of the CMA memory on these boards is 256Mb.
 +
 +
On other Gen3 boards CMA default area is defined in device tree.
 +
To adjust it's size device tree source need to be modified and rebuilt.
 +
 +
== ADAS test applications ==
 +
=== SurroundView GPU version ===
 +
<ol>
 +
<li>
 +
Clone and build sv-utest application (see the README.md file as well):
 +
<pre>
 +
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
 +
</pre>
 +
</li>
 +
<li>
 +
Copy the resulted binaries on rootfs. As example, for SD card:
 +
<pre>
 +
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/
 +
</pre>
 
</li>
 
</li>
 +
<li>
 +
See the manual for instructions [https://github.com/CogentEmbedded/sv-utest/blob/master/docs/cogente_sv_manual_public.pdf R-Car Surround View manual] on how to run and use SurroundView application. In short:
 +
<pre>
 +
cd /home/root/sv
 +
sv-utest -v /dev/video0,/dev/video1,/dev/video2,/dev/video3
 +
</pre>
 +
</li>
 +
<li>
 +
By default 1280x800 resolution is used for cameras, but you can change it with --camres option:
 +
<pre>
 +
sv-utest -v /dev/video0,/dev/video1,/dev/video2,/dev/video3 --camres 1280x1080
 +
</pre>
 +
</li>
 +
</ol>
  
 +
=== SurroundView IMR version ===
 +
<ol>
 +
<li>
 +
Save mesh object file from the GPU SurroundView: after calibartion and sphere adjusting are done, press S, then "=" on the main 3d view to save mesh file.
 +
Mesh object file name is "meshFull.obj" in the current working directory of SurroundView.
 +
</li>
 +
<li>
 +
Clone and build imr-sv-utest application (see the README.md file as well):
 +
<pre>
 +
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
 +
</pre>
 +
IMR SuroundView executable stored ../bin directory.
 +
</li>
 +
<li>
 +
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):
 +
<pre>
 +
./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
 +
</pre>
 +
</li>
 +
<li>
 +
Run the IMR SurroundView with the generated png files:
 +
For 4-cameras environment:
 +
<pre>
 +
./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
 +
</pre>
 +
For 8-cameras environment:
 +
<pre>
 +
./imr-wl -f uyvy -v /dev/video0,/dev/video1,/dev/video2,/dev/video3 -w 1280 -h 800 -W 1920 -H 1080 \
 +
-r /dev/video8,/dev/video9,/dev/video10,/dev/video11,/dev/video8,/dev/video9,/dev/video10,/dev/video11 -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
 +
</pre>
 +
Run "./imr-wl -h" for options explanation.
 +
</li>
 +
</ol>
 +
 +
=== 8 Camera Demo (GPU + IMR version) ===
 +
Demo application demonstrates surround view with pre-defined viewpoints on Renesas boards
 +
with 4 additional cameras for mirror replacement purposes. First additional camera works
 +
as driver monitor.
 +
 +
<ol>
 +
<li>
 +
Save mesh object file from the GPU SurroundView: after calibartion and sphere adjusting are done, press S, then "=" on the main 3d view to save mesh file.
 +
Mesh object file name is "meshFull.obj" in the current working directory of SurroundView.
 +
</li>
 +
<li>
 +
Clone and build 8-cam-imr-gpu-sv-utest application (see the README.md file as well):
 +
<pre>
 +
git clone https://github.com/CogentEmbedded/8-cam-imr-gpu-sv-utest.git
 +
cd 8-cam-imr-gpu-sv-utest
 +
. <SDK_INSTALL_PATH>/environment-setup-aarch64-poky-linux
 +
mkdir build
 +
cd build
 +
cmake ../
 +
make
 +
</pre>
 +
Demo executable "sc" stored ../bin directory.
 +
</li>
 +
<li>
 +
It's need to generate png files with car model images before running IMR SurroundView. Copy executable "gen" from "prebuilt/" directory
 +
to the H3 board.
 +
Example of generation png files with car (avalaible only for Gen3):
 +
<pre>
 +
./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
 +
</pre>
 +
</li>
 +
<li>
 +
Copy resources files to directory where application will be runned from "resources/".
 +
Copy libdrivermonitor.so and libsv.so from "lib/" directory to rootfs.
 +
Copy "resources/adas-utest" directory to /usr/share on rootfs.
 +
</li>
 +
<li>
 +
Run the application:
 +
<pre>
 +
./sc -W 1920 -H 1080 -m ./data/model -M meshFull.obj -X 1920 -Y 1080 -g 1.0 -b 0x000000 -c config.txt -S -0.20:-0.1:0.20:0.1 -s 8:32:8
 +
</pre>
 +
</li>
 +
<li>
 +
To control application with SpaceNav start SpaceNav daemon: spacenavd command.
 +
There are 5 widgets on the main screen: main 3d SurroundView screen, DriverMonitor camera,
 +
right, left and rear mirror replacement cameras.
 +
 +
To change focus on widget press right button on SpaceNav.
 +
To change zoom and view on mirror replacement cameras rotate SpaceNav joystick, when widget is in focus.
 +
To hide Driver Monitor camera and mirror cameras press and hold left button on joystick, when widget is in focus.
 +
To switch to IMR demo press left button on SpaceNav joystick, when main 3d SurroundView in focus.
 +
To get back from IMR demo press left button again.
 +
To rotate view in IMR demo use joystick or touchscreen.
 +
 +
</li>
 +
 +
</ol>
 +
 +
=== Camera demo for VIN-IMR-DRM capture pipe ===
 +
Unit test application demonstrates IMR-DRM usage on systems that have no GPU (r8a7797). <br/>
 +
The test application name is 'utest-cam-imr-drm'. The unit test is provided in sources and built within yocto.
 +
<ol>
 +
<li>
 +
The unit test is located on rootfs for core-image-minimal build (tested on V3MSK).<br/>
 +
To launch the application issue the following command with 4 cameras connected:
 +
<pre>
 +
$ utest-cam-imr-drm
 +
</pre>
 +
</li>
 +
</ol>
 +
NOTE: unit test assumes use of 4 cameras at resolution 1280x1080 <br/>
 +
To use other then 4 amount of cameras, then modify CAMERAS_NUMBER definition in source code (meta-rcar/meta-rcar-gen3-adas/recipes-bsp/utest-apps/files/utest-cam-imr-drm.tar.gz) <br/>
 +
To use other resolution use parameters 'h' and 'w':
 +
<pre>
 +
$ utest-cam-imr-drm -w 1280 -h 800
 +
</pre>
 +
 +
=== Camera low level tests ===
 +
It is possible to run low level tests to validate LVDS cameras. <br>
 +
The test application name is 'capture'. The 'capture' is provided in sources and build within yocto.
 +
<ol>
 +
<li>
 +
The test examples are located on rootfs path:
 +
<pre>
 +
$ ls -1 /usr/share/tests/
 +
test_lvds_2cameras_on_display1920x1080.sh
 +
test_lvds_4cameras_on_display1920x1080.sh
 +
test_lvds_8cameras_on_display1920x1080.sh
 +
test_lvds_camera_0-3.sh
 +
test_lvds_camera_0.sh
 +
test_lvds_camera_4-7.sh
 +
test_lvds_camera_4.sh
 +
</pre>
 +
</li>
 
</ol>
 
</ol>
  
 
== Known issues and limitations ==
 
== Known issues and limitations ==
 
TBD
 
TBD

Revision as of 08:32, 29 October 2020

This page contains information on building and running Yocto on:

NOTE: USE OFFICIAL DOCUMENTATION provided with R-Car BSPs FOR Renesas ADAS boards

Yocto versions

Poky-2.1.3 is supported with Yocto v2.23.1
Poky-2.4.2 is supported with Yocto v3.9.0
Poky-2.4.3 is supported with Yocto v3.13.0, v3.15.0, v3.19.0, and 3.21.0
Specific commit of meta-openembedded is required.

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/en-us/solutions/automotive/rcar-demoboard.html

    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 Renesas ADAS boards

  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://git.linaro.org/openembedded/meta-linaro.git
    git clone git://github.com/renesas-rcar/meta-renesas
    git clone git://github.com/CogentEmbedded/meta-rcar.git
    
  3. Switch to proper branches/commits
    1. For Yocto v2.23.1
      cd $WORK/poky
      git checkout -b tmp yocto-2.1.3
      cd $WORK/meta-openembedded
      git checkout -b tmp 55c8a76da5dc099a7bc3838495c672140cedb78e
      cd $WORK/meta-linaro
      git checkout -b tmp 2f51d38048599d9878f149d6d15539fb97603f8f
      cd $WORK/meta-renesas
      git checkout -b tmp 7acbf5e2f99c59478adbc73c6a40d314589a3009
      

      For BSPv1:

      cd $WORK/meta-rcar
      git checkout -b v2.23.1 dd06e952c5efab2914849b703a94f8b5e63bec86
      

      For BSPv2:

      cd $WORK/meta-rcar
      git checkout -b v2.23.1 6e20109305ec77801f98e3a5e720ccbf507dc738
      

      For BSPv3:

      cd $WORK/meta-rcar
      git checkout -b v2.23.1 ccb06bb38ecd0907867b8f81ef610c5bfefd02ab
      

      File:Rn 3.0 base 20181017.pdf

    2. For Yocto v3.9.0
      cd $WORK/poky
      git checkout -b tmp 342fbd6a3e57021c8e28b124b3adb241936f3d9d
      cd $WORK/meta-openembedded
      git checkout -b tmp dacfa2b1920e285531bec55cd2f08743390aaf57
      cd $WORK/meta-linaro
      git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
      cd $WORK/meta-renesas
      git checkout -b tmp fd078b6ece537d986852cb827bd21e022a797b2f
      cd $WORK/meta-rcar
      git checkout -b v3.9.0 remotes/origin/v3.9.0
      

      For BSPv4:

      cd $WORK/meta-rcar
      git checkout -b v3.9.0-release4 4dc3c67469b5dc53d2e33f966eb8043e47087d0a
      

      File:Rn 4.0 base 20181120.pdf

    3. For Yocto v3.13.0
      cd $WORK/poky
      git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
      cd $WORK/meta-openembedded
      git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
      cd $WORK/meta-linaro
      git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
      cd $WORK/meta-renesas
      git checkout -b tmp 00f70f062aace04c051fa92d3cd7b887718fc313
      cd $WORK/meta-rcar
      git checkout -b v3.13.0 remotes/origin/v3.13.0
      
    4. For Yocto v3.15.0
      cd $WORK/poky
      git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
      cd $WORK/meta-openembedded
      git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
      cd $WORK/meta-linaro
      git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
      cd $WORK/meta-renesas
      git checkout -b tmp 8af0b7d6e445b532088a068dc012757001be3a1f
      cd $WORK/meta-rcar
      git checkout -b v3.15.0 remotes/origin/v3.15.0
      
    5. For Yocto v3.19.0
      cd $WORK/poky
      git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
      cd $WORK/meta-openembedded
      git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
      cd $WORK/meta-linaro
      git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
      cd $WORK/meta-renesas
      git checkout -b tmp 20fcc94a8d05eda80250f27e87aaa3cfc3275300
      cd $WORK/meta-rcar
      git checkout -b v3.19.0 remotes/origin/v3.19.0
      

      For BSPv5:

      cd $WORK/meta-rcar
      git checkout -b v3.19.0-release5 remotes/origin/v3.19.0-release5
      

      File:Rn 5.0.1 base.pdf

      For BSPv5.0.2:

      cd $WORK/meta-rcar
      git checkout -b v3.19.0-release5.0.2 remotes/origin/v3.19.0-release5.0.2
      

      Prebuild binaries of v5.0.2: (https://www2.renesas.eu/products/micro/download/?oc=Y-R-CAR_V3x_LINUX_BSP#packageInfo)[1]

    6. For Yocto v3.21.0
      cd $WORK/poky
      git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
      cd $WORK/meta-openembedded
      git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
      cd $WORK/meta-linaro
      git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
      cd $WORK/meta-renesas
      git checkout -b tmp ad3a8cfee5b6a6fab17cf1c6e5af851eaec75bd7
      cd $WORK/meta-rcar
      git checkout -b v3.21.0 remotes/origin/v3.21.0
      

      For BSPv6:

      cd $WORK/meta-rcar
      git checkout -b v3.21.0-release6 remotes/origin/v3.21.0-release6
      

      File:Rn 6.0 base.pdf


      For BSPv6.0:

      cd $WORK/meta-rcar
      git checkout -b v3.21.0-release6 1d61dac2ab213cf0e05e2ec97ddae6c66bcfe533
      

      For BSPv6.0.1:

      cd $WORK/meta-rcar
      git checkout -b v3.21.0-release6 9cbf72851424d19cb733469796a0812086e7307d
      

      For BSPv6.0.2:

      cd $WORK/meta-rcar
      git checkout -b v3.21.0-release6 f2dfd93d926e67897c6b558d68e5b0f8742ced19
      
    7. For Yocto v4.1.0
      cd $WORK/poky
      git checkout -b tmp 5e1f52edb7a9f790fb6cb5d96502f3690267c1b1
      cd $WORK/meta-openembedded
      git checkout -b tmp 9e60d30669a2ad0598e9abf0cd15ee06b523986b
      cd $WORK/meta-renesas
      git checkout -b tmp f6ccae7cfb669937aac221ff5cb6a13b36eff951
      cd $WORK/meta-rcar
      git checkout -b v4.1.0 remotes/origin/v4.1.0
      

      For BSPv7:

      cd $WORK/meta-rcar
      git checkout -b v4.1.0-release7 remotes/origin/v4.1.0-release7
      

      For BSPv7.0.0-rc2:

      cd $WORK/meta-rcar
      git checkout -b v4.1.0-release7 b79be678e648a485c8db5eff47c9945337e79d63
      

      File:Rn 7.0.0.pdf

    Another versions are not tested for compatibility. Legacy BSP instruction can be found here R-Car Yocto Gen3 legacy

  4. Apply patches:
    1. Prepare PATCH_DIR environment variable:
      export PATCH_DIR=$WORK/meta-rcar/meta-rcar-gen3-adas/docs/sample/patch
      
    2. Mandatory step for Yocto v2.23.1 (not needed for v3.9.0 or later). Git repository of ca-certification package moved to another location. This patch changes to right mirror:
      cd $WORK/poky
      patch -p1 < ${PATCH_DIR}/0004-ca-certificates-git-repo-moved-to-another-location.patch
      
    3. Optional step only for Yocto v2.23.1 (not needed for v3.9.0 or later). Apply Linaro-GCC patch file and patches for out of network build ability:
      cd $WORK/meta-renesas
      patch -p1 < ${PATCH_DIR}/0001-rcar-gen3-add-readme-for-building-with-Linaro-Gcc.patch
      cd $WORK/meta-linaro
      patch -p1 < ${PATCH_DIR}/0001-meta-linaro-python-wand-fix-BB_NO_NETWORK-build.patch
      cd $WORK/meta-renesas
      patch -p1 < ${PATCH_DIR}/0002-meta-renesas-gstreamer-fix-BB_NO_NETWORK-build.patch
      cd $WORK/poky
      patch -p1 < ${PATCH_DIR}/0003-poky-bitbake-gitsm-fix-BB_NO_NETWORK-build.patch
      
    4. Optional step only for Yocto v3.9.0. Host GCC 8.2 and GLIBC 2.27 support:
      cd $WORK/poky
      patch -p1 < ${PATCH_DIR}/0001-uninative-Add-allow-shlib-undefined-to-BUILD_LDFLAGS.patch
      patch -p1 < ${PATCH_DIR}/0002-uninative-Add-compatiblity-version-check.patch
      
    5. Unset PATCH_DIR when all necessary patches are applied:
      unset PATCH_DIR
      
  5. Download proprietary driver modules to $WORK/proprietary folder.
    You should see the following files:
    1. For Yocto v2.23.1
      $ ls -1 $WORK/proprietary
      R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20170828.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20170828.zip
      
    2. For Yocto v3.9.0
      $ ls -1 $WORK/proprietary/*.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20180627.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20180627.zip
      
    3. For Yocto v3.13.0
      $ ls -1 $WORK/proprietary/*.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20181029.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20181029.zip
      
    4. For Yocto v3.15.0
      $ ls -1 $WORK/proprietary/*.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20181225.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20181225.zip
      
    5. For Yocto v3.19.0
      $ ls -1 $WORK/proprietary/*.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20190507.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20190507.zip
      
    6. For Yocto v3.21.0
      $ ls -1 $WORK/proprietary/*.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20190722.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20190722.zip
      
  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
    
  8. Prepare default configuration files.
    1. For Yocto v2.23.1
      cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/<salvator-x|h3ulcb|m3ulcb>/linaro-gcc/mmp/*.conf ./conf/
      cd $WORK/build
      cp conf/local-wayland.conf conf/local.conf
      
    2. For Yocto v3.9.0 or later
      cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/<h3ulcb|m3ulcb>/poky-gcc/mmp/*.conf ./conf/
      cd $WORK/build
      cp conf/local-wayland.conf conf/local.conf
      

    NOTE: ADAS 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
    For ULCB ADAS boards only:
    1. Edit local.conf to select special IO configuration:
      MACHINE_FEATURES_append = " h3ulcb-had" (use this append for ADAS HAD IO configuration)
      
  11. Edit local.conf with evaluation packages requirements:
    1. For Yocto v2.23.1 and later (to enable EVA_ prefix during packages install)
      DISTRO_FEATURES_append = " use_eva_pkg"
      
  12. Add layer meta-rcar (if not present in sample bblayers.conf - e.g. not needed for BSPv7)
    bitbake-layers add-layer ../meta-rcar/meta-rcar-gen3-adas
    
  13. Start the build
    1. R-Car Gen3 boards with GPU support:
      bitbake core-image-weston
      
    2. R-Car Gen3 V3x boards with no GPU support:
      bitbake core-image-minimal
      
  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/h3ulcb/ -maxdepth 1 -type l -print`
    ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.cpio.gz
    ./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/Image
    ./tmp/deploy/images/h3ulcb/Image-h3ulcb.bin
    ./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb-had-alfa.dtb
    ./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb-had-beta.dtb
    ./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb-kf.dtb
    ./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb-view.dtb
    ./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb-vb.dtb
    ./tmp/deploy/images/h3ulcb/Image-es1-r8a7795-h3ulcb.dtb
    ./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-had-alfa.dtb
    ./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-had-beta.dtb
    ./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-kf.dtb
    ./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-view.dtb
    ./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-vb.dtb
    ./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb
    ./tmp/deploy/images/h3ulcb/modules-h3ulcb.tgz
    ./tmp/deploy/images/h3ulcb/u-boot.bin
    ./tmp/deploy/images/h3ulcb/u-boot-elf-h3ulcb.srec
    ./tmp/deploy/images/h3ulcb/u-boot-elf.srec
    ./tmp/deploy/images/h3ulcb/u-boot-h3ulcb.bin
    

    Image is a Kernel image, *.dtb is a blob file, core-image-weston-h3ulcb.tar.bz2 is the rootfs, modules-h3ulcb.tgz are kernel modules.

  16. You can now proceed with running Yocto images:
    1. For View ADAS Starter Kit board:
      Image-es1-r8a7795-h3ulcb-view.dtb
      Image-r8a7795-h3ulcb-view.dtb
      
    2. For HAD ADAS board:
      Image-es1-r8a7795-h3ulcb-had-alfa.dtb
      Image-es1-r8a7795-h3ulcb-had-beta.dtb
      Image-r8a7795-h3ulcb-had-alfa.dtb
      Image-r8a7795-h3ulcb-had-beta.dtb
      
    3. For ULCB Kingfisher ADAS boards:
      Image-r8a7795-es1-h3ulcb-kf.dtb
      Image-r8a7795-h3ulcb-kf.dtb
      Image-r8a7796-m3ulcb-kf.dtb
      
      • Yocto v2.23.1:
        Image-r8a7797-es1-v3msk-kf.dtb
        Image-r8a7797-v3msk-kf.dtb
        
      • Yocto v3.9.0, v3.19.0, v3.21.0:
        Image-r8a7795-h3ulcb-4x2g-kf.dtb
        Image-r8a77965-m3nulcb-kf.dtb
        Image-r8a77970-es1-v3msk-kf.dtb
        Image-r8a77970-v3msk-kf.dtb
        
    4. For Videobox ADAS board:
      Image-es1-r8a7795-h3ulcb-vb.dtb
      Image-r8a7795-h3ulcb-vb.dtb
      
    5. For V3M Eagle board:
      • Yocto v2.23.1:
        Image-r8a7797-es1-eagle.dtb
        Image-r8a7797-eagle.dtb
        
      • Yocto v3.9.0, v3.19.0, 3.21.0:
        Image-r8a77970-es1-eagle.dtb
        Image-r8a77970-eagle.dtb
        
    6. For V3M Starter Kit board:
      • Yocto v2.23.1:
        Image-r8a7797-es1-v3msk.dtb
        Image-r8a7797-v3msk.dtb
        
      • Yocto v3.9.0, v3.19.0, 3.21.0:
        Image-r8a77970-es1-v3msk.dtb
        Image-r8a77970-v3msk.dtb
        
    7. For V3H Condor board:
      • Yocto v2.23.1:
        Image-r8a7798-condor.dtb
        
      • Yocto v3.9.0, v3.19.0, 3.21.0:
        Image-r8a77980-condor.dtb
        
    8. For V3H Starter Kit board:
      • Yocto v2.23.1:
        Image-r8a7798-v3hsk.dtb
        
      • Yocto v3.9.0, v3.19.0, 3.21.0:
        Image-r8a77980-v3hsk.dtb
        
  17. NOTES:
    • prefix -es1- is a blob to be used with ws1.0/ws1.1 silicon. The blob without prefix is for ws2.0 silicon.
    • v3.9.0 and later supports m3nulcb board along with the h3ulcb-4x2g board variant.

OpenCV support

OpenCV version 2.4.11 is enabled in build by default on Yocto v2.23.1 OpenCV version 3.2 is enabled in build by default on Yocto v3.9.0 or later To disable Opencv add this line in your local.conf:

DISTRO_FEATURES_remove = " opencv-sdk "

To build with OpenCV 3.2, don't add the previous line, but provide preffered version 3.2 in local.conf:

PREFERRED_VERSION_opencv = "3.2+git%"

OpenCL support

The following page describes how to enable OpenCL and Caffe support: R-Car/Boards/Yocto-Gen3/OpenCL

Build SDK

After building BSP you may build SDK:

  1. R-Car Gen3 boards with GPU support:
    bitbake core-image-weston -c populate_sdk
    
  2. R-Car Gen3 V3x boards with no GPU support (Linux SDK):
    bitbake core-image-minimal -c populate_sdk
    
  3. R-Car Gen3 V3x boards with no GPU support (Windows SDK):
    1. Checkout appropriate meta-mingw layer:
      cd $WORK
      git clone git://git.yoctoproject.org/meta-mingw
      cd meta-mingw
      git checkout -b <branch> origin/<branch>
      

      Branch to be used:

      Yovto version Branch name
      v3.21.0 (BSPv6) rocko
      v4.1.0 (BSPv7) zeus
    2. Remove nativesdk-perl from SDK packagegroup to avoid build failures. Add following lines to meta-mingw/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend:
      RDEPENDS_${PN}_remove_mingw32 = "\
          nativesdk-perl		\
          nativesdk-perl-dev		\
          nativesdk-perl-modules	\
      "
      
    3. Build Windows SDK archive:
      SDKMACHINE="x86_64-mingw32" bitbake core-image-minimal -c populate_sdk
      
    4. Windows SDK may need to be re-packed using 'zip' or 'tar' to de-reference symbolic links.
      For tar:
      1. Cleanup unpacked SDK to avoid broken and cyclic symlinks:
        cd <SDK unpack folder>
        rf sysroots/aarch64-poky-linux/usr/include/gphoto2/gphoto2
        rm `find . -xtype l`
        
      2. Create compressed SDK tarball with dereferenced symlinks:
        cd <SDK unpack folder>
        tar hJcf <new SDK archive path and name>.tar.xz *
        

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

Build BSP without network

Supported only in Ycoto v2.23.1 yet.
After building BSP you may archive gits and download cache and proceed developing without network.
Make sure that build that you completed online included all patches from step#4 of http://elinux.org/R-Car/Boards/Yocto-Gen3-ADAS#Building_the_BSP_for_Renesas_ADAS_boards
Archive the following folders:

cd $WORK/build
tar cfj bsp.v2.23.1.tar.bz2 meta-linaro meta-openembedded meta-rcar meta-renesas poky build/downloads

Unpack archive on machine without network access and proceed building starting from step#5 of http://elinux.org/R-Car/Boards/Yocto-Gen3-ADAS#Building_the_BSP_for_Renesas_ADAS_boards
Before step #13 add this option to local.conf: BB_NO_NETWORK=1

mkdir build
cd build
tar xfj <path_to_archive>/bsp.v2.23.1.tar.bz2

Running Yocto images

Linux kernel can be booted from microSD card or from TFTP. Root FS can be mounted from micro SD card or via NFS.

Loading kernel via TFTP and rootfs via NFS

Follow these steps to setup working TFTP and NFS server:

  1. Setup a TFTP server.

    Ubuntu

    Install tftpd-hpa package along with tftp tools:

    sudo apt-get install tftp tftpd-hpa
    

    Fedora

    1. Install necessary packages:
      sudo yum install tftp-server tftp
      

      tftp-server is a part of xinetd. See Fedora manual for more information.

    2. Enable TFTP server:
      sudo vi /etc/xinetd.d/tftp 
      
      Set
      disable = no
      Save file and exit.
    3. Start xinetd:
      sudo systemctl start xinetd.service
      sudo systemctl enable xinetd.service
      
  2. Copy Image and Image-r8a7795-h3ulcb.dtb (for ws2.0 silicon) and/or Image-r8a7795-es1-h3ulcb.dtb (for ws1.1) from $WORK/build/tmp/deploy/images/h3ulcb/ to TFTP server root.

    Ubuntu

    cp $WORK/build/tmp/deploy/images/h3ulcb/Image /srv/tftp/
    cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb /srv/tftp/
    

    Fedora

    cp $WORK/build/tmp/deploy/images/h3ulcb/Image /var/lib/tftpboot/
    cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb /var/lib/tftpboot/
    
  3. Verify that TFTP server is working.
    tftp localhost -c get Image && ls Image
    
  4. Setup NFS server.

    Debian/Ubuntu

    1. Install necessary packages:
      sudo apt-get install nfs-kernel-server nfs-common
      
    2. Start NFS server:
      sudo /etc/init.d/nfs-kernel-server start
      

    Fedora

    1. Install necessary packages:
      sudo yum install nfs-utils
      
    2. Enable and start nfs server:
      sudo systemctl enable rpcbind.service 
      sudo systemctl enable nfs-server.service 
      sudo systemctl enable nfs-lock.service 
      sudo systemctl enable nfs-idmap.service
      sudo systemctl start rpcbind.service 
      sudo systemctl start nfs-server.service 
      sudo systemctl start nfs-lock.service 
      sudo systemctl start nfs-idmap.service
      
  5. Export root FS to NFS. (Change IMAGE and MACHINE to fit your build).
    1. Unpack rootfs to a dedicated directory:
      IMAGE=weston
      MACHINE=salvator-x|h3ulcb|m3ulcb
      NFS_ROOT=/nfs/${MACHINE}
      sudo mkdir -p "${NFS_ROOT}"
      sudo rm -rf "${NFS_ROOT}"/*
      sudo tar -xjf "${WORK}/build/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}-*.tar.bz2" -C "${NFS_ROOT}"
      sync
      
    2. Edit /etc/exports:
      sudo vi /etc/exports
      

      add

      /nfs/h3ulcb	*(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
      /nfs/salvator-x	*(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
      

      Save the file and exit.

    3. Force NFS server to re-read /etc/exports
      sudo exportfs -a
  6. Verify that NFS is working.
    [builduser@buildmachine ~]$ showmount -e localhost
    Export list for localhost:
    /nfs/h3ulcb *
    /nfs/salvator-x *
    
  7. Boot into U-Boot command prompt
    1. Connect to serial console over microUSB using minicom or picocom.
    2. Switch the board on or reset it. Press any key to stop U-Boot automatic countdown.

    Refer to H3SK board page, M3SK board page, Salvator-X board page for more information.

  8. Configure Ethernet, TFTP, and kernel command line in U-Boot:
    setenv ipaddr <board-ip>
    setenv serverip <your-computer-ip>
    setenv bootcmd 'tftp 0x48080000 Image; tftp 0x48000000 Image-r8a7795-h3ulcb.dtb; booti 0x48080000 - 0x48000000'
    setenv bootargs 'ignore_loglevel rw root=/dev/nfs nfsroot=<your-computer-ip>:<nfs-path>,nfsvers=3 ip=<board-ip>:<your-computer-ip>::255.255.255.0:h3ulcb'
    saveenv
    

    Replace <board-ip> with the proper IP address for the board. Replace <your-computer-ip> with the IP address of your computer, where tftp and nfs servers are installed. Replace <nfs-path> with the exported path of the root FS.
    For example:

    setenv ipaddr 192.168.1.3
    setenv serverip 192.168.1.2
    setenv bootcmd 'tftp 0x48080000 Image; tftp 0x48000000 Image-r8a7795-h3ulcb.dtb; booti 0x48080000 - 0x48000000'
    setenv bootargs 'ignore_loglevel rw root=/dev/nfs nfsroot=192.168.1.2:/nfs/h3ulcb,nfsvers=3 ip=192.168.1.3:192.168.1.2::255.255.255.0:h3ulcb'
    saveenv
    

    You can also use

    dhcp
    

    command to obtain information from DHCP server.
    Note: You can always see the environment with printenv command. Refer to U-Boot manual for details.

  9. Verify the connection over Ethernet from U-Boot:
    ping <your-computer-ip>
    

    You should see:

    => ping 192.168.1.2    
    ravb:0 is connected to ravb.  Reconnecting to ravb
    ravb Waiting for PHY auto negotiation to complete.. done
    ravb: 100Base/Full
    Using ravb device
    host 192.168.1.2 is alive
    
  10. Reset the board by pushing reset button
    Refer to H3SK board page, M3SK board page, Salvator-X board page for more information.
  11. The board should boot the kernel:
    NOTICE:  BL2: R-Car Gen3 Initial Program Loader(CA57) Rev.1.0.10
    NOTICE:  BL2: PRR is R-Car H3 ES1.0
    NOTICE:  BL2: Boot device is HyperFlash(80MHz)
    NOTICE:  BL2: LCM state is CM
    NOTICE:  BL2: AVS setting succeeded. DVFS_SetVID=0x52
    NOTICE:  BL2: DDR1600(rev.0.10)
    NOTICE:  BL2: DRAM Split is 4ch
    NOTICE:  BL2: QoS is default setting(rev.0.32)
    NOTICE:  BL2: Lossy Decomp areas
    NOTICE:       Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570
    NOTICE:       Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0
    NOTICE:       Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0
    NOTICE:  BL2: v1.1(release):c2f9fc9
    NOTICE:  BL2: Built : 00:36:25, Nov 20 2016
    NOTICE:  BL2: Normal boot
    NOTICE:  BL2: dst=0xe631a1a8 src=0x8180000 len=512(0x200)
    NOTICE:  BL2: dst=0x43f00000 src=0x8180400 len=6144(0x1800)
    NOTICE:  BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000)
    NOTICE:  BL2: dst=0x44100000 src=0x8200000 len=524288(0x80000)
    NOTICE:  BL2: dst=0x50000000 src=0x8640000 len=1048576(0x100000)
    
    
    U-Boot 2015.04 (Nov 20 2016 - 00:54:11)
    
    CPU: Renesas Electronics R8A7795 rev 1.0
    Board: H3ULCB
    I2C:   ready
    DRAM:  3.9 GiB
    MMC:   sh-sdhi: 0, sh-sdhi: 1
    In:    serial
    Out:   serial
    Err:   serial
    Net:   ravb
    Hit any key to stop autoboot:  0 
    ravb Waiting for PHY auto negotiation to complete.. done
    ravb: 100Base/Full
    BOOTP broadcast 1
    BOOTP broadcast 2
    BOOTP broadcast 3
    DHCP client bound to address 192.166.10.31 (1287 ms)
    Using ravb device
    TFTP from server 192.166.10.1; our IP address is 192.166.10.31
    Filename 'Image'.
    Load address: 0x48080000
    Loading: #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             ####################################################
             627 KiB/s
    done
    Bytes transferred = 13905920 (d43000 hex)
    ravb:0 is connected to ravb.  Reconnecting to ravb
    ravb Waiting for PHY auto negotiation to complete. done
    ravb: 100Base/Full
    Using ravb device
    TFTP from server 192.166.10.1; our IP address is 192.166.10.31
    Filename 'Image-r8a7795-h3ulcb.dtb'.
    Load address: 0x48000000
    Loading: #############
             12.7 KiB/s
    done
    Bytes transferred = 66470 (103a6 hex)
    ## Flattened Device Tree blob at 48000000
       Booting using the fdt blob at 0x48000000
       Using Device Tree in place at 0000000048000000, end 00000000480133a5
    
    Starting kernel ...                                                                                                                         
    

How to prepare and boot from eMMC/SD card

This section describes steps that are necessary for preparing and booting from SD card.

Preparing eMMC/SD card

In order to prepare you SD card, follow these instructions on host machine:

1. Partion your SD card to set 1 partition and ID=83 (Linux)
Make sure the SD card doesn't contain any important files.
WARNING! These steps may erase the SD card completely. All files my be lost.

$ fdisk /dev/mmcblk0
-> d
-> n
-> p
-> 1
-> t
-> 83

2. Format this partition to ext3 (or ext4)

$ mkfs.ext3 /dev/mmcblk0p1

3. Mount this partition on your host to any directory and upack the core-image-weston-*.tar.bz2 into mounted folder.

$ mount /dev/mmcblk0p1 /mnt
$ cd <your_yocto_build_directory>
$ tar xfj  build/tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb-*.rootfs.tar.bz2  -C /mnt

NOTE: probably you need to be a root user, hence use "sudo"

Configure U-Boot to boot from SD card

Proper U-Boot command to boot from SD:

# setenv bootargs 'rw root=/dev/mmcblk1p1 rootfstype=ext3 rootwait consoleblank=0 log_buf_len=1M'
# ext2load mmc 0:1 0x48080000 /boot/Image
# ext2load mmc 0:1 0x48000000 /boot/Image-r8a7795-h3ulcb.dtb
# booti 0x48080000 - 0x48000000'

Example of U-Boot environment variables:

baudrate=115200
bootargs_emmc=rw root=/dev/mmcblk0p1 rootfstype=ext3 rootwait
bootargs_nfs=rw root=/dev/nfs rootwait ip=dhcp
bootargs_sd0=rw root=/dev/mmcblk1p1 rootfstype=ext3 rootwait
bootcmd=run bootcmd_sd0
bootcmd_emmc=set bootargs ${bootargs_emmc};ext2load mmc 1:1 0x48080000 /boot/Image;ext2load mmc 1:1 0x48000000 /boot/${dtb};run booti_cmd
bootcmd_nfs=set bootargs ${bootargs_nfs};bootp 0x48080000 Image;tftp 0x48000000 ${dtb};run booti_cmd
bootcmd_sd0=set bootargs ${bootargs_sd0};ext2load mmc 0:1 0x48080000 /boot/Image;ext2load mmc 0:1 0x48000000 /boot/${dtb};run booti_cmd
bootdelay=3
booti_cmd=booti 0x48080000 - 0x48000000
dtb=Image-r8a7795-h3ulcb.dtb
ethact=ravb
ethaddr=2E:09:0A:00:BE:11
fdt_high=0xffffffffffffffff
initrd_high=0xffffffffffffffff
stderr=serial
stdin=serial
stdout=serial
ver=U-Boot 2015.04 (Sep 23 2016 - 13:45:29)
Environment size: 1092/131068 bytes

To verify the SD card, type the following in U-Boot prompt:

=> mmc dev 0 
switch to partitions #0, OK
mmc0 is current device
=> mmc info
Device: sh-sdhi
Manufacturer ID: 3
OEM: 5344
Name: SL64G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 59.5 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
=> ext2ls mmc 0:1 /boot
<DIR>       4096 .
<DIR>       4096 ..
<SYM>         32 Image
        14039040 Image-4.6.0-yocto-standard
           69584 Image-r8a7795-h3ulcb.dtb

Build scripts examples

  1. Build preparation
    1. For Yocto v2.23.1
      #!/bin/sh
      
      mkdir sources || exit
      cd sources
      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/renesas-rcar/meta-renesas.git
      git clone git://github.com/CogentEmbedded/meta-rcar.git
      
      cd $WORK/poky
      git checkout -b tmp yocto-2.1.3
      cd $WORK/meta-linaro
      git checkout -b tmp 2f51d38048599d9878f149d6d15539fb97603f8f
      cd $WORK/meta-openembedded
      git checkout -b tmp 55c8a76da5dc099a7bc3838495c672140cedb78e
      cd $WORK/meta-renesas
      git checkout -b tmp 7acbf5e2f99c59478adbc73c6a40d314589a3009
      cd $WORK/meta-rcar
      git checkout -b v2.23.1-release3 remotes/origin/v2.23.1-release3
      
      cd $WORK/poky
      export PATCH_DIR=${WORK}/meta-rcar/meta-rcar-gen3-adas/docs/sample/patch
      patch -p1 < ${PATCH_DIR}/0004-ca-certificates-git-repo-moved-to-another-location.patch
      unset PATCH_DIR
      
    2. For Yocto v3.9.0
      #!/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/renesas-rcar/meta-renesas
      git clone git://github.com/CogentEmbedded/meta-rcar.git
      
      cd $WORK/poky
      git checkout -b tmp 342fbd6a3e57021c8e28b124b3adb241936f3d9d
      cd $WORK/meta-linaro
      git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
      cd $WORK/meta-openembedded
      git checkout -b tmp dacfa2b1920e285531bec55cd2f08743390aaf57
      cd $WORK/meta-renesas
      git checkout -b tmp fd078b6ece537d986852cb827bd21e022a797b2f
      cd $WORK/meta-rcar
      git checkout -b v3.9.0 remotes/origin/v3.9.0
      
      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
      
    3. For Yocto v3.13.0
      #!/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/renesas-rcar/meta-renesas
      git clone git://github.com/CogentEmbedded/meta-rcar.git
      
      cd $WORK/poky
      git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
      cd $WORK/meta-openembedded
      git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
      cd $WORK/meta-linaro
      git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
      cd $WORK/meta-renesas
      git checkout -b tmp 00f70f062aace04c051fa92d3cd7b887718fc313
      cd $WORK/meta-rcar
      git checkout -b v3.13.0 remotes/origin/v3.13.0
      
      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
      
    4. For Yocto v3.15.0
      #!/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/renesas-rcar/meta-renesas
      git clone git://github.com/CogentEmbedded/meta-rcar.git
      
      cd $WORK/poky
      git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
      cd $WORK/meta-openembedded
      git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
      cd $WORK/meta-linaro
      git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
      cd $WORK/meta-renesas
      git checkout -b tmp 8af0b7d6e445b532088a068dc012757001be3a1f
      cd $WORK/meta-rcar
      git checkout -b v3.15.0 remotes/origin/v3.15.0
      
      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
      
    5. For Yocto v3.19.0
      #!/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/renesas-rcar/meta-renesas
      git clone git://github.com/CogentEmbedded/meta-rcar.git
      
      cd $WORK/poky
      git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
      cd $WORK/meta-openembedded
      git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
      cd $WORK/meta-linaro
      git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
      cd $WORK/meta-renesas
      git checkout -b tmp 20fcc94a8d05eda80250f27e87aaa3cfc3275300
      cd $WORK/meta-rcar
      git checkout -b v3.19.0 remotes/origin/v3.19.0
      
      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
      
    6. For Yocto v3.21.0
      #!/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/renesas-rcar/meta-renesas
      git clone git://github.com/CogentEmbedded/meta-rcar.git
      
      cd $WORK/poky
      git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
      cd $WORK/meta-openembedded
      git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
      cd $WORK/meta-linaro
      git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
      cd $WORK/meta-renesas
      git checkout -b tmp ad3a8cfee5b6a6fab17cf1c6e5af851eaec75bd7
      cd $WORK/meta-rcar
      git checkout -b v3.21.0 remotes/origin/v3.21.0
      
      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
      
  2. Building yocto
    1. For Yocto v2.23.1
      #!/bin/sh
      
      case "$1" in
      "eagle" | "v3hsk" | "v3msk" | "condor")
          echo "Use build configuration for $1 board"
          ;;
      *)
          echo "Provide board name. Supported boards: eagle, v3hsk, v3msk, condor."
          exit -1
          ;;
      esac
      
      BOARD=$1
      
      cd sources || exit -1
      
      WORK=`pwd`
      echo $WORK
      
      cd $WORK
      source poky/oe-init-build-env
      
      cp $WORK/meta-rcar/meta-rcar-gen3-adas/docs/sample/conf/$BOARD/linaro-gcc/bsp/*.conf ./conf/.
      
      echo "The build directory is $(pwd) "
      
      bitbake-layers add-layer ../meta-rcar/meta-rcar-gen3-adas
      
      bitbake core-image-minimal
      bitbake core-image-minimal -c populate_sdk
      
    1. For Yocto v3.9.0 or later
      #!/bin/sh
      
      cd build
      WORK=`pwd`
      echo $WORK
      
      cd $WORK
      source poky/oe-init-build-env
      
      # R-Car Gen3 ADAS boards
      #cp $WORK/meta-rcar/meta-rcar-gen3-adas/docs/sample/conf/condor/poky-gcc/bsp/*.conf ./conf/.
      
      # R-Car Gen3 boards
      #cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/poky-gcc/bsp/*.conf ./conf/.
      #cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/poky-gcc/gfx-only/*.conf ./conf/.
      cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/poky-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
      # uncomment for ADAS HAD board only:
      #echo "MACHINE_FEATURES_append = \" h3ulcb-had\"" >> $WORK/build/conf/local.conf
      
      bitbake-layers add-layer ../meta-rcar/meta-rcar-gen3-adas
      
      # R-Car Gen3 boards
      bitbake core-image-weston
      bitbake core-image-weston -c populate_sdk
      
      # R-Car Gen3 V3x boards
      #bitbake core-image-minimal
      #bitbake core-image-minimal -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.

CMA (contiguous memory allocator)

Available in BSPv3 and later versions only

For V3M and V3H based boards (Eagle, Condor, V3MSK and V3HSK) size of default CMA area used by generic Linux drivers (such as VIN, USB, etc.) and MMNGR driver (to allocate contiguous buffers on user-space e.g. for IMP and IMR) can be adjusted using standard 'cma' command line option. See 'Documentation/kernel-parameters.txt' file in Linux kernel source code for details. Default size of the CMA memory on these boards is 256Mb.

On other Gen3 boards CMA default area is defined in device tree. To adjust it's size device tree source need to be modified and rebuilt.

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 
    
  4. By default 1280x800 resolution is used for cameras, but you can change it with --camres option:
    sv-utest -v /dev/video0,/dev/video1,/dev/video2,/dev/video3 --camres 1280x1080
    

SurroundView IMR version

  1. Save mesh object file from the GPU SurroundView: after calibartion and sphere adjusting are done, press S, then "=" 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: For 4-cameras environment:
    ./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
    

    For 8-cameras environment:

    ./imr-wl -f uyvy -v /dev/video0,/dev/video1,/dev/video2,/dev/video3 -w 1280 -h 800 -W 1920 -H 1080 \
    	-r /dev/video8,/dev/video9,/dev/video10,/dev/video11,/dev/video8,/dev/video9,/dev/video10,/dev/video11 -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)

Demo application demonstrates surround view with pre-defined viewpoints on Renesas boards with 4 additional cameras for mirror replacement purposes. First additional camera works as driver monitor.

  1. Save mesh object file from the GPU SurroundView: after calibartion and sphere adjusting are done, press S, then "=" 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 8-cam-imr-gpu-sv-utest application (see the README.md file as well):
    git clone https://github.com/CogentEmbedded/8-cam-imr-gpu-sv-utest.git
    cd 8-cam-imr-gpu-sv-utest
    . <SDK_INSTALL_PATH>/environment-setup-aarch64-poky-linux 
    mkdir build
    cd build
    cmake ../
    make
    

    Demo executable "sc" stored ../bin directory.

  3. It's need to generate png files with car model images before running IMR SurroundView. Copy executable "gen" from "prebuilt/" 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. Copy resources files to directory where application will be runned from "resources/". Copy libdrivermonitor.so and libsv.so from "lib/" directory to rootfs. Copy "resources/adas-utest" directory to /usr/share on rootfs.
  5. Run the application:
    ./sc -W 1920 -H 1080 -m ./data/model -M meshFull.obj -X 1920 -Y 1080 -g 1.0 -b 0x000000 -c config.txt -S -0.20:-0.1:0.20:0.1 -s 8:32:8
    
  6. To control application with SpaceNav start SpaceNav daemon: spacenavd command. There are 5 widgets on the main screen: main 3d SurroundView screen, DriverMonitor camera, right, left and rear mirror replacement cameras. To change focus on widget press right button on SpaceNav. To change zoom and view on mirror replacement cameras rotate SpaceNav joystick, when widget is in focus. To hide Driver Monitor camera and mirror cameras press and hold left button on joystick, when widget is in focus. To switch to IMR demo press left button on SpaceNav joystick, when main 3d SurroundView in focus. To get back from IMR demo press left button again. To rotate view in IMR demo use joystick or touchscreen.

Camera demo for VIN-IMR-DRM capture pipe

Unit test application demonstrates IMR-DRM usage on systems that have no GPU (r8a7797).
The test application name is 'utest-cam-imr-drm'. The unit test is provided in sources and built within yocto.

  1. The unit test is located on rootfs for core-image-minimal build (tested on V3MSK).
    To launch the application issue the following command with 4 cameras connected:
    $ utest-cam-imr-drm
    

NOTE: unit test assumes use of 4 cameras at resolution 1280x1080
To use other then 4 amount of cameras, then modify CAMERAS_NUMBER definition in source code (meta-rcar/meta-rcar-gen3-adas/recipes-bsp/utest-apps/files/utest-cam-imr-drm.tar.gz)
To use other resolution use parameters 'h' and 'w':

$ utest-cam-imr-drm -w 1280 -h 800

Camera low level tests

It is possible to run low level tests to validate LVDS cameras.
The test application name is 'capture'. The 'capture' is provided in sources and build within yocto.

  1. The test examples are located on rootfs path:
    $ ls -1 /usr/share/tests/
    test_lvds_2cameras_on_display1920x1080.sh
    test_lvds_4cameras_on_display1920x1080.sh
    test_lvds_8cameras_on_display1920x1080.sh
    test_lvds_camera_0-3.sh
    test_lvds_camera_0.sh
    test_lvds_camera_4-7.sh
    test_lvds_camera_4.sh
    

Known issues and limitations

TBD