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

From eLinux.org
Jump to: navigation, search
(initial)
 
(Building the BSP for Renesas H3 Starter Kit, M3 Starter Kit)
(166 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 +
{{Template:R-Car-Gen3-Navbox}}
 
{{TOC right}}
 
{{TOC right}}
This page contains information on building and running Yocto on [[R-Car/Boards/SILK | Renesas R-Car E2 SILK]], [[R-Car/Boards/Porter|Renesas R-Car M2 Porter]] and [[R-Car/Boards/Stout|Renesas R-Car H2 Stout]] boards.
+
[[Category:R-Car]]
 +
[[Category:R-Car Gen3]]
  
== Yocto versions ==
+
== Introduction ==
[http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-1.6.1 Poky-1.6.1] is supported. Specific commit of meta-openembedded is required.
+
This page contains information on building and running Yocto on:
 +
* [[R-Car/Boards/H3SK | Renesas R-Car-H3 Starter Kit Premier]] (unofficial name - H3ULCB)
 +
* [[R-Car/Boards/M3SK | Renesas R-Car-M3 Starter Kit Pro]] (unofficial name - M3ULCB)
 +
** https://www.renesas.com/us/en/products/automotive-products/automotive-system-chips-socs/r-car-h3-m3-starter-kit
 +
'''NOTE: USE OFFICIAL DOCUMENTATION provided with R-Car BSPs FOR H3SK/M3SK boards'''
 +
<br/>
 +
See also:
 +
* Latest version [[R-Car/Boards/Yocto-Gen3 ]]
 +
* Stable version [[R-Car/Boards/Yocto-Gen3-stable ]]
 +
 
 +
== Topic ==
 +
{{Template:R-Car-Gen3-SK-Topic}}
 +
 
 +
== Software revisions ==
  
== Preliminary steps ==
+
{| class="wikitable"
<ol>
+
|-
<li>Download proprietary graphics and multimedia drivers from Renesas. Evaluation version is available at http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp<br/>
+
! Software !! Revision
Graphic drivers are required for X11 and Wayland. Multimedia drivers are optional.<br/>
+
|-
<br/>
+
| Yocto Project || [http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-2.4.3 2.4.3]
</li>
+
|-
 +
| Toolchain gcc-poky || 7.3
 +
|-
 +
| Wayland/Weston || 1.13.0/2.0.0
 +
|-
 +
| GStreamer || 1.12.2
 +
|-
 +
| Kernel Ver || LTSI 4.14.75
 +
|-
 +
| Userland 64/32bit || 64
 +
|-
 +
| U-Boot || 2018.09
 +
|-
 +
| OP_TEE || 3.1.0
 +
|-
 +
| OpenGL ES || 3.2
 +
|-
 +
|}
 +
 
 +
== Host PC ==
 +
Ubuntu 16.04 LTS (64bit) is recommended as OS. 32bit version is not supported. <br/>
  
<li> Install required packages
+
== Required packages ==
===== Ubuntu and Debian =====
+
# Download evaluation version of proprietary graphics and multimedia drivers from Renesas.
<pre>
+
#: To download Multimedia and Graphics library and related Linux drivers, please use the following link:
 +
#:: https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-h2-m2-e2-documents-software
 +
#: 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
 +
#: <br/>
 +
#: Graphic drivers are required for Wayland. Multimedia drivers are optional.
 +
# Install required packages
 +
#: '''Ubuntu and Debian'''
 +
#:: <syntaxhighlight lang="bash">
 
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
+
     build-essential chrpath socat libsdl1.2-dev xterm python-crypto cpio python python3 \
</pre>
+
    python3-pip python3-pexpect xz-utils debianutils iputils-ping libssl-dev
===== Fedora =====
+
</syntaxhighlight>
<pre>
+
#: '''Fedora'''
 +
#:: <syntaxhighlight lang="bash">
 
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 \
</pre>
+
    ghc-lzma-conduit iputils openssl
Refer to [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html#packages Yocto Project Quick Start] for more information.
+
</syntaxhighlight>
</li>
+
#: Refer to [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html#packages Yocto Project Quick Start] for more information.
</ol>
 
  
== Building the BSP for Renesas R-Car SILK, Porter and Stout ==
+
== Building the BSP for Renesas H3 Starter Kit, M3 Starter Kit ==
<ol>
+
NOTE: to have ADAS View and HAD Solution kits supported follow instructions: [[R-Car/Boards/Yocto-Gen3-ADAS | R-Car Yocto Gen3 ADAS]]
<li>Create a directory and switch to it <br/>
+
 
Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.
+
=== Build using script ===
<pre>
+
This example is for H3ULCB board.<br/>
export WORK=<path-to-your-build-directory>
+
If you use other board, you need to modify the script.<br/>
mkdir $WORK
+
# Directory Structure
cd $WORK
+
#: <syntaxhighlight lang="bash">
</pre>
+
|--build.sh
</li>
+
`--proprietary
<li>Clone basic Yocto layers:
+
  |--R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20190722.zip
<pre>
+
  `--R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20190722.zip
cd $WORK
+
</syntaxhighlight>
git clone git://git.yoctoproject.org/poky
+
# Build script(build.sh)
git clone git://git.openembedded.org/meta-openembedded
+
#: <syntaxhighlight lang="bash">
git clone git://git.linaro.org/openembedded/meta-linaro.git
+
#!/bin/bash
</pre>
+
 
</li>
+
#Set the target board
<li>
+
TARGET_BOARD=h3ulcb
Switch to proper branches/commits
+
#TARGET_BOARD=m3ulcb
<pre>
+
 
 +
# 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
 
cd $WORK/poky
git checkout -b tmp yocto-1.6.1
+
git checkout -b tmp 7e7ee662f5dea4d090293045f7498093322802cc
 
cd $WORK/meta-openembedded
 
cd $WORK/meta-openembedded
git checkout -b tmp dca466c074c9a35bc0133e7e0d65cca0731e2acf
+
git checkout -b tmp 352531015014d1957d6444d114f4451e241c4d23
 
cd $WORK/meta-linaro
 
cd $WORK/meta-linaro
git checkout -b tmp 8a0601723c06fdb75e62aa0f0cf15fc9d7d90167
+
git checkout -b tmp 75dfb67bbb14a70cd47afda9726e2e1c76731885
</pre>
+
cd $WORK/meta-renesas
Another versions are not tested for compatibility.
+
git checkout -b tmp a1ecd935b70b6c81b6fab807c43af9b888cb81cf
</li>
+
 
 +
# 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
  
<li>
 
Clone Renesas BSP layer and switch to the proper branch:
 
<pre>
 
 
cd $WORK
 
cd $WORK
git clone git://github.com/CogentEmbedded/meta-renesas.git
+
source poky/oe-init-build-env $WORK/build
cd meta-renesas
 
git checkout -b tmp origin/v1.10.0
 
</pre>
 
</li>
 
  
<li>
+
#cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/bsp/*.conf ./conf/.
Download proprietary driver modules from http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp and unzip them to $WORK/proprietary folder.<br/>
+
#cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/gfx-only/*.conf ./conf/.
You should see the following files:
+
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/mmp/*.conf ./conf/
<pre>
 
[builduser@builduser meta-renesas-lcb]$ ls -lh $WORK/proprietary
 
total 8.1M
 
-rw-r--r-- 1 builduser builduser 5.8M Dec 28 17:21 R-Car_Series_Evaluation_Software_Package_for_Linux-20151228.tar.gz
 
-rw-r--r-- 1 builduser builduser 2.3M Dec 28 17:21 R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-20151228.tar.gz
 
</pre>
 
</li>
 
<li>
 
Populate meta-renesas with graphics drivers.
 
<pre>
 
cd $WORK/meta-renesas/meta-rcar-gen2
 
./copy_gfx_software_<board>.sh ../../proprietary
 
</pre>
 
</li>
 
<li>
 
Populate meta-renesas with multimedia drivers.
 
<pre>
 
cd $WORK/meta-renesas/meta-rcar-gen2
 
./copy_mm_software_lcb.sh ../../proprietary
 
</pre>
 
</li>
 
  
<li>
+
cd $WORK/build
Setup build environment
+
cp conf/local-wayland.conf conf/local.conf
<pre>
+
echo 'DISTRO_FEATURES_append = " use_eva_pkg"' >> $WORK/build/conf/local.conf
cd $WORK
 
source poky/oe-init-build-env
 
</pre>
 
</li>
 
  
<li>
+
bitbake core-image-weston
Prepare default configuration files.
 
<pre>
 
cd $WORK/meta-renesas/meta-rcar-gen2/templates/<board>
 
cp bblayers.conf $WORK/build/conf/bblayers.conf
 
</pre>
 
For weston/wayland:
 
<pre>
 
cp local-wayland.conf $WORK/build/conf/local.conf
 
</pre>
 
For X11:
 
<pre>
 
cp local-x11.conf $WORK/build/conf/local.conf
 
</pre>
 
<li>
 
Edit $WORK/build/conf/local.conf to enable/disable graphics and multimedia proprietary drivers support
 
</li>
 
'''For Stout board only:'''<br />
 
  
<ol>
+
</syntaxhighlight>
<li>
+
# build
Edit local.conf to select version of OpenGL ES:
+
#: <syntaxhighlight lang="bash">
<pre>
+
./build.sh
OPENGLES3 = “0” (use “1” for OpenGL ES3.0, or “0” for OpenGL ES2.0)
+
</syntaxhighlight>
</pre>
+
#: If the build completes successfully, all the necessary files are generated in a following directory:
</li>
+
#:: <syntaxhighlight lang="text">
<li>
+
./<target_board_name>/build/tmp/deploy/images/<target_board_name>
Edit local.conf to select IO configuration (by default only stout cpu board peripherals are enabled):
+
</syntaxhighlight>
<pre>
 
MACHINE_FEATURES_append = " stout-full" (use this append for full IO configuration)
 
</pre>
 
or
 
<pre>
 
MACHINE_FEATURES_append = " stout-view" (use this append for view IO configuration)
 
</pre>
 
or
 
<pre>
 
MACHINE_FEATURES_append = " stout-had" (use this append for HAD IO configuration)
 
</pre>
 
</li>
 
</ol>
 
  
</li>
+
=== Build using manual steps ===
 
+
# Create a directory and switch to it
<li>
+
#: Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.
Start the build <br />
+
#: <syntaxhighlight lang="bash">
For weston/wayland:
+
mkdir build
<pre>
+
cd build
 +
export WORK=`pwd`
 +
</syntaxhighlight>
 +
# Clone basic Yocto layers:
 +
#: <syntaxhighlight lang="bash">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
 +
</syntaxhighlight>
 +
# Switch to proper branches/commits <span style="color:#ff0000;">(2021/07/15 updated)</span>
 +
#: <syntaxhighlight lang="bash">
 +
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 a1ecd935b70b6c81b6fab807c43af9b888cb81cf# <= 2021/07/15 updated
 +
</syntaxhighlight>
 +
#: 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]]
 +
# Download proprietary driver modules to $WORK/proprietary folder
 +
#: You should see the following files:
 +
#: <syntaxhighlight lang="bash">
 +
$ 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
 +
</syntaxhighlight>
 +
# Populate meta-renesas with proprietary software packages.
 +
#: <syntaxhighlight lang="bash">
 +
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
 +
</syntaxhighlight>
 +
# Setup build environment
 +
#: <syntaxhighlight lang="bash">
 +
cd $WORK
 +
source poky/oe-init-build-env $WORK/build
 +
</syntaxhighlight>
 +
# Prepare default configuration files.
 +
#: <syntaxhighlight lang="bash">
 +
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
 +
</syntaxhighlight>
 +
# (Edit $WORK/build/conf/local.conf to enable/disable graphics and multimedia proprietary drivers support)
 +
# Edit local.conf with evaluation packages requirements:
 +
#: <syntaxhighlight lang="bash">
 +
DISTRO_FEATURES_append = " use_eva_pkg"
 +
</syntaxhighlight>
 +
# Start the build
 +
#: <syntaxhighlight lang="bash">
 
bitbake core-image-weston
 
bitbake core-image-weston
</pre>
+
</syntaxhighlight>
For X11:
+
# 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>
+
#: <syntaxhighlight lang="bash">
bitbake core-image-x11
 
</pre>
 
</li>
 
 
 
<li>
 
Building image can take upto a few hours depending on your host system performance.<br>
 
After the build has been completed successfuly, 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">
 +
$ 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
 +
</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.
 +
# You can now proceed with running Yocto images
  
<li>
+
== Build SDK ==
Bitbake has generated all the necessary files in ./tmp/deploy/images directory. <br/>
+
* After building BSP you may build SDK:
You can verify its content:
+
*: <syntaxhighlight lang="text">bitbake core-image-weston -c populate_sdk</syntaxhighlight>
<pre class="bash">
+
* After build finished the SDK installation script may be found in following path:
[builduser]$ ls -lh `find ./tmp/deploy/images/silk/ -maxdepth 1 -type l -print`
+
*: <syntaxhighlight lang="text">tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-toolchain-*.sh</syntaxhighlight>
lrwxrwxrwx. 1 builduser builduser 50 Dec  9 02:47 ./tmp/deploy/images/silk/core-image-x11-silk.manifest -> core-image-x11-silk-20141208223655.builduserfs.manifest
+
* Install SDK by run the following command and follow instructions on the screen:
lrwxrwxrwx. 1 builduser builduser 49 Dec  9 02:47 ./tmp/deploy/images/silk/core-image-x11-silk.tar.bz2 -> core-image-x11-silk-20141208223655.builduserfs.tar.bz2
+
*: <syntaxhighlight lang="text">./tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-toolchain-*.sh</syntaxhighlight>
lrwxrwxrwx. 1 builduser builduser 84 Dec  9 02:43 ./tmp/deploy/images/silk/modules-silk.tgz -> modules--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.tgz
+
* setup environment variables for each compilation on each Host PCs
lrwxrwxrwx. 1 builduser builduser 52 Dec  9 02:46 ./tmp/deploy/images/silk/u-boot.bin -> u-boot-silk-v2013.01.01+gitAUTOINC+74b16badc2-r0.bin
+
*: <syntaxhighlight lang="text">cd (Your working directory)
lrwxrwxrwx. 1 builduser builduser 52 Dec  9 02:46 ./tmp/deploy/images/silk/u-boot-silk.bin -> u-boot-silk-v2013.01.01+gitAUTOINC+74b16badc2-r0.bin
+
source /opt/poky/2.4.3/environment-setup-aarch64-poky-linux
lrwxrwxrwx. 1 builduser builduser 83 Dec  9 02:43 ./tmp/deploy/images/silk/uImage -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.bin
+
export LDFLAGS=””
lrwxrwxrwx. 1 builduser builduser 83 Dec  9 02:43 ./tmp/deploy/images/silk/uImage+dtb -> uImage+dtb--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655
+
${CC} (Your source code).c …..</syntaxhighlight>
lrwxrwxrwx. 1 builduser builduser 91 Dec  9 02:43 ./tmp/deploy/images/silk/uImage-r8a7794-silk.dtb -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-r8a7794-silk-20141208223655.dtb
 
lrwxrwxrwx. 1 builduser builduser 83 Dec  9 02:43 ./tmp/deploy/images/silk/uImage-silk.bin -> uImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655.bin
 
lrwxrwxrwx. 1 builduser builduser 79 Dec  9 02:43 ./tmp/deploy/images/silk/zImage -> zImage--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655
 
lrwxrwxrwx. 1 builduser builduser 83 Dec  9 02:43 ./tmp/deploy/images/silk/zImage+dtb -> zImage+dtb--3.10+git2eba9c2b1f02bec3295b27f8415575da00d5ffce-r0-silk-20141208223655
 
</pre>
 
'''modules-silk.tgz''' is compressed Kernel image, '''core-image-x11-silk.tar.bz2''' is the rootfs, '''modules-silk.tgz''' are kernel modules.
 
</li>
 
<li>
 
You can now [[R-Car/Boards/SILK#Booting over TFTP from U-Boot|boot R-Car E2 SILK board over TFTP and NFS]]
 
</li>
 
</ol>
 
  
== Running Yocto image ==
+
== 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.
 
Linux kernel can be booted from microSD card or from TFTP. Root FS can be mounted from micro SD card or via NFS.
 +
 +
=== Combination of board and dtb file ===
 +
Please refer to [[R-Car/Boards/Yocto-Gen3-CommonFAQ/Which_dtb_file_is_required_to_boot_linux_on_the_R-Car_Starter_Kit_board_%3F | here ]].
  
 
=== 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>
+
cp $WORK/build/tmp/deploy/images/h3ulcb/Image /srv/tftp/
 
+
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-es1-h3ulcb.dtb /srv/tftp/
<li>
+
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb /srv/tftp/
Copy '''uImage''' and '''uImage-r8a7794-silk.dtb''' from $WORK/build/tmp/deploy/images/silk/ to TFTP server root.
+
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-4x2g.dtb /srv/tftp/
==== Ubuntu ====
+
</syntaxhighlight>
<pre>
+
#: ''' Fedora'''
cp $WORK/build/tmp/deploy/images/silk/uImage /srv/tftp/
+
#:: <syntaxhighlight lang="bash">
cp $WORK/build/tmp/deploy/images/silk/uImage-r8a7794-silk.dtb /srv/tftp/
+
cp $WORK/build/tmp/deploy/images/h3ulcb/Image /var/lib/tftpboot/
</pre>
+
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/
==== Fedora ====
+
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-4x2g.dtb /var/lib/tftpboot/
<pre>
+
</syntaxhighlight>
cp $WORK/build/tmp/deploy/images/silk/uImage /var/lib/tftpboot/
+
#: [[R-Car/Boards/H3SK#H3SK_has_several_kinds_of_boards | Which version is my H3SK board?]]
cp $WORK/build/tmp/deploy/images/silk/uImage-r8a7794-silk.dtb /var/lib/tftpboot/
+
# Verify that TFTP server is working.
</pre>
+
#: <syntaxhighlight lang="bash">
</li>
+
tftp localhost -c get Image && ls Image
 
+
</syntaxhighlight>
<li>
+
# Setup NFS server.
Verify that TFTP server is working.
+
#: '''Debian/Ubuntu'''
<pre>
+
## Install necessary packages:
tftp localhost -c get uImage && ls uImage
+
##: <syntaxhighlight lang="bash">
</pre>
 
</li>
 
 
 
<li>
 
Setup NFS server.
 
==== 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 292: Line 325:
 
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">
 
+
IMAGE=weston
<li>
+
MACHINE=h3ulcb|m3ulcb
Export root FS to NFS. (Change IMAGE and MACHINE to fit your build).
 
<ol>
 
<li>
 
Unpack rootfs to a dedicated directory:
 
<pre>
 
IMAGE=weston|x11|sato|directfb
 
MACHINE=silk|porter
 
 
NFS_ROOT=/nfs/${MACHINE}
 
NFS_ROOT=/nfs/${MACHINE}
 
sudo mkdir -p "${NFS_ROOT}"
 
sudo mkdir -p "${NFS_ROOT}"
 
sudo rm -rf "${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}"
+
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/silk *(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/porter *(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/silk *
+
/nfs/h3ulcb *
/nfs/porter *
+
/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.
===== For [[R-Car/Boards/SILK|SILK board]] =====
+
#: 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>
 
Make sure SW9 is on pin 1 side. <br/>
 
[[File:SILKSwitch.png|100px|Switch pin layout]]
 
</li>
 
<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/SILK#Power on the board and go to U-Boot prompt|SILK board page]] for more information.
 
===== For [[R-Car/Boards/Porter|Porter board]] =====
 
<ol>
 
<li>
 
TBD
 
</li>
 
</ol>
 
NOTE: [[R-Car/Boards/Stout|Stout board]] does not have extra switches to select boot device (e.g. primary and secondary/backup QSPI Flash)
 
 
 
</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>
setenv bootcmd 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7794-silk.dtb; bootm 0x40007fc0 - 0x40f00000'
+
setenv bootcmd 'tftp 0x48080000 Image; tftp 0x48000000 Image-r8a7795-h3ulcb.dtb; booti 0x48080000 - 0x48000000'
setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=<your-computer-ip>:<nfs-path>,nfsvers=3 ip=<board-ip>:<your-computer-ip>::255.255.255.0:silk vmalloc=384M'
+
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
setenv bootcmd 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7794-silk.dtb; bootm 0x40007fc0 - 0x40f00000'
+
setenv bootcmd 'tftp 0x48080000 Image; tftp 0x48000000 Image-r8a7795-h3ulcb.dtb; booti 0x48080000 - 0x48000000'
setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=192.168.1.2:/nfs/silk,nfsvers=3 ip=192.168.1.3:192.168.1.2::255.255.255.0:silk vmalloc=384M'
+
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>
The last command writes the configuration to SPI flash.
+
#: You can also use
<pre>
+
#: <syntaxhighlight lang="text">
=> saveenv                                                                                                                                 
 
Saving Environment to SPI Flash...                                                                                                         
 
SF: Detected S25FL512S with page size 256 KiB, total 64 MiB                                                                               
 
Erasing SPI flash...Writing to SPI flash...done
 
</pre>
 
You can also use
 
<pre>
 
 
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
sh_eth Waiting for PHY auto negotiation to complete... done
+
ravb:0 is connected to ravb.  Reconnecting to ravb
sh_eth: 100Base/Full
+
ravb Waiting for PHY auto negotiation to complete.. done
Using sh_eth device
+
ravb: 100Base/Full
 +
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.
 +
# The board should boot the kernel:
 +
#: <syntaxhighlight lang="text">
 +
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)
  
<li>
 
Reset the board by pushing [[R-Car/Boards/SILK:Hardware#Switches and Buttons|SW5 "Reset"]].
 
</li>
 
  
<li>
+
U-Boot 2015.04 (Nov 20 2016 - 00:54:11)
The board should boot the kernel:
 
<pre>
 
SILK SPI_LOADER V0.07c 2014.10.20                                                                                                         
 
DEVICE S25FL512                                                                                                                           
 
                                                                                                                                           
 
                                                                                                                                           
 
U-Boot 2013.01.01-g74b16ba-dirty (Dec 23 2014 - 15:31:50)                                                                                 
 
                                                                                                                                           
 
CPU: Renesas Electronics R8A7794 rev 1.0                                                                                                   
 
Board: Silk Board                                                                                                                         
 
                                                                                                                                           
 
DRAM:  1 GiB                                                                                                                               
 
MMC:  sh_mmcif: 0, sh-sdhi: 1                                                                                                             
 
SF: Detected S25FL512S with page size 256 KiB, total 64 MiB                                                                               
 
In:    serial                                                                                                                             
 
Out:  serial                                                                                                                             
 
Err:  serial                                                                                                                             
 
Net:  sh_eth                                                                                                                             
 
Hit any key to stop autoboot:  0                                                                                                           
 
sh_eth Waiting for PHY auto negotiation to complete... done                                                                               
 
sh_eth: 100Base/Full                                                                                                                       
 
Using sh_eth device                                                                                                                       
 
TFTP from server 192.168.1.2; our IP address is 192.168.1.3                                                                           
 
Filename 'uImage'.                                                                                                                         
 
Load address: 0x40007fc0                                                                                                                   
 
Loading: #################################################################                                                                 
 
        #################################################################                                                                 
 
        #################################################################                                                                 
 
        ##############################################                                                                                   
 
        3.5 MiB/s                                                                                                                         
 
done                                                                                                                                       
 
Bytes transferred = 3525472 (35cb60 hex)                                                                                                   
 
sh_eth:1 is connected to sh_eth.  Reconnecting to sh_eth                                                                                   
 
sh_eth Waiting for PHY auto negotiation to complete... done                                                                               
 
sh_eth: 100Base/Full                                                                                                                       
 
Using sh_eth device                                                                                                                       
 
TFTP from server 192.168.1.2; our IP address is 192.168.1.3                                                                           
 
Filename 'uImage-r8a7794-silk.dtb'.                                                                                                       
 
Load address: 0x40f00000                                                                                                                   
 
Loading: ##                                                                                                                               
 
        3 MiB/s                                                                                                                           
 
done                                                                                                                                       
 
Bytes transferred = 24859 (611b hex)                                                                                                      
 
## Booting kernel from Legacy Image at 40007fc0 ...                                                                                       
 
  Image Name:  Linux-3.10.31-ltsi                                                                                                       
 
  Image Type:  ARM Linux Kernel Image (uncompressed)                                                                                     
 
  Data Size:    3525408 Bytes = 3.4 MiB                                                                                                   
 
  Load Address: 40008000                                                                                                                 
 
  Entry Point:  40008000                                                                                                                 
 
  Verifying Checksum ... OK                                                                                                               
 
## Flattened Device Tree blob at 40f00000                                                                                                 
 
  Booting using the fdt blob at 0x40f00000                                                                                               
 
  XIP Kernel Image ... OK                                                                                                                 
 
OK                                                                                                                                         
 
  Loading Device Tree to 40ef6000, end 40eff11a ... OK                                                                                   
 
                                                                                                                                           
 
Starting kernel ...                                                                                                                       
 
</pre>
 
</li>
 
</ol>
 
  
=== Loading kernel and rootfs from microSD card ===
+
CPU: Renesas Electronics R8A7795 rev 1.0
Both kernel and root FS can be loaded from a microSD card. The approach requires only a console cable. No Ethernet connection is needed.
+
Board: H3ULCB
<ol>
+
I2C:  ready
<li>
+
DRAM:  3.9 GiB
Find a reliable microSD card with an adapter to fit your computer. 4 GB should be enough for the task.
+
MMC:  sh-sdhi: 0, sh-sdhi: 1
</li>
+
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
  
<li>
+
Starting kernel ...                                                                                                                        
Plug the SD card into you computer. Locate the proper device for it, typically '''/dev/mmcblk0'''. Use
+
</syntaxhighlight>
<pre>
 
dmesg | tail
 
</pre>
 
to print latest messages if in doubt.<br/>
 
<span style="color:#ff0000">'''WARNING!''' Be very careful. Do not select you root partition or any other device with important information.  It may be destroyed!</span><br/>
 
Double-check that device name is correct by mounting and examining it's content.
 
</li>
 
 
 
<li>
 
Make sure the SD card doesn't contain any important files.<br/>
 
<span style="color:#ff0000">'''WARNING!''' Next step may erase the SD card completely. All files my be lost.</span>
 
</li>
 
 
 
<li>
 
Format the card with one partition with EXT3 file system.<br/>
 
''TBD Update this page with a script which formats the card''
 
</li>
 
  
<li>
+
=== Loading kernel and rootfs via eMMC/SD card ===
Copy root fs to the sd card:
+
This section describes steps that are necessary for preparing and booting from SD card.
<pre>
 
SD=<path-to-your-device-partition>
 
SD_ROOT=/tmp/sd-tool
 
sudo umount "${SD}"
 
sudo mkdir -p "${SD_ROOT}"
 
sudo mount "${SD}" "${SD_ROOT}"
 
sudo rm -rf "${SD_ROOT}"/*
 
sudo cp "${BUILDDIR}/tmp/deploy/images/${MACHINE}/uImage+dtb" "${SD_ROOT}/boot/"
 
sudo tar -xjf "${BUILDDIR}/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}.tar.bz2" -C "${SD_ROOT}"
 
sudo umount "${SD}"
 
</pre>
 
</li>
 
  
<li>
+
==== Preparing eMMC/SD card ====
Insert the SD card into microSD slot on the board.
+
In order to prepare you SD card, follow these instructions on host machine:
</li>
+
# 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"
  
<li> Boot the board into U-Boot command prompt. Refer to section [[R-Car/Boards/Yocto#Boot into U-Boot command prompt|Boot into U-Boot command prompt]]
+
==== Configure U-Boot to boot from SD card ====
</li>
+
* Proper U-Boot command to boot from SD:
 
+
*: <syntaxhighlight lang="text">
<li>
+
# setenv bootargs 'rw root=/dev/mmcblk1p1 rootwait'
Configure kernel command line in U-Boot:<br/>
+
# ext2load mmc 0:1 0x48080000 /boot/Image
(For Silk board)
+
# ext2load mmc 0:1 0x48000000 /boot/Image-r8a7795-h3ulcb.dtb
<pre>
+
# booti 0x48080000 - 0x48000000
setenv bootcmd 'ext4load mmc 1:1 0x40007fc0 /boot/uImage+dtb; bootm 0x40007fc0'
+
</syntaxhighlight>
setenv bootargs 'console=ttySC10,38400 ignore_loglevel rw rootfstype=ext3 root=/dev/mmcblk0p1 rootwait vmalloc=384M'
+
*: Note from user:
saveenv
+
*::When I created my image with mkfs.ext3, and booted with rootfstype=ext3, the kernel could not find mount the filesystem.
</pre>
+
*:: The kernel boot gave an error message:
(For Porter board)
+
*::: "EXT4-fs (mmcblk1p1): couldn't mount as ext3 due to feature incompatibilities".
<pre>
+
*:: I switched to 'rootfstype=ext4' in my bootargs, and the kernel booted OK.
setenv bootcmd 'ext4load mmc 1:1 0x40007fc0 /boot/uImage+dtb; bootm 0x40007fc0'
+
* Example of U-Boot environment variables:
setenv bootargs 'console=ttySC6,38400 ignore_loglevel rw rootfstype=ext3 root=/dev/mmcblk0p1 rootwait vmalloc=384M'
+
*: <syntaxhighlight lang="text">
saveenv
+
baudrate=115200
</pre>
+
bootargs_emmc=rw root=/dev/mmcblk0p1 rootwait
(For Stout board)
+
bootargs_nfs=rw root=/dev/nfs rootwait ip=dhcp
<pre>
+
bootargs_sd0=rw root=/dev/mmcblk1p1 rootwait
setenv bootcmd 'ext4load mmc 0:1 0x40007fc0 /boot/uImage+dtb; bootm 0x40007fc0'
+
bootcmd=run bootcmd_sd0
setenv bootargs 'console=ttySC0,38400 ignore_loglevel rw rootfstype=ext3 root=/dev/mmcblk0p1 rootwait vmalloc=384M video=HDMI-A-1:1024x768-32@60'
+
bootcmd_emmc=set bootargs ${bootargs_emmc};ext2load mmc 1:1 0x48080000 /boot/Image;ext2load mmc 1:1 0x48000000 /boot/${dtb};run booti_cmd
saveenv
+
bootcmd_nfs=set bootargs ${bootargs_nfs};bootp 0x48080000 Image;tftp 0x48000000 ${dtb};run booti_cmd
</pre>
+
bootcmd_sd0=set bootargs ${bootargs_sd0};ext2load mmc 0:1 0x48080000 /boot/Image;ext2load mmc 0:1 0x48000000 /boot/${dtb};run booti_cmd
The last command writes the configuration to SPI flash.
+
bootdelay=3
<pre>
+
booti_cmd=booti 0x48080000 - 0x48000000
=> saveenv                                                                                                                                 
+
dtb=Image-r8a7795-h3ulcb.dtb
Saving Environment to SPI Flash...                                                                                                         
+
ethact=ravb
SF: Detected S25FL512S with page size 256 KiB, total 64 MiB                                                                               
+
ethaddr=2E:09:0A:00:BE:11
Erasing SPI flash...Writing to SPI flash...done
+
fdt_high=0xffffffffffffffff
</pre>
+
initrd_high=0xffffffffffffffff
</li>
+
stderr=serial
 +
stdin=serial
 +
stdout=serial
 +
ver=U-Boot 2015.04 (Sep 23 2016 - 13:45:29)<br>
 +
Environment size: 1092/131068 bytes
 +
</syntaxhighlight>
 +
* To verify the SD card, type the following in U-Boot prompt:
 +
*: <syntaxhighlight lang="text">
 +
=> 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
 +
</syntaxhighlight>
  
<li>
+
== How to test some capabilities ==
Reset the board by pushing [[R-Car/Boards/SILK:Hardware#Switches and Buttons|SW5 "Reset" on SILK]], [[R-Car/Boards/Porter:Hardware#Switches and Buttons|SWTBD "Reset" on Porter]] or [[R-Car/Boards/Stout:Hardware#Switches and Buttons|SW2 "Reset" on Stout]]
+
=== SW3 ===
</li>
+
<syntaxhighlight lang="bash">
 +
$ hexdump /dev/input/event0
 +
</syntaxhighlight>
 +
=== LED5/LED6 ===
 +
<syntaxhighlight lang="bash">
 +
$ echo 1 > /sys/class/leds/led5(6)/brightness
 +
$ echo 0 > /sys/class/leds/led5(6)/brightness
 +
</syntaxhighlight>
 +
=== Audio ===
 +
Ex) playback
 +
<syntaxhighlight lang="bash">
 +
$ amixer set "DVC Out" 1%
 +
$ aplay Sample.wav
 +
$ gst-launch-1.0 filesrc location=sound/Calm_16bit_44100.wav ! wavparse  ! alsasink
 +
</syntaxhighlight>
 +
Ex) record
 +
<syntaxhighlight lang="bash">
 +
$ amixer set "DVC In" 15%
 +
$ arecord -D hw:0,0 -t wav -d 5 -c 2 -r 44100 -f S24_LE Sample.wav
 +
</syntaxhighlight>
 +
=== Video ===
 +
Ex) Playback
 +
<syntaxhighlight lang="bash">
 +
$ amixer set "DVC Out" 1%
 +
$ modprobe -a mmngr mmngrbuf vspm_if uvcs_drv
 +
$ gst-launch-1.0 filesrc location=Sample.mp4 ! qtdemux name=demux \
 +
demux.audio_0 ! queue ! omxaaclcdec ! alsasink device=plughw:0,0 \
 +
demux.video_0 ! queue ! h264parse ! omxh264dec ! queue ! vspfilter ! \
 +
video/x-raw, format=BGRA, width=1920, height=1080 ! waylandsink
 +
</syntaxhighlight>
  
<li>
+
== FAQ ==
The board should boot the kernel:
 
<pre>
 
SILK SPI_LOADER V0.07c 2014.10.20                                                                                                         
 
DEVICE S25FL512                                                                                                                           
 
                                                                                                                                           
 
                                                                                                                                           
 
U-Boot 2013.01.01-g74b16ba-dirty (Dec 23 2014 - 15:31:50)                                                                                 
 
                                                                                                                                           
 
CPU: Renesas Electronics R8A7794 rev 1.0                                                                                                   
 
Board: Silk Board                                                                                                                         
 
                                                                                                                                           
 
DRAM:  1 GiB                                                                                                                               
 
MMC:  sh_mmcif: 0, sh-sdhi: 1                                                                                                             
 
SF: Detected S25FL512S with page size 256 KiB, total 64 MiB                                                                               
 
In:    serial                                                                                                                             
 
Out:  serial                                                                                                                             
 
Err:  serial                                                                                                                             
 
Net:  sh_eth                                                                                                                             
 
Hit any key to stop autoboot:  0                                                                                                           
 
3534603 bytes read in 498 ms (6.8 MiB/s)                                                                                                   
 
## Booting kernel from Legacy Image at 40007fc0 ...                                                                                       
 
  Image Name:  'Linux-3.10.31-ltsi'                                                                                                     
 
  Image Type:  ARM Linux Kernel Image (uncompressed)                                                                                     
 
  Data Size:    3534539 Bytes = 3.4 MiB                                                                                                   
 
  Load Address: 40008000                                                                                                                 
 
  Entry Point:  40008000                                                                                                                 
 
  Verifying Checksum ... OK                                                                                                               
 
  XIP Kernel Image ... OK                                                                                                                 
 
OK                                                                                                                                         
 
                                                                                                                                           
 
Starting kernel ...     
 
</pre>
 
</li>
 
  
</ol>
+
=== How do I increase USB bandwidth ===
 +
# Download:
 +
#: M3SK [[File:M3v10_usb20_iso_mode.zip]]<br>
 +
#: H3SK WS1.1 (RTP0RC7795SKBX0010SA00) [[File:H3v11_usb20_iso_mode.zip]]<br>
 +
#: H3SK WS2.0 (RTP0RC77951SKBX010SA00) [[File:H3v20_usb20_iso_mode.zip]]<br>
 +
# Setting
 +
#: <syntaxhighlight lang="bash">
 +
# <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
 +
</syntaxhighlight>
 +
=== 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
  
=== Multiboot ===
+
      USB device not accepting new address (error=80000000)
U-Boot allows multiboot configurations. U-Boot can try different boot commands one by one until find the first working command. Use command line interface to configure u-boot.
+
1 USB Device(s) found
Dual source (MMC and NFS) boot configuration for Silk:
+
      scanning usb for storage devices... 0 Storage Device(s) found
<pre>
+
=>
setenv mkBootcmdMMC 'setenv bootcmd ext4load mmc 1:1 0x40007fc0 /boot/uImage+dtb\; bootm 0x40007fc0'
+
</syntaxhighlight>
setenv mkBootargsMMC 'setenv bootargs console=ttySC10,38400 ignore_loglevel rw rootfstype=ext3 root=/dev/mmcblk0p1 rootwait vmalloc=384M'
+
# [How to fix] Set the "usb_pgood_delay 2000" variable
setenv mkBootcmdTFTP 'setenv bootcmd tftp 0x40007fc0 uImage+dtb.silk\; bootm 0x40007fc0'
+
#: <syntaxhighlight lang="text">
setenv mkBootargsNFS 'setenv bootargs console=ttySC10,38400 ignore_loglevel rw root=/dev/nfs nfsroot=192.168.1.27:/nfs/silk,nfsvers=3 ip=192.168.1.107:192.168.1.27::255.255.255.0:silk vmalloc=384M'
+
=> setenv usb_pgood_delay 2000
setenv bootMMC 'run mkBootargsMMC; run mkBootcmdMMC; run bootcmd'
+
=> saveenv
setenv bootNET 'run mkBootargsNFS; run mkBootcmdTFTP; run bootcmd'
+
=> reset
setenv bootcmd 'run bootMMC; run bootNET'
+
=> usb start
</pre>
+
</syntaxhighlight>
For Porter and Stout mkBootcmdMMC, mkBootargsMMC, mkBootcmdTFTP and mkBootargsNFS should be correctly changed according to their bootcmds and bootargs
 
  
 
== Known issues and limitations ==
 
== Known issues and limitations ==
TBD
+
# [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
 +
# [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]]
 +
 
 +
{{Template:R-Car-Yocto-Gen3-footer}}

Revision as of 02:50, 15 July 2021


Introduction

This page contains information on building and running Yocto on:

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

Topic

EOL Notification of the M3SK

Production of M3SK is discontinued.
See M3SK page for detail.

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

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

SW Release Information

Board name SW name Release date Note
R-Car Starter Kit ( Premier / Pro ) Yocto v5.9.4 (stable) [New!!] 2024/03/28
Kingfisher Infotainment Board Yocto v5.9.0 (stable) 2022/02/14 To check for latest information, please refer to the meta-rcar/tree/v5.9.0.
Android 10 (stable) 2021/07/26 R-Car Starter Kit Premier(R-Car H3) + Kingfisher is supported.
R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) + Kingfisher is also supported from 2021/11/25.
Android P (stable) 2020/09/29 R-Car Starter Kit Premier(R-Car H3) + Kingfisher is supported.
R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) + Kingfisher is also supported from 2021/03/16.
CCPF-SK Board Yocto v5.9.0 (stable) 2022/02/08 Prebuilt binary is available in Quick startup guide page. (Updated on 2022/03/18)


R-Car Starter Kit is available

R-Car Starter Kit information
Board Name SoC version Hardware information Where to buy
R-Car Starter Kit Premier (H3) v3.0 Click here Click here
R-Car Starter Kit Pro (M3) v3.0 Click here Click here



Software revisions

Software Revision
Yocto Project 2.4.3
Toolchain gcc-poky 7.3
Wayland/Weston 1.13.0/2.0.0
GStreamer 1.12.2
Kernel Ver LTSI 4.14.75
Userland 64/32bit 64
U-Boot 2018.09
OP_TEE 3.1.0
OpenGL ES 3.2

Host PC

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

Required packages

  1. Download evaluation version of proprietary graphics and multimedia drivers from Renesas.
    To download Multimedia and Graphics library and related Linux drivers, please use the following link:
    https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-h2-m2-e2-documents-software
    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 a1ecd935b70b6c81b6fab807c43af9b888cb81cf
    
    # 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:
    ./<target_board_name>/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 (2021/07/15 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 a1ecd935b70b6c81b6fab807c43af9b888cb81cf# <= 2021/07/15 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
    
  • setup environment variables for each compilation on each Host PCs
    cd (Your working directory)
    source /opt/poky/2.4.3/environment-setup-aarch64-poky-linux
    export LDFLAGS=””
    ${CC} (Your source code).c …..
    

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.

Combination of board and dtb file

Please refer to here .

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
    

How to test some capabilities

SW3

$ hexdump /dev/input/event0

LED5/LED6

$ echo 1 > /sys/class/leds/led5(6)/brightness
$ echo 0 > /sys/class/leds/led5(6)/brightness

Audio

Ex) playback

$ amixer set "DVC Out" 1%
$ aplay Sample.wav
$ gst-launch-1.0 filesrc location=sound/Calm_16bit_44100.wav ! wavparse  ! alsasink

Ex) record

$ amixer set "DVC In" 15%
$ arecord -D hw:0,0 -t wav -d 5 -c 2 -r 44100 -f S24_LE Sample.wav

Video

Ex) Playback

$ amixer set "DVC Out" 1%
$ modprobe -a mmngr mmngrbuf vspm_if uvcs_drv
$ gst-launch-1.0 filesrc location=Sample.mp4 ! qtdemux name=demux \
demux.audio_0 ! queue ! omxaaclcdec ! alsasink device=plughw:0,0 \
demux.video_0 ! queue ! h264parse ! omxh264dec ! queue ! vspfilter ! \
video/x-raw, format=BGRA, width=1920, height=1080 ! waylandsink

FAQ

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


Q&A site

https://community.renesas.com/automotive/r-car-h3-m3-cockpit/

FAQ site