Difference between revisions of "R-Car/Boards/Yocto-Gen3/v3.21.0"

From eLinux.org
Jump to: navigation, search
m (Y.H. moved page R-Car/Boards/Yocto-Gen3 to R-Car/Boards/Yocto-Gen3/v3.21.0: Change Yocto-Gen3 page to redirect page)
(52 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 
{{TOC right}}
 
{{TOC right}}
 +
[[Category:R-Car]]
 +
 
This page contains information on building and running Yocto on:
 
This page contains information on building and running Yocto on:
* [[R-Car/Boards/H3SK | Renesas R-Car-H3 Starter Kit Premier]] (unofficial name - H3ULCB), 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), https://www.renesas.com/us/en/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 | Renesas R-Car-M3 Starter Kit Pro]] (unofficial name - M3ULCB), https://www.renesas.com/us/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html
 +
'''NOTE: USE OFFICIAL DOCUMENTATION provided with R-Car BSPs FOR H3SK/M3SK boards'''
 +
<br/><br/>
 +
* [[R-Car/Boards/Kingfisher | Infotainment Carrier Board For R-Car Starter Kit(Kingfisher)]]
  
'''NOTE: USE OFFICIAL DOCUMENTATION provided with R-Car BSPs FOR H3SK/M3SK boards'''
 
 
== Yocto versions ==
 
== Yocto versions ==
[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.3 Poky-2.4.3] is supported with Yocto v3.21.0.<br/>
[http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-2.4.1 Poky-2.4.1] is supported with Yocto v3.4. <br/>
 
 
Specific commit of meta-openembedded is required.
 
Specific commit of meta-openembedded is required.
 +
 +
== Host PC ==
 +
Ubuntu 16.04 LTS (64bit) is recommended as OS. 32bit version is not supported. <br/>
  
 
== Preliminary steps ==
 
== Preliminary steps ==
<ol>
+
# Download evaluation version of proprietary graphics and multimedia drivers from Renesas.
<li>Download evaluation version of proprietary graphics and multimedia drivers from Renesas.<br/>
+
#: To download Multimedia and Graphics library and related Linux drivers, please use the following link:
<br/>
+
#:: https://www.renesas.com/us/en/solutions/automotive/rcar-download/rcar-demoboard.html
To download Multimedia and Graphics library and related Linux drivers, please use the following link:<br/>
+
#: Download two files:
https://www.renesas.com/en-us/solutions/automotive/rcar-demoboard.html<br/>
+
#:: R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20190722.zip
<br/>
+
#:: R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20190722.zip
Graphic drivers are required for Wayland. Multimedia drivers are optional.<br/>
+
#: <br/>
<br/>
+
#: Graphic drivers are required for Wayland. Multimedia drivers are optional.
</li>
+
# Install required packages
 
+
#: '''Ubuntu and Debian'''
<li> Install required packages
+
#:: <syntaxhighlight lang="bash">
===== Ubuntu and Debian =====
 
<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 cpio python python3 \
 
     build-essential chrpath socat libsdl1.2-dev xterm python-crypto cpio python python3 \
 
     python3-pip python3-pexpect xz-utils debianutils iputils-ping libssl-dev
 
     python3-pip python3-pexpect xz-utils debianutils iputils-ping libssl-dev
</pre>
+
</syntaxhighlight>
 
+
#: '''Fedora'''
===== Fedora =====
+
#:: <syntaxhighlight lang="bash">
<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 \
Line 36: Line 39:
 
     SDL-devel xterm python-crypto cpio python python3 python3-pip python3-pexpect \
 
     SDL-devel xterm python-crypto cpio python python3 python3-pip python3-pexpect \
 
     ghc-lzma-conduit iputils openssl
 
     ghc-lzma-conduit iputils openssl
</pre>
+
</syntaxhighlight>
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.
</li>
 
</ol>
 
  
 
== Building the BSP for Renesas H3 Starter Kit, M3 Starter Kit ==
 
== Building the BSP for Renesas H3 Starter Kit, M3 Starter Kit ==
 
NOTE: to have ADAS View and HAD Solution kits supported follow instructions: [[R-Car/Boards/Yocto-Gen3-ADAS | R-Car Yocto Gen3 ADAS]]
 
NOTE: to have ADAS View and HAD Solution kits supported follow instructions: [[R-Car/Boards/Yocto-Gen3-ADAS | R-Car Yocto Gen3 ADAS]]
<ol>
+
 
<li>Create a directory and switch to it <br/>
+
=== Build using script ===
Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.
+
This example is for H3ULCB board.<br/>
<pre>
+
If you use other board, you need to modify the script.<br/>
 +
# Directory Structure
 +
#: <syntaxhighlight lang="bash">
 +
|--build.sh
 +
`--proprietary
 +
  |--R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20190722.zip
 +
  `--R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20190722.zip
 +
</syntaxhighlight>
 +
# Build script(build.sh)
 +
#: <syntaxhighlight lang="bash">
 +
#!/bin/bash
 +
 
 +
#Set the target board
 +
TARGET_BOARD=h3ulcb
 +
#TARGET_BOARD=m3ulcb
 +
 
 +
# Create a directory and switch to it
 +
mkdir $TARGET_BOARD
 +
cd $TARGET_BOARD
 +
WORK=`pwd`
 +
echo $WORK
 +
 
 +
# Clone basic Yocto layers in parallel
 +
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 &
 +
 
 +
# Wait for all clone operations
 +
wait
 +
 
 +
# Switch to proper branches/commits
 +
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 59e8d5674348e2b3d14ac4552231809ab10ab84e
 +
 
 +
# Populate meta-renesas with proprietary software packages
 +
cd $WORK/meta-renesas
 +
sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $WORK/../proprietary
 +
 
 +
cd $WORK
 +
source poky/oe-init-build-env $WORK/build
 +
 
 +
#cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/bsp/*.conf ./conf/.
 +
#cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/gfx-only/*.conf ./conf/.
 +
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/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
 +
 
 +
bitbake core-image-weston
 +
 
 +
</syntaxhighlight>
 +
# build
 +
#: <syntaxhighlight lang="bash">
 +
./build.sh
 +
</syntaxhighlight>
 +
#: If the build completes successfully, all the necessary files are generated in a following directory:
 +
#: <syntaxhighlight lang="text">
 +
./build/build/tmp/deploy/images/<target_board_name>
 +
</syntaxhighlight>
 +
 
 +
=== Build using manual steps ===
 +
# 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.
 +
#: <syntaxhighlight lang="bash">
 
mkdir build
 
mkdir build
 
cd build
 
cd build
 
export WORK=`pwd`
 
export WORK=`pwd`
</pre>
+
</syntaxhighlight>
</li>
+
# Clone basic Yocto layers:
<li>Clone basic Yocto layers:
+
#: <syntaxhighlight lang="bash">cd $WORK
<pre>
 
cd $WORK
 
 
git clone git://git.yoctoproject.org/poky
 
git clone git://git.yoctoproject.org/poky
 
git clone git://git.openembedded.org/meta-openembedded
 
git clone git://git.openembedded.org/meta-openembedded
 
git clone git://git.linaro.org/openembedded/meta-linaro.git
 
git clone git://git.linaro.org/openembedded/meta-linaro.git
 
git clone git://github.com/renesas-rcar/meta-renesas
 
git clone git://github.com/renesas-rcar/meta-renesas
</pre>
+
</syntaxhighlight>
</li>
+
# Switch to proper branches/commits <span style="color:#ff0000;">(2020/02/20 updated)</span>
 
+
#: <syntaxhighlight lang="bash">
<li>
 
Switch to proper branches/commits
 
<ol>
 
<li>
 
For Yocto v2.23.1
 
<pre>
 
 
cd $WORK/poky
 
cd $WORK/poky
git checkout -b tmp yocto-2.1.3
+
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
 
cd $WORK/meta-linaro
git checkout -b tmp 2f51d38048599d9878f149d6d15539fb97603f8f
+
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
 
cd $WORK/meta-renesas
 
cd $WORK/meta-renesas
git checkout -b tmp 7acbf5e2f99c59478adbc73c6a40d314589a3009
+
git checkout -b tmp 59e8d5674348e2b3d14ac4552231809ab10ab84e # <= 2020/02/20 updated
</pre>
+
</syntaxhighlight>
</li>
+
#: Another versions are not tested for compatibility.
<li>
+
#: Legacy BSP instruction can be found here [[R-Car/Boards/Yocto-Gen3-legacy | R-Car Yocto Gen3 legacy]]
For Yocto v3.4
+
# Download proprietary driver modules to $WORK/proprietary folder
<pre>
+
#: You should see the following files:
cd $WORK/poky
+
#: <syntaxhighlight lang="bash">
git checkout -b tmp 16e22f3e37788afb83044f5089d24187d70094bd
 
cd $WORK/meta-openembedded
 
git checkout -b tmp 6e3fc5b8d904d06e3aa77e9ec9968ab37a798188
 
cd $WORK/meta-linaro
 
git checkout -b tmp 30f0f5e158ba29c4b1ccfdd66f0368726e4179e0
 
cd $WORK/meta-renesas
 
git checkout -b tmp 0f4c656f1e8304ce13f43b07907fac5d9b281e4f
 
</pre>
 
</li>
 
</ol>
 
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]]
 
</li>
 
 
 
<li>
 
Apply Linaro-GCC patch file:
 
<pre>
 
cd $WORK/meta-renesas
 
export PATCH_DIR=meta-rcar-gen3/docs/sample/patch/patch-for-linaro-gcc
 
patch -p1 < ${PATCH_DIR}/0001-rcar-gen3-add-readme-for-building-with-Linaro-Gcc.patch
 
unset PATCH_DIR
 
</pre>
 
</li>
 
<li>
 
Download proprietary driver modules to $WORK/proprietary folder.<br/>
 
You should see the following files:
 
<ol>
 
<li>
 
For Yocto v2.23.1
 
<pre>
 
 
$ ls -1 $WORK/proprietary/*.zip
 
$ ls -1 $WORK/proprietary/*.zip
R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20170828.zip
+
R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20190722.zip
R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20170828.zip
+
R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20190722.zip
</pre>
+
</syntaxhighlight>
</li>
+
# Populate meta-renesas with proprietary software packages.
<li>
+
#: <syntaxhighlight lang="bash">
For Yocto v3.4
 
<pre>
 
$ ls -1 $WORK/proprietary/*.zip
 
R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20180130.zip
 
R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20180130.zip
 
</pre>
 
</li>
 
</ol>
 
</li>
 
 
 
<li>
 
Populate meta-renesas with proprietary software packages.
 
<pre>
 
 
export PKGS_DIR=$WORK/proprietary
 
export PKGS_DIR=$WORK/proprietary
 
cd $WORK/meta-renesas
 
cd $WORK/meta-renesas
 
sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $PKGS_DIR
 
sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $PKGS_DIR
 
unset PKGS_DIR
 
unset PKGS_DIR
</pre>
+
</syntaxhighlight>
</li>
+
# Setup build environment
 
+
#: <syntaxhighlight lang="bash">
<li>
 
Setup build environment
 
<pre>
 
 
cd $WORK
 
cd $WORK
source poky/oe-init-build-env
+
source poky/oe-init-build-env $WORK/build
</pre>
+
</syntaxhighlight>
</li>
+
# Prepare default configuration files.
 
+
#: <syntaxhighlight lang="bash">
<li>
 
Prepare default configuration files.
 
<ol>
 
<li>
 
For Yocto v2.23.1
 
<pre>
 
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/<h3ulcb|m3ulcb>/linaro-gcc/mmp/*.conf ./conf/
 
cd $WORK/build
 
cp conf/local-wayland.conf conf/local.conf
 
</pre>
 
</li>
 
<li>
 
For Yocto v3.4
 
<pre>
 
 
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/<h3ulcb|m3ulcb>/poky-gcc/mmp/*.conf ./conf/
 
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/<h3ulcb|m3ulcb>/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
</pre>
+
</syntaxhighlight>
</li>
+
# (Edit $WORK/build/conf/local.conf to enable/disable graphics and multimedia proprietary drivers support)
</ol>
+
# Edit local.conf with evaluation packages requirements:
 
+
#: <syntaxhighlight lang="bash">
<li>
 
(Edit $WORK/build/conf/local.conf to enable/disable graphics and multimedia proprietary drivers support)
 
</li>
 
 
 
<li>
 
Edit local.conf with evaluation packages requirements:
 
<ol>
 
<li>
 
For Yocto v2.23.1 and later (to enable EVA_ prefix during packages install)
 
<pre>
 
 
DISTRO_FEATURES_append = " use_eva_pkg"
 
DISTRO_FEATURES_append = " use_eva_pkg"
</pre>
+
</syntaxhighlight>
</li>
+
# Start the build
</ol>
+
#: <syntaxhighlight lang="bash">
</li>
 
 
 
<li>
 
Start the build <br />
 
<pre>
 
 
bitbake core-image-weston
 
bitbake core-image-weston
</pre>
+
</syntaxhighlight>
</li>
+
# Building image can take up to a few hours depending on your host system performance.<br>After the build has been completed successfully, you should see the output similar to:
 
+
#: <syntaxhighlight lang="bash">
<li>
 
Building image can take up to a few hours depending on your host system performance.<br>
 
After the build has been completed successfully, you should see the output similar to:
 
<pre class="bash">
 
 
NOTE: Tasks Summary: Attempted 4704 tasks of which 31 didn't need to be rerun and all succeeded.
 
NOTE: Tasks Summary: Attempted 4704 tasks of which 31 didn't need to be rerun and all succeeded.
</pre>
+
</syntaxhighlight>
and the command prompt should return.
+
#: and the command prompt should return.
</li>
+
# Bitbake has generated all the necessary files in ./tmp/deploy/images directory. <br/>You can verify its content:
 
+
#: <syntaxhighlight lang="bash">
<li>
 
Bitbake has generated all the necessary files in ./tmp/deploy/images directory. <br/>
 
You can verify its content:
 
<pre class="bash">
 
 
$ ls -1 `find ./tmp/deploy/images/h3ulcb/ -maxdepth 1 -type l -print`
 
$ 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.cpio.gz
Line 211: Line 192:
 
./tmp/deploy/images/h3ulcb/Image-h3ulcb.bin
 
./tmp/deploy/images/h3ulcb/Image-h3ulcb.bin
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-es1-h3ulcb.dtb
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-es1-h3ulcb.dtb
 +
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-4x2g.dtb
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb
 
./tmp/deploy/images/h3ulcb/modules-h3ulcb.tgz
 
./tmp/deploy/images/h3ulcb/modules-h3ulcb.tgz
Line 217: Line 199:
 
./tmp/deploy/images/h3ulcb/u-boot-elf.srec
 
./tmp/deploy/images/h3ulcb/u-boot-elf.srec
 
./tmp/deploy/images/h3ulcb/u-boot-h3ulcb.bin
 
./tmp/deploy/images/h3ulcb/u-boot-h3ulcb.bin
</pre>
+
</syntaxhighlight>
'''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.
+
#: '''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.
</li>
+
# You can now proceed with running Yocto images
<li>
 
You can now proceed with running Yocto images
 
</li>
 
</ol>
 
 
 
==OpenCL support==
 
 
 
Supported only in Ycoto v2.23.1 yet.</br>
 
The following page describes how to enable OpenCL and Caffe support:
 
[[R-Car/Boards/Yocto-Gen3/OpenCL]]
 
  
 
== Build SDK ==
 
== Build SDK ==
After building BSP you may build SDK:
+
* After building BSP you may build SDK:
<pre>
+
*: <syntaxhighlight lang="text">bitbake core-image-weston -c populate_sdk</syntaxhighlight>
bitbake core-image-weston -c populate_sdk
+
* After build finished the SDK installation script may be found in following path:
</pre>
+
*: <syntaxhighlight lang="text">tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-toolchain-*.sh</syntaxhighlight>
After build finished the SDK installation script may be found in following path:
+
* Install SDK by run the following command and follow instructions on the screen:
<pre>
+
*: <syntaxhighlight lang="text">./tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-toolchain-*.sh</syntaxhighlight>
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>
 
  
 
== Running Yocto images ==
 
== Running Yocto images ==
Line 250: Line 216:
 
=== Loading kernel via TFTP and rootfs via NFS ===
 
=== Loading kernel via TFTP and rootfs via NFS ===
 
Follow these steps to setup working TFTP and NFS server:
 
Follow these steps to setup working TFTP and NFS server:
<ol>
+
# Setup a TFTP server.
<li>
+
#: '''Ubuntu'''
Setup a TFTP server.
+
#: Install '''tftpd-hpa''' package along with tftp tools:
==== Ubuntu ====
+
#: <syntaxhighlight lang="bash">
Install '''tftpd-hpa''' package along with tftp tools:
 
<pre>
 
 
sudo apt-get install tftp tftpd-hpa
 
sudo apt-get install tftp tftpd-hpa
</pre>
+
</syntaxhighlight>
 
+
#: '''Fedora'''
==== Fedora ====
+
## Install necessary packages:
<ol>
+
##: <syntaxhighlight lang="bash">
<li>
 
Install necessary packages:
 
<pre>
 
 
sudo yum install tftp-server tftp
 
sudo yum install tftp-server tftp
</pre>
+
</syntaxhighlight>
tftp-server is a part of xinetd. See [http://docs.fedoraproject.org/en-US/Fedora/20/html/Installation_Guide/ch13s05s03.html Fedora manual] for more information.
+
##: tftp-server is a part of xinetd. See [http://docs.fedoraproject.org/en-US/Fedora/20/html/Installation_Guide/ch13s05s03.html Fedora manual] for more information.
</li>
+
## Enable TFTP server:
<li>
+
##: <syntaxhighlight lang="bash">
Enable TFTP server:
 
<pre>
 
 
sudo vi /etc/xinetd.d/tftp  
 
sudo vi /etc/xinetd.d/tftp  
</pre>
+
</syntaxhighlight>
Set <pre>disable = no</pre> Save file and exit.
+
##: Set <syntaxhighlight lang="bash">
</li>
+
disable = no
<li>
+
</syntaxhighlight>
Start xinetd:
+
##: Save file and exit.
<pre>
+
## Start xinetd:
 +
##: <syntaxhighlight lang="bash">
 
sudo systemctl start xinetd.service
 
sudo systemctl start xinetd.service
 
sudo systemctl enable xinetd.service
 
sudo systemctl enable xinetd.service
</pre>
+
</syntaxhighlight>
</li>
+
# Copy '''Image''' and '''Image-r8a7795-h3ulcb.dtb''' (for ws2.0 silicon) and/or '''Image-r8a7795-h3ulcb-4x2g.dtb''' (for RTP0RC77951SKBX010SA03(DDR 8GiB)) and/or '''Image-r8a7795-es1-h3ulcb.dtb''' (for ws1.1) from $WORK/build/tmp/deploy/images/h3ulcb/ to TFTP server root.
</ol>
+
#: '''Ubuntu'''
 
+
#:: <syntaxhighlight lang="bash">
</li>
 
 
 
<li>
 
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 ====
 
<pre>
 
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image /srv/tftp/
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image /srv/tftp/
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-es1-h3ulcb.dtb /srv/tftp/
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-es1-h3ulcb.dtb /srv/tftp/
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb /srv/tftp/
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb /srv/tftp/
</pre>
+
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-4x2g.dtb /srv/tftp/
 
+
</syntaxhighlight>
==== Fedora ====
+
#: ''' Fedora'''
<pre>
+
#:: <syntaxhighlight lang="bash">
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image /var/lib/tftpboot/
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image /var/lib/tftpboot/
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-es1-h3ulcb.dtb /var/lib/tftpboot/
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-es1-h3ulcb.dtb /var/lib/tftpboot/
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb /var/lib/tftpboot/
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb /var/lib/tftpboot/
</pre>
+
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-4x2g.dtb /var/lib/tftpboot/
[http://elinux.org/R-Car/Boards/H3SK#H3SK_has_two_kinds_of_boards/ Which is my H3SK board WS2.0 or WS1.1?]
+
</syntaxhighlight>
</li>
+
#: [[R-Car/Boards/H3SK#H3SK_has_several_kinds_of_boards | Which version is my H3SK board?]]
 
+
# Verify that TFTP server is working.
<li>
+
#: <syntaxhighlight lang="bash">
Verify that TFTP server is working.
 
<pre>
 
 
tftp localhost -c get Image && ls Image
 
tftp localhost -c get Image && ls Image
</pre>
+
</syntaxhighlight>
</li>
+
# Setup NFS server.
 
+
#: '''Debian/Ubuntu'''
<li>
+
## Install necessary packages:
Setup NFS server.
+
##: <syntaxhighlight lang="bash">
==== Debian/Ubuntu ====
 
<ol>
 
<li>
 
Install necessary packages:
 
<pre>
 
 
sudo apt-get install nfs-kernel-server nfs-common
 
sudo apt-get install nfs-kernel-server nfs-common
</pre>
+
</syntaxhighlight>
</li>
+
## Start NFS server:
<li>
+
##: <syntaxhighlight lang="bash">
Start NFS server:
 
<pre>
 
 
sudo /etc/init.d/nfs-kernel-server start
 
sudo /etc/init.d/nfs-kernel-server start
</pre>
+
</syntaxhighlight>
</li>
+
#: '''Fedora'''
</ol>
+
## Install necessary packages:
 
+
##* <syntaxhighlight lang="bash">
==== Fedora ====
 
<ol>
 
<li>
 
Install necessary packages:
 
<pre>
 
 
sudo yum install nfs-utils
 
sudo yum install nfs-utils
</pre>
+
</syntaxhighlight>
</li>
+
## Enable and start nfs server:
<li>
+
##: <syntaxhighlight lang="bash">
Enable and start nfs server:
 
<pre>
 
 
sudo systemctl enable rpcbind.service  
 
sudo systemctl enable rpcbind.service  
 
sudo systemctl enable nfs-server.service  
 
sudo systemctl enable nfs-server.service  
Line 348: Line 286:
 
sudo systemctl start nfs-lock.service  
 
sudo systemctl start nfs-lock.service  
 
sudo systemctl start nfs-idmap.service
 
sudo systemctl start nfs-idmap.service
</pre>
+
</syntaxhighlight>
</li>
+
# Export root FS to NFS. (Change IMAGE and MACHINE to fit your build).
</ol>
+
## Unpack rootfs to a dedicated directory:
</li>
+
##: <syntaxhighlight lang="text">
 
 
<li>
 
Export root FS to NFS. (Change IMAGE and MACHINE to fit your build).
 
<ol>
 
<li>
 
Unpack rootfs to a dedicated directory:
 
<pre>
 
 
IMAGE=weston
 
IMAGE=weston
 
MACHINE=h3ulcb|m3ulcb
 
MACHINE=h3ulcb|m3ulcb
Line 366: Line 297:
 
sudo tar -xjf "${WORK}/build/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}-*.tar.bz2" -C "${NFS_ROOT}"
 
sudo tar -xjf "${WORK}/build/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}-*.tar.bz2" -C "${NFS_ROOT}"
 
sync
 
sync
</pre>
+
</syntaxhighlight>
</li>
+
## Edit '''/etc/exports''':
<li>
+
##: <syntaxhighlight lang="bash">
Edit '''/etc/exports''':
 
<pre>
 
 
sudo vi /etc/exports
 
sudo vi /etc/exports
</pre>
+
</syntaxhighlight>
add
+
##: add
<pre>
+
##: <syntaxhighlight lang="text">
 
/nfs/h3ulcb *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
 
/nfs/h3ulcb *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
 
/nfs/m3ulcb *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
 
/nfs/m3ulcb *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
</pre>
+
</syntaxhighlight>
Save the file and exit.
+
##: Save the file and exit.
</li>
+
## Force NFS server to re-read /etc/exports
<li>
+
##: <syntaxhighlight lang="bash">
Force NFS server to re-read /etc/exports
+
sudo exportfs -a
<pre>sudo exportfs -a</pre>
+
</syntaxhighlight>
</li>
+
# Verify that NFS is working.
</ol>
+
#: <syntaxhighlight lang="bash">
</li>
 
<li>
 
Verify that NFS is working.
 
<pre>
 
 
[builduser@buildmachine ~]$ showmount -e localhost
 
[builduser@buildmachine ~]$ showmount -e localhost
 
Export list for localhost:
 
Export list for localhost:
 
/nfs/h3ulcb *
 
/nfs/h3ulcb *
 
/nfs/m3ulcb *
 
/nfs/m3ulcb *
</pre>
+
</syntaxhighlight>
</li>
+
# <span id="Boot into U-Boot command prompt">Boot into U-Boot command prompt</span>
 
+
## Connect to serial console over microUSB using minicom or picocom.
<li><span id="Boot into U-Boot command prompt">Boot into U-Boot command prompt</span>
+
## Switch the board on or reset it. Press any key to stop U-Boot automatic countdown.
 
+
#: Refer to [[R-Car/Boards/H3SK#Power_on_the_board_and_go_to_U-Boot_prompt|H3SK board page]], [[R-Car/Boards/M3SK#Power_on_the_board_and_go_to_U-Boot_prompt|M3SK board page]] for more information.
<ol>
+
# Configure Ethernet, TFTP, and kernel command line in U-Boot:
<li>
 
Connect to serial console over microUSB using minicom or picocom.
 
</li>
 
<li>
 
Switch the board on or reset it. Press any key to stop U-Boot automatic countdown.
 
</li>
 
</ol>
 
Refer to [[R-Car/Boards/H3SK#Power_on_the_board_and_go_to_U-Boot_prompt|H3SK board page]], [[R-Car/Boards/M3SK#Power_on_the_board_and_go_to_U-Boot_prompt|M3SK board page]] for more information.
 
</li>
 
 
 
<li>
 
Configure Ethernet, TFTP, and kernel command line in U-Boot:
 
 
<!--setenv ethaddr xx:xx:xx:xx:xx:xx
 
<!--setenv ethaddr xx:xx:xx:xx:xx:xx
 
Replace xx:xx:xx:xx:xx:xx with the MAC address of your board. It should be on the sticker on top of the Ethernet port.<br/>
 
Replace xx:xx:xx:xx:xx:xx with the MAC address of your board. It should be on the sticker on top of the Ethernet port.<br/>
 
  -->
 
  -->
<pre>
+
#: <syntaxhighlight lang="text">
 
setenv ipaddr <board-ip>
 
setenv ipaddr <board-ip>
 
setenv serverip <your-computer-ip>
 
setenv serverip <your-computer-ip>
Line 420: Line 333:
 
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'
 
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
 
saveenv
</pre>
+
</syntaxhighlight>
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. <br/> For example:
+
#: 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. <br/> For example:
<pre>
+
#: <syntaxhighlight lang="text">
 
setenv ipaddr 192.168.1.3
 
setenv ipaddr 192.168.1.3
 
setenv serverip 192.168.1.2
 
setenv serverip 192.168.1.2
Line 428: Line 341:
 
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'
 
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
 
saveenv
</pre>
+
</syntaxhighlight>
You can also use
+
#: You can also use
<pre>
+
#: <syntaxhighlight lang="text">
 
dhcp
 
dhcp
</pre>
+
</syntaxhighlight>
command to obtain information from DHCP server.<br/>
+
#: command to obtain information from DHCP server.<br/>
'''Note:''' You can always see the environment with ''printenv'' command.  Refer to [http://www.denx.de/wiki/U-Boot/Documentation U-Boot manual] for details.
+
#: '''Note:''' You can always see the environment with ''printenv'' command.  Refer to [http://www.denx.de/wiki/U-Boot/Documentation U-Boot manual] for details.
</li>
+
# Verify the connection over Ethernet from U-Boot:
 
+
#: <syntaxhighlight lang="text">
<li>
 
Verify the connection over Ethernet from U-Boot:
 
<pre>
 
 
ping <your-computer-ip>
 
ping <your-computer-ip>
</pre>
+
</syntaxhighlight>
You should see:
+
#: You should see:
<pre>
+
#: <syntaxhighlight lang="text">
=> ping 192.168.1.2  
+
=> ping 192.168.1.2
 
ravb:0 is connected to ravb.  Reconnecting to ravb
 
ravb:0 is connected to ravb.  Reconnecting to ravb
 
ravb Waiting for PHY auto negotiation to complete.. done
 
ravb Waiting for PHY auto negotiation to complete.. done
Line 450: Line 360:
 
Using ravb device
 
Using ravb device
 
host 192.168.1.2 is alive
 
host 192.168.1.2 is alive
</pre>
+
</syntaxhighlight>
</li>
+
# Reset the board by pushing reset button
 
+
#: Refer to [[R-Car/Boards/H3SK#Power_on_the_board_and_go_to_U-Boot_prompt|H3SK board page]], [[R-Car/Boards/M3SK#Power_on_the_board_and_go_to_U-Boot_prompt|M3SK board page]] for more information.
<li>
+
# The board should boot the kernel:
Reset the board by pushing reset button
+
#: <syntaxhighlight lang="text">
<br/>
 
Refer to [[R-Car/Boards/H3SK#Power_on_the_board_and_go_to_U-Boot_prompt|H3SK board page]], [[R-Car/Boards/M3SK#Power_on_the_board_and_go_to_U-Boot_prompt|M3SK board page]] for more information.
 
</li>
 
 
 
<li>
 
The board should boot the kernel:
 
<pre>
 
 
NOTICE:  BL2: R-Car Gen3 Initial Program Loader(CA57) Rev.1.0.10
 
NOTICE:  BL2: R-Car Gen3 Initial Program Loader(CA57) Rev.1.0.10
 
NOTICE:  BL2: PRR is R-Car H3 ES1.0
 
NOTICE:  BL2: PRR is R-Car H3 ES1.0
Line 567: Line 470:
  
 
Starting kernel ...                                                                                                                         
 
Starting kernel ...                                                                                                                         
</pre>
+
</syntaxhighlight>
</li>
 
</ol>
 
  
==How to prepare and boot from eMMC/SD card==
+
=== Loading kernel and rootfs via eMMC/SD card ===
 +
This section describes steps that are necessary for preparing and booting from 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:
 +
# Partion your SD card to set 1 partition and ID=83 (Linux)
 +
#: Make sure the SD card doesn't contain any important files.
 +
#: <span style="color:#ff0000">'''WARNING!''' These steps may erase the SD card completely. All files my be lost.</span>
 +
#: <syntaxhighlight lang="bash">
 +
$ fdisk /dev/mmcblk0
 +
-> d
 +
-> n
 +
-> p
 +
-> 1
 +
-> t
 +
-> 83
 +
</syntaxhighlight>
 +
# Format this partition to ext3 (or ext4)
 +
#: <syntaxhighlight lang="bash">
 +
$ mkfs.ext3 /dev/mmcblk0p1
 +
</syntaxhighlight>
 +
# Mount this partition on your host to any directory and upack the core-image-weston-*.tar.bz2 into mounted folder. And Copy Image and Image-r8a7795-h3ulcb.dtb (for ws2.0 silicon) and/or Image-r8a7795-h3ulcb-4x2g.dtb (for RTP0RC77951SKBX010SA03(DDR 8GiB)) and/or Image-r8a7795-es1-h3ulcb.dtb (for ws1.1) from $WORK/build/tmp/deploy/images/h3ulcb/ to sd card /boot.  In case of m3ulcb copy dtb from $WORK/build/tmp/deploy/images/m3ulcb/.
 +
#: <syntaxhighlight lang="bash">
 +
$ 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
 +
$ cp $WORK/build/tmp/deploy/images/h3ulcb/XXXX.dtb /mnt/boot/
 +
</syntaxhighlight>
 +
#: NOTE: probably you need to be a root user, hence use "sudo"
  
===Preparing eMMC/SD card===
+
==== Configure U-Boot to boot from SD card ====
In order to prepare you SD card, follow these instructions on host machine:
+
* Proper U-Boot command to boot from SD:
 
+
*: <syntaxhighlight lang="text">
1. Partion your SD card to set 1 partition and ID=83 (Linux)
+
# setenv bootargs 'rw root=/dev/mmcblk1p1 rootwait'
<br/>
+
# ext2load mmc 0:1 0x48080000 /boot/Image
Make sure the SD card doesn't contain any important files.
+
# ext2load mmc 0:1 0x48000000 /boot/Image-r8a7795-h3ulcb.dtb
<br/>
+
# booti 0x48080000 - 0x48000000
<span style="color:#ff0000">'''WARNING!''' These steps may erase the SD card completely. All files my be lost.</span>
+
</syntaxhighlight>
 
+
*: Note from user:
$ fdisk /dev/mmcblk0
+
*::When I created my image with mkfs.ext3, and booted with rootfstype=ext3, the kernel could not find mount the filesystem.
-> d
+
*:: The kernel boot gave an error message:
-> n
+
*::: "EXT4-fs (mmcblk1p1): couldn't mount as ext3 due to feature incompatibilities".
-> p
+
*:: I switched to 'rootfstype=ext4' in my bootargs, and the kernel booted OK.
-> 1
+
* Example of U-Boot environment variables:
-> t
+
*: <syntaxhighlight lang="text">
-> 83
+
baudrate=115200
 
+
bootargs_emmc=rw root=/dev/mmcblk0p1 rootwait
2. Format this partition to ext3 (or ext4)
+
bootargs_nfs=rw root=/dev/nfs rootwait ip=dhcp
 
+
bootargs_sd0=rw root=/dev/mmcblk1p1 rootwait
$ mkfs.ext3 /dev/mmcblk0p1
+
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
3. Mount this partition on your host to any directory and upack the core-image-weston-*.tar.bz2 into mounted folder.
+
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
$ mount /dev/mmcblk0p1 /mnt
+
bootdelay=3
$ cd <your_yocto_build_directory>
+
booti_cmd=booti 0x48080000 - 0x48000000
$ tar xfj  build/tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb-*.rootfs.tar.bz2  -C /mnt
+
dtb=Image-r8a7795-h3ulcb.dtb
 
+
ethact=ravb
NOTE: probably you need to be a root user, hence use "sudo"
+
ethaddr=2E:09:0A:00:BE:11
 
+
fdt_high=0xffffffffffffffff
===Configure U-Boot to boot from SD card===
+
initrd_high=0xffffffffffffffff
 
+
stderr=serial
Proper U-Boot command to boot from SD:
+
stdin=serial
# setenv bootargs 'rw root=/dev/mmcblk1p1 rootfstype=ext3 rootwait'
+
stdout=serial
# ext2load mmc 0:1 0x48080000 /boot/Image
+
ver=U-Boot 2015.04 (Sep 23 2016 - 13:45:29)<br>
# ext2load mmc 0:1 0x48000000 /boot/Image-r8a7795-h3ulcb.dtb
+
Environment size: 1092/131068 bytes
# booti 0x48080000 - 0x48000000
+
</syntaxhighlight>
 
+
* To verify the SD card, type the following in U-Boot prompt:
Note from user: When I created my image with mkfs.ext3, and booted with rootfstype=ext3, the kernel could not
+
*: <syntaxhighlight lang="text">
find mount the filesystem. The kernel boot gave an error message:
+
=> mmc dev 0  
"EXT4-fs (mmcblk1p1): couldn't mount as ext3 due to feature incompatibilities".
+
switch to partitions #0, OK
I switched to 'rootfstype=ext4' in my bootargs, and the kernel booted OK.
+
mmc0 is current device
 
+
=> mmc info
Example of U-Boot environment variables:
+
Device: sh-sdhi
baudrate=115200
+
Manufacturer ID: 3
bootargs_emmc=rw root=/dev/mmcblk0p1 rootfstype=ext3 rootwait
+
OEM: 5344
bootargs_nfs=rw root=/dev/nfs rootwait ip=dhcp
+
Name: SL64G  
bootargs_sd0=rw root=/dev/mmcblk1p1 rootfstype=ext3 rootwait
+
Tran Speed: 50000000
bootcmd=run bootcmd_sd0
+
Rd Block Len: 512
bootcmd_emmc=set bootargs ${bootargs_emmc};ext2load mmc 1:1 0x48080000 /boot/Image;ext2load mmc 1:1 0x48000000 /boot/${dtb};run booti_cmd
+
SD version 3.0
bootcmd_nfs=set bootargs ${bootargs_nfs};bootp 0x48080000 Image;tftp 0x48000000 ${dtb};run booti_cmd
+
High Capacity: Yes
bootcmd_sd0=set bootargs ${bootargs_sd0};ext2load mmc 0:1 0x48080000 /boot/Image;ext2load mmc 0:1 0x48000000 /boot/${dtb};run booti_cmd
+
Capacity: 59.5 GiB
bootdelay=3
+
Bus Width: 4-bit
booti_cmd=booti 0x48080000 - 0x48000000
+
Erase Group Size: 512 Bytes
dtb=Image-r8a7795-h3ulcb.dtb
+
=> ext2ls mmc 0:1 /boot
ethact=ravb
+
<DIR>      4096 .
ethaddr=2E:09:0A:00:BE:11
+
<DIR>      4096 ..
fdt_high=0xffffffffffffffff
+
<SYM>        32 Image
initrd_high=0xffffffffffffffff
+
        14039040 Image-4.9.0-yocto-standard
stderr=serial
+
          69584 Image-r8a7795-h3ulcb.dtb
stdin=serial
+
</syntaxhighlight>
stdout=serial
 
ver=U-Boot 2015.04 (Sep 23 2016 - 13:45:29)<br>
 
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.9.0-yocto-standard
 
            69584 Image-r8a7795-h3ulcb.dtb
 
 
 
== Build scripts examples ==
 
<ol>
 
 
 
<li> Build preparation
 
<ol>
 
<li> For Yocto v2.23.1
 
<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
 
 
 
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-renesas
 
export PATCH_DIR=meta-rcar-gen3/docs/sample/patch/patch-for-linaro-gcc
 
patch -p1 < ${PATCH_DIR}/0001-rcar-gen3-add-readme-for-building-with-Linaro-Gcc.patch
 
unset PATCH_DIR
 
 
 
cd $WORK/
 
PKGS_DIR=$WORK/../proprietary
 
cd $WORK/meta-renesas
 
#sh meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh -f $PKGS_DIR
 
sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $PKGS_DIR
 
</pre>
 
</li>
 
</ol>
 
<ol>
 
<li> For Yocto v3.4
 
<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
 
 
 
cd $WORK/poky
 
git checkout -b tmp 16e22f3e37788afb83044f5089d24187d70094bd
 
cd $WORK/meta-linaro
 
git checkout -b tmp 30f0f5e158ba29c4b1ccfdd66f0368726e4179e0
 
cd $WORK/meta-openembedded
 
git checkout -b tmp 6e3fc5b8d904d06e3aa77e9ec9968ab37a798188
 
cd $WORK/meta-renesas
 
git checkout -b tmp 0f4c656f1e8304ce13f43b07907fac5d9b281e4f
 
 
 
cd $WORK/meta-renesas
 
export PATCH_DIR=meta-rcar-gen3/docs/sample/patch/patch-for-linaro-gcc
 
patch -p1 < ${PATCH_DIR}/0001-rcar-gen3-add-readme-for-building-with-Linaro-Gcc.patch
 
unset PATCH_DIR
 
 
 
cd $WORK/
 
PKGS_DIR=$WORK/../proprietary
 
cd $WORK/meta-renesas
 
#sh meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh -f $PKGS_DIR
 
sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $PKGS_DIR
 
</pre>
 
</li>
 
</ol>
 
</li>
 
 
 
<li> Building yocto for H3ULCB board
 
<ol>
 
<li> For Yocto v2.23.1
 
<pre>
 
#!/bin/sh
 
 
 
cd build
 
WORK=`pwd`
 
echo $WORK
 
 
 
cd $WORK
 
source poky/oe-init-build-env
 
 
 
#cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/linaro-gcc/bsp/*.conf ./conf/.
 
#cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/linaro-gcc/gfx-only/*.conf ./conf/.
 
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/h3ulcb/linaro-gcc/mmp/*.conf ./conf/.
 
 
 
cd $WORK/build
 
cp conf/local-wayland.conf conf/local.conf
 
echo "DISTRO_FEATURES_append = \" use_eva_pkg\"" >> $WORK/build/conf/local.conf
 
 
 
bitbake core-image-weston
 
</pre>
 
</li>
 
</ol>
 
<ol>
 
<li> For Yocto v3.4
 
<pre>
 
#!/bin/sh
 
 
 
cd build
 
WORK=`pwd`
 
echo $WORK
 
 
 
cd $WORK
 
source poky/oe-init-build-env
 
 
 
#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
 
 
 
bitbake core-image-weston
 
</pre>
 
</li>
 
</ol>
 
</li>
 
 
 
</ol>
 
  
 
== FAQ ==
 
== FAQ ==
Line 800: Line 568:
  
 
=== How do I increase USB bandwidth ===
 
=== How do I increase USB bandwidth ===
<ol>
+
# Download:
 
+
#: M3SK [[File:M3v10_usb20_iso_mode.zip]]<br>
<li> Download:<br>
+
#: H3SK WS1.1 (RTP0RC7795SKBX0010SA00) [[File:H3v11_usb20_iso_mode.zip]]<br>
M3SK [[File:M3v10_usb20_iso_mode.zip]]<br>
+
#: H3SK WS2.0 (RTP0RC77951SKBX010SA00) [[File:H3v20_usb20_iso_mode.zip]]<br>
H3SK WS1.1 (RTP0RC7795SKBX0010SA00) [[File:H3v11_usb20_iso_mode.zip]]<br>
+
# Setting
H3SK WS2.0 (RTP0RC77951SKBX010SA00) [[File:H3v20_usb20_iso_mode.zip]]<br>
+
#: <syntaxhighlight lang="bash">
</li>
+
# <Install Driver>
 
 
<li> Setting
 
<pre>
 
<Install Driver>
 
 
$ modprobe qos
 
$ modprobe qos
<Change directory to csv path>
+
# <Change directory to csv path>
 
$ cd /path_to_csv
 
$ cd /path_to_csv
<Store QoS parameters to QoS SRAM>
+
# <Store QoS parameters to QoS SRAM>
 
$ qos_tp setall file.csv
 
$ qos_tp setall file.csv
<Reflect Qos SRAM to QoS controller>
+
# <Reflect Qos SRAM to QoS controller>
 
$ qos_tp switch
 
$ qos_tp switch
</pre>
+
</syntaxhighlight>
</li>
+
=== How do access to USB memory from U-boot(Yocto v3.13.0 or later)===
 +
# Some USB memory may not be recognized.
 +
#: <syntaxhighlight lang="text">
 +
=> usb start
 +
starting USB...
 +
USB0:  USB EHCI 1.10
 +
scanning bus 0 for devices... EHCI timed out on TD - token=0x80008d80
  
</ol>
+
      USB device not accepting new address (error=80000000)
 +
1 USB Device(s) found
 +
      scanning usb for storage devices... 0 Storage Device(s) found
 +
=>
 +
</syntaxhighlight>
 +
# [How to fix] Set the "usb_pgood_delay 2000" variable
 +
#: <syntaxhighlight lang="text">
 +
=> setenv usb_pgood_delay 2000
 +
=> saveenv
 +
=> reset
 +
=> usb start
 +
</syntaxhighlight>
  
 
== Known issues and limitations ==
 
== Known issues and limitations ==
<ol>
+
# [SW limitation] Yocto v3.4.0 or later doesn't support RTP0RC7795SKBX0010SA00(H3 v1.1 Starter Kit).
<li> [SW limitation] Yocto v3.4 or later don't support RTP0RC7795SKBX0010SA00(H3 v1.1 Starter Kit).<br/>
+
#: Please use the H3 v2.0 or v3.0 SK
Please use the H3 v2.0 SK<br/>
+
# [Known issue] If you encounter a kernel hang-up while using Yocto v3.4.0 or later, please refer to the following pages.
<br/>
+
#: H3 SK: No.1 of [[R-Car/Boards/H3SK#Known_Issues]]
* Please apply the following patche by a self-responsibility when you want to use H3 v1.1 SK by all means.<br/>
+
#: M3 SK: No.2 of [[R-Car/Boards/M3SK#Known_Issues]]
** [[File:Delete-CPUIdle-CA53-of-H3es1-for-Yocto_v3.zip]]<br>
 
<br/>
 
</li>
 

Revision as of 23:23, 2 June 2020

This page contains information on building and running Yocto on:

NOTE: USE OFFICIAL DOCUMENTATION provided with R-Car BSPs FOR H3SK/M3SK boards

Yocto versions

Poky-2.4.3 is supported with Yocto v3.21.0.
Specific commit of meta-openembedded is required.

Host PC

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

Preliminary steps

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

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

Building the BSP for Renesas H3 Starter Kit, M3 Starter Kit

NOTE: to have ADAS View and HAD Solution kits supported follow instructions: R-Car Yocto Gen3 ADAS

Build using script

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

  1. Directory Structure
    |--build.sh
    `--proprietary
       |--R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20190722.zip
       `--R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20190722.zip
    
  2. Build script(build.sh)
    #!/bin/bash
    
    #Set the target board
    TARGET_BOARD=h3ulcb
    #TARGET_BOARD=m3ulcb
    
    # Create a directory and switch to it
    mkdir $TARGET_BOARD
    cd $TARGET_BOARD
    WORK=`pwd`
    echo $WORK
    
    # Clone basic Yocto layers in parallel
    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 &
    
    # Wait for all clone operations
    wait
    
    # Switch to proper branches/commits
    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 59e8d5674348e2b3d14ac4552231809ab10ab84e
    
    # Populate meta-renesas with proprietary software packages
    cd $WORK/meta-renesas
    sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $WORK/../proprietary
    
    cd $WORK
    source poky/oe-init-build-env $WORK/build
    
    #cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/bsp/*.conf ./conf/.
    #cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/gfx-only/*.conf ./conf/.
    cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/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
    
    bitbake core-image-weston
    
  3. build
    ./build.sh
    
    If the build completes successfully, all the necessary files are generated in a following directory:
    ./build/build/tmp/deploy/images/<target_board_name>
    

Build using manual steps

  1. Create a directory and switch to it
    Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.
    mkdir build
    cd build
    export WORK=`pwd`
    
  2. Clone basic Yocto layers:
    cd $WORK
    git clone git://git.yoctoproject.org/poky
    git clone git://git.openembedded.org/meta-openembedded
    git clone git://git.linaro.org/openembedded/meta-linaro.git
    git clone git://github.com/renesas-rcar/meta-renesas
    
  3. Switch to proper branches/commits (2020/02/20 updated)
    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 59e8d5674348e2b3d14ac4552231809ab10ab84e # <= 2020/02/20 updated
    
    Another versions are not tested for compatibility.
    Legacy BSP instruction can be found here R-Car Yocto Gen3 legacy
  4. Download proprietary driver modules to $WORK/proprietary folder
    You should see the following files:
    $ ls -1 $WORK/proprietary/*.zip
    R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20190722.zip
    R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20190722.zip
    
  5. 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
    
  6. Setup build environment
    cd $WORK
    source poky/oe-init-build-env $WORK/build
    
  7. Prepare default configuration files.
    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
    
  8. (Edit $WORK/build/conf/local.conf to enable/disable graphics and multimedia proprietary drivers support)
  9. Edit local.conf with evaluation packages requirements:
    DISTRO_FEATURES_append = " use_eva_pkg"
    
  10. Start the build
    bitbake core-image-weston
    
  11. 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.
  12. 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-r8a7795-es1-h3ulcb.dtb
    ./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-4x2g.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.
  13. You can now proceed with running Yocto images

Build SDK

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

Running Yocto images

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-h3ulcb-4x2g.dtb (for RTP0RC77951SKBX010SA03(DDR 8GiB)) 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-es1-h3ulcb.dtb /srv/tftp/
    cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb /srv/tftp/
    cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-4x2g.dtb /srv/tftp/
    
    Fedora
    cp $WORK/build/tmp/deploy/images/h3ulcb/Image /var/lib/tftpboot/
    cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-es1-h3ulcb.dtb /var/lib/tftpboot/
    cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb /var/lib/tftpboot/
    cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-4x2g.dtb /var/lib/tftpboot/
    
    Which version is my H3SK board?
  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=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/m3ulcb	*(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/m3ulcb *
    
  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 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 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 ...
    

Loading kernel and rootfs via 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. And Copy Image and Image-r8a7795-h3ulcb.dtb (for ws2.0 silicon) and/or Image-r8a7795-h3ulcb-4x2g.dtb (for RTP0RC77951SKBX010SA03(DDR 8GiB)) and/or Image-r8a7795-es1-h3ulcb.dtb (for ws1.1) from $WORK/build/tmp/deploy/images/h3ulcb/ to sd card /boot. In case of m3ulcb copy dtb from $WORK/build/tmp/deploy/images/m3ulcb/.
    $ 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
    $ cp $WORK/build/tmp/deploy/images/h3ulcb/XXXX.dtb /mnt/boot/
    
    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 rootwait'
    # ext2load mmc 0:1 0x48080000 /boot/Image
    # ext2load mmc 0:1 0x48000000 /boot/Image-r8a7795-h3ulcb.dtb
    # booti 0x48080000 - 0x48000000
    
    Note from user:
    When I created my image with mkfs.ext3, and booted with rootfstype=ext3, the kernel could not find mount the filesystem.
    The kernel boot gave an error message:
    "EXT4-fs (mmcblk1p1): couldn't mount as ext3 due to feature incompatibilities".
    I switched to 'rootfstype=ext4' in my bootargs, and the kernel booted OK.
  • Example of U-Boot environment variables:
    baudrate=115200
    bootargs_emmc=rw root=/dev/mmcblk0p1 rootwait
    bootargs_nfs=rw root=/dev/nfs rootwait ip=dhcp
    bootargs_sd0=rw root=/dev/mmcblk1p1 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)<br>
    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.9.0-yocto-standard
               69584 Image-r8a7795-h3ulcb.dtb
    

FAQ

Discussion site

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

How do I increase USB bandwidth

  1. Download:
    M3SK File:M3v10 usb20 iso mode.zip
    H3SK WS1.1 (RTP0RC7795SKBX0010SA00) File:H3v11 usb20 iso mode.zip
    H3SK WS2.0 (RTP0RC77951SKBX010SA00) File:H3v20 usb20 iso mode.zip
  2. Setting
    # <Install Driver>
    $ modprobe qos
    # <Change directory to csv path>
    $ cd /path_to_csv
    # <Store QoS parameters to QoS SRAM>
    $ qos_tp setall file.csv
    # <Reflect Qos SRAM to QoS controller>
    $ qos_tp switch
    

How do access to USB memory from U-boot(Yocto v3.13.0 or later)

  1. Some USB memory may not be recognized.
    => usb start
    starting USB...
    USB0:   USB EHCI 1.10
    scanning bus 0 for devices... EHCI timed out on TD - token=0x80008d80
    
          USB device not accepting new address (error=80000000)
    1 USB Device(s) found
           scanning usb for storage devices... 0 Storage Device(s) found
    =>
    
  2. [How to fix] Set the "usb_pgood_delay 2000" variable
    => setenv usb_pgood_delay 2000
    => saveenv
    => reset
    => usb start
    

Known issues and limitations

  1. [SW limitation] Yocto v3.4.0 or later doesn't support RTP0RC7795SKBX0010SA00(H3 v1.1 Starter Kit).
    Please use the H3 v2.0 or v3.0 SK
  2. [Known issue] If you encounter a kernel hang-up while using Yocto v3.4.0 or later, please refer to the following pages.
    H3 SK: No.1 of R-Car/Boards/H3SK#Known_Issues
    M3 SK: No.2 of R-Car/Boards/M3SK#Known_Issues