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

From eLinux.org
Jump to: navigation, search
(Preliminary steps)
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{Template:R-Car-Gen3-Navbox}}
 +
{{Template:R-Car-Yocto-Gen3-legacy-header}}
 
{{TOC right}}
 
{{TOC right}}
This page contains information on building and running Yocto on:
+
[[Category:R-Car]]
* [[R-Car/Boards/Salvator-X-View | Renesas R-Car-H3/M3 Salvator-X.View - R-Car SalvatorX with Maxim Integrated GMSL camera board]]
 
* [[R-Car/Boards/H3SK | Renesas R-Car-H3 Starter Kit Premier]] (unofficial name - H3ULCB), see https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/r-car-starter-kit.html
 
* [[R-Car/Boards/ADAS-View-Solution-Kit | ADAS View Solution Kit]] (unofficial name - H3ULCB.View), see details here: https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/adas-view-solution-kit.html
 
* [[R-Car/Boards/H3SK-HAD | HAD Solution Kit]] (unofficial name - H3 H3ULCB.HAD), see https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/had-solution-kit.html
 
* [[R-Car/Boards/M3SK | Renesas R-Car-M3 Starter Kit Pro]] (unofficial name - M3ULCB) https://www.renesas.com/en-us/solutions/automotive/adas/solution-kits/r-car-starter-kit.html
 
* [[R-Car/Boards/M3SK-View | Renesas R-Car-M3 M3ULCB.View]] boards.
 
  
'''NOTE: USE OFFICIAL DOCUMENTATION provided with R-Car BSPs FOR Salvator-X boards'''
+
{| class="wikitable"
== Yocto versions ==
+
|+ Yocto BSP version list
[http://git.yoctoproject.org/cgit/cgit.cgi/poky/tag/?id=yocto-2.0.2 Poky-2.0.2] is supported. Specific commit of meta-openembedded is required.
+
|-
 +
! Yocto BSP version
 +
! Yocto Project version
 +
! Yocto Codename
 +
|-
 +
| [[R-Car/Boards/Yocto-Gen3/v3.19.0|v3.19.0]]
 +
| 2.4.3
 +
| rocko
 +
|-
 +
| [[R-Car/Boards/Yocto-Gen3/v3.15.0|v3.15.0]]
 +
| 2.4.3
 +
| rocko
 +
|-
 +
| [[R-Car/Boards/Yocto-Gen3/v3.13.0|v3.13.0]]
 +
| 2.4.3
 +
| rocko
 +
|-
 +
| [[R-Car/Boards/Yocto-Gen3/v3.9.0|v3.9.0]]
 +
| 2.4.2
 +
| rocko
 +
|-
 +
| [[R-Car/Boards/Yocto-Gen3/v2.23.1|v2.23.1]]
 +
| 2.1.3
 +
| krogoth
 +
|-
 +
| [[R-Car/Boards/Yocto-Gen3/v2.12.0|v2.12.0]]
 +
| 2.0.2
 +
| jethro
 +
|}
  
== Preliminary steps ==
+
-----------------------------------------------------------------
<ol>
 
<li>Download evaluation version of proprietary graphics and multimedia drivers from Renesas.<br/>
 
<br/>
 
To download Multimedia and Graphics library, please use the following link:<br/>
 
https://www.renesas.com/en-us/software/D6000290.html<br/>
 
To download related Linux drivers, please use the following link:<br/>
 
https://www.renesas.com/us/en/software/D6000820.html<br/>
 
<br/>
 
Graphic drivers are required for Wayland. Multimedia drivers are optional.<br/>
 
<br/>
 
</li>
 
 
 
<li> Install required packages
 
===== Ubuntu and Debian =====
 
<pre>
 
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
 
    build-essential chrpath socat libsdl1.2-dev xterm python-crypto
 
</pre>
 
===== Fedora =====
 
<pre>
 
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
 
</pre>
 
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 Salvator-X.View H3/M3, H3ULCB, H3ULCB.View, H3ULCB.HAD, M3ULCB, M3ULCB.View ==
 
<ol>
 
<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.
 
<pre>
 
mkdir build
 
cd build
 
export WORK=`pwd`
 
</pre>
 
</li>
 
<li>Clone basic Yocto layers:
 
<pre>
 
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
 
</pre>
 
</li>
 
 
 
<li>
 
Switch to proper branches/commits
 
<ol>
 
<li>
 
For Yocto v2.12.0
 
<pre>
 
cd $WORK/poky
 
git checkout -b tmp 40376446904ae3529be41737fed9a0b650ed167d
 
cd $WORK/meta-openembedded
 
git checkout -b tmp 8ab04afbffb4bc5184cfe0655049de6f44269990
 
cd $WORK/meta-linaro
 
git checkout -b tmp 9b1fd178309544dff1f7453e796a9437125bc0d9
 
</pre>
 
</li>
 
</ol>
 
Another versions are not tested for compatibility.
 
</li>
 
 
 
<li>
 
Clone Renesas BSP layer and switch to the proper branch:
 
<ol>
 
<li>
 
For Yocto v2.12.0
 
<pre>
 
cd $WORK
 
git clone git://github.com/CogentEmbedded/meta-rcar.git meta-renesas -b v2.12.0
 
</pre>
 
NOTE: meta-rcar.git is a fork of official Renesas git https://github.com/renesas-rcar/meta-renesas with ADAS View and HAD Solution kits supported.
 
</li>
 
</ol>
 
</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>
 
Unzip downloaded proprietary driver modules to $WORK/proprietary folder.<br/>
 
You should see the following files:
 
<ol>
 
<li>
 
For Yocto v2.12.0
 
<pre>
 
$ ls -1 $WORK/proprietary
 
R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20160906.tar.gz
 
R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20160906.tar.gz
 
</pre>
 
</li>
 
</ol>
 
</li>
 
 
 
<li>
 
Populate meta-renesas with proprietary software packages.
 
<pre>
 
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
 
</pre>
 
</li>
 
 
 
<li>
 
Setup build environment
 
<pre>
 
cd $WORK
 
source poky/oe-init-build-env
 
</pre>
 
</li>
 
 
 
<li>
 
Prepare default configuration files.
 
<pre>
 
cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/<salvator-x|h3ulcb|m3ulcb>/linaro-gcc/mmp/*.conf ./conf/
 
cd $WORK/build
 
cp conf/local-wayland.conf conf/local.conf
 
</pre>
 
 
 
<li>
 
Edit $WORK/build/conf/local.conf to enable/disable graphics and multimedia proprietary drivers support
 
</li>
 
 
 
<li>
 
Edit local.conf to choose machine extension variant
 
</li>
 
 
 
'''For H3ULCB board only:'''<br />
 
 
 
<ol>
 
<li>
 
Edit local.conf to select IO configuration (by default only H3ULCB board peripherals are enabled):
 
<pre>
 
MACHINE_FEATURES_append = " h3ulcb-view" (use this append for View IO configuration)
 
</pre>
 
or
 
<pre>
 
MACHINE_FEATURES_append = " h3ulcb-had" (use this append for HAD IO configuration)
 
</pre>
 
or
 
<pre>
 
MACHINE_FEATURES_append = " ulcb-kf" (use this append for Kingfisher IO configuration)
 
</pre>
 
</li>
 
</ol>
 
 
 
'''For Salvator-X board only:'''<br />
 
 
 
<ol>
 
<li>
 
Edit local.conf to select IO configuration (by default only Salvator-X board peripherals are enabled):
 
<pre>
 
MACHINE_FEATURES_append = " salvator-x-view" (use this append for View IO configuration)
 
SOC_FAMILY = "r8a7796" (make this change only for M3 Salvator-X, since the default is H3 Salvator-X)
 
</pre>
 
</li>
 
</ol>
 
 
 
</li>
 
 
 
'''For M3ULCB board only:'''<br />
 
 
 
<ol>
 
<li>
 
Edit local.conf to select IO configuration (by default only M3ULCB board peripherals are enabled):
 
<pre>
 
MACHINE_FEATURES_append = " m3ulcb-view" (use this append for View IO configuration)
 
</pre>
 
or
 
<pre>
 
MACHINE_FEATURES_append = " ulcb-kf" (use this append for Kingfisher IO configuration)
 
</pre>
 
</li>
 
</ol>
 
 
 
 
 
</li>
 
 
 
<li>
 
Edit local.conf with evaluation packages requirements:
 
<ol>
 
<li>
 
For Yocto v2.12.0 (to enable EVA_ prefix during packages install)
 
<pre>
 
DISTRO_FEATURES_append = " use_eva_pkg"
 
</pre>
 
</li>
 
</ol>
 
</li>
 
 
 
<li>
 
Start the build <br />
 
<pre>
 
bitbake core-image-weston
 
</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.
 
</pre>
 
and the command prompt should return.
 
</li>
 
 
 
<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`
 
./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-h3ulcb.dtb
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-had.dtb
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-kf-v1.dtb
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-kf.dtb
 
./tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb-view.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
 
</pre>
 
'''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>
 
<li>
 
You can now proceed with running Yocto images
 
</li>
 
</ol>
 
 
 
== 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:
 
<ol>
 
<li>
 
Setup a TFTP server.
 
==== Ubuntu ====
 
Install '''tftpd-hpa''' package along with tftp tools:
 
<pre>
 
sudo apt-get install tftp tftpd-hpa
 
</pre>
 
 
 
==== Fedora ====
 
<ol>
 
<li>
 
Install necessary packages:
 
<pre>
 
sudo yum install tftp-server tftp
 
</pre>
 
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>
 
<li>
 
Enable TFTP server:
 
<pre>
 
sudo vi /etc/xinetd.d/tftp
 
</pre>
 
Set <pre>disable = no</pre> Save file and exit.
 
</li>
 
<li>
 
Start xinetd:
 
<pre>
 
sudo systemctl start xinetd.service
 
sudo systemctl enable xinetd.service
 
</pre>
 
</li>
 
</ol>
 
 
 
</li>
 
 
 
<li>
 
Copy '''Image''' and '''Image-r8a7795-h3ulcb.dtb''' 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-r8a7795-h3ulcb.dtb /srv/tftp/
 
</pre>
 
 
 
==== Fedora ====
 
<pre>
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image /var/lib/tftpboot/
 
cp $WORK/build/tmp/deploy/images/h3ulcb/Image-r8a7795-h3ulcb.dtb /var/lib/tftpboot/
 
</pre>
 
</li>
 
 
 
<li>
 
Verify that TFTP server is working.
 
<pre>
 
tftp localhost -c get Image && ls Image
 
</pre>
 
</li>
 
 
 
<li>
 
Setup NFS server.
 
==== Debian/Ubuntu ====
 
<ol>
 
<li>
 
Install necessary packages:
 
<pre>
 
sudo apt-get install nfs-kernel-server nfs-common
 
</pre>
 
</li>
 
<li>
 
Start NFS server:
 
<pre>
 
sudo /etc/init.d/nfs-kernel-server start
 
</pre>
 
</li>
 
</ol>
 
 
 
==== Fedora ====
 
<ol>
 
<li>
 
Install necessary packages:
 
<pre>
 
sudo yum install nfs-utils
 
</pre>
 
</li>
 
<li>
 
Enable and start nfs server:
 
<pre>
 
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
 
</pre>
 
</li>
 
</ol>
 
</li>
 
 
 
<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
 
MACHINE=salvator-x|h3ulcb|m3ulcb
 
NFS_ROOT=/nfs/${MACHINE}
 
sudo mkdir -p "${NFS_ROOT}"
 
sudo rm -rf "${NFS_ROOT}"/*
 
sudo tar -xjf "${WORK}/build/tmp/deploy/images/${MACHINE}/core-image-${IMAGE}-${MACHINE}-*.tar.bz2" -C "${NFS_ROOT}"
 
sync
 
</pre>
 
</li>
 
<li>
 
Edit '''/etc/exports''':
 
<pre>
 
sudo vi /etc/exports
 
</pre>
 
add
 
<pre>
 
/nfs/h3ulcb *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
 
/nfs/salvator-x *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
 
</pre>
 
Save the file and exit.
 
</li>
 
<li>
 
Force NFS server to re-read /etc/exports
 
<pre>sudo exportfs -a</pre>
 
</li>
 
</ol>
 
</li>
 
<li>
 
Verify that NFS is working.
 
<pre>
 
[builduser@buildmachine ~]$ showmount -e localhost
 
Export list for localhost:
 
/nfs/h3ulcb *
 
/nfs/salvator-x *
 
</pre>
 
</li>
 
 
 
<li><span id="Boot into U-Boot command prompt">Boot into U-Boot command prompt</span>
 
 
 
<ol>
 
<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]], [[R-Car/Boards/Salvator-X#Power_on_the_board_and_go_to_U-Boot_prompt|Salvator-X 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
 
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>
 
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
 
</pre>
 
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>
 
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
 
</pre>
 
You can also use
 
<pre>
 
dhcp
 
</pre>
 
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.
 
</li>
 
 
 
<li>
 
Verify the connection over Ethernet from U-Boot:
 
<pre>
 
ping <your-computer-ip>
 
</pre>
 
You should see:
 
<pre>
 
=> 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
 
</pre>
 
</li>
 
 
 
<li>
 
Reset the board by pushing reset button
 
<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]], [[R-Car/Boards/Salvator-X#Power_on_the_board_and_go_to_U-Boot_prompt|Salvator-X 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: 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 ...                                                                                                                       
 
</pre>
 
</li>
 
</ol>
 
 
 
==OpenCL support==
 
 
 
The following page describes how to enable OpenCL and Caffe support:
 
[[R-Car/Boards/Yocto-Gen3-legacy/OpenCL]]
 
 
 
==How to prepare and boot from eMMC/SD card==
 
 
 
This section describes steps that are necessary for preparing and booting from SD card.
 
 
 
===Preparing eMMC/SD card===
 
In order to prepare you SD card, follow these instructions on host machine:
 
 
 
1. Partion your SD card to set 1 partition and ID=83 (Linux)
 
<br/>
 
Make sure the SD card doesn't contain any important files.
 
<br/>
 
<span style="color:#ff0000">'''WARNING!''' These steps may erase the SD card completely. All files my be lost.</span>
 
 
 
$ fdisk /dev/mmcblk0
 
-> d
 
-> n
 
-> p
 
-> 1
 
-> t
 
-> 83
 
 
 
2. Format this partition to ext3 (or ext4)
 
 
 
$ mkfs.ext3 /dev/mmcblk0p1
 
 
 
3. Mount this partition on your host to any directory and upack the core-image-weston-*.tar.bz2 into mounted folder.
 
 
 
$ mount /dev/mmcblk0p1 /mnt
 
$ cd <your_yocto_build_directory>
 
$ tar xfj  build/tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb-*.rootfs.tar.bz2  -C /mnt
 
 
 
NOTE: probably you need to be a root user, hence use "sudo"
 
 
 
===Configure U-Boot to boot from SD card===
 
 
 
Proper U-Boot command to boot from SD:
 
# setenv bootargs 'rw root=/dev/mmcblk1p1 rootfstype=ext3 rootwait'
 
# ext2load mmc 0:1 0x48080000 /boot/Image
 
# ext2load mmc 0:1 0x48000000 /boot/Image-r8a7795-h3ulcb.dtb
 
# booti 0x48080000 - 0x48000000'
 
 
 
Example of U-Boot environment variables:
 
baudrate=115200
 
bootargs_emmc=rw root=/dev/mmcblk0p1 rootfstype=ext3 rootwait
 
bootargs_nfs=rw root=/dev/nfs rootwait ip=dhcp
 
bootargs_sd0=rw root=/dev/mmcblk1p1 rootfstype=ext3 rootwait
 
bootcmd=run bootcmd_sd0
 
bootcmd_emmc=set bootargs ${bootargs_emmc};ext2load mmc 1:1 0x48080000 /boot/Image;ext2load mmc 1:1 0x48000000 /boot/${dtb};run booti_cmd
 
bootcmd_nfs=set bootargs ${bootargs_nfs};bootp 0x48080000 Image;tftp 0x48000000 ${dtb};run booti_cmd
 
bootcmd_sd0=set bootargs ${bootargs_sd0};ext2load mmc 0:1 0x48080000 /boot/Image;ext2load mmc 0:1 0x48000000 /boot/${dtb};run booti_cmd
 
bootdelay=3
 
booti_cmd=booti 0x48080000 - 0x48000000
 
dtb=Image-r8a7795-h3ulcb.dtb
 
ethact=ravb
 
ethaddr=2E:09:0A:00:BE:11
 
fdt_high=0xffffffffffffffff
 
initrd_high=0xffffffffffffffff
 
stderr=serial
 
stdin=serial
 
stdout=serial
 
ver=U-Boot 2015.04 (Sep 23 2016 - 13:45:29)<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.6.0-yocto-standard
 
            69584 Image-r8a7795-h3ulcb.dtb
 
 
 
== Build scripts examples ==
 
<ol>
 
 
 
<li> Build preparation
 
<ol>
 
<li> For Yocto v2.12.0
 
<pre>
 
#!/bin/sh
 
 
 
mkdir build || exit
 
cd build
 
WORK=`pwd`
 
echo $WORK
 
 
 
git clone git://git.yoctoproject.org/poky
 
git clone git://git.linaro.org/openembedded/meta-linaro.git
 
git clone git://git.openembedded.org/meta-openembedded
 
git clone git://github.com/CogentEmbedded/meta-rcar.git meta-renesas -b v2.12.0
 
 
 
cd $WORK/poky
 
git checkout -b tmp 40376446904ae3529be41737fed9a0b650ed167d
 
cd $WORK/meta-linaro
 
git checkout -b tmp 9b1fd178309544dff1f7453e796a9437125bc0d9
 
cd $WORK/meta-openembedded
 
git checkout -b tmp 8ab04afbffb4bc5184cfe0655049de6f44269990
 
 
 
cd $WORK/meta-renesas
 
export PATCH_DIR=meta-rcar-gen3/docs/sample/patch/patch-for-linaro-gcc
 
patch -p1 < ${PATCH_DIR}/0001-rcar-gen3-add-readme-for-building-with-Linaro-Gcc.patch
 
unset PATCH_DIR
 
 
 
cd $WORK/
 
PKGS_DIR=$WORK/../proprietary
 
cd $WORK/meta-renesas
 
#sh meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh -f $PKGS_DIR
 
sh meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh -f $PKGS_DIR
 
</pre>
 
</li>
 
</ol>
 
</li>
 
 
 
<li> Building yocto for H3ULCB.View board
 
<ol>
 
<li> For Yocto v2.12.0
 
<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
 
 
 
echo "MACHINE_FEATURES_append = \" h3ulcb-view\"" >> $WORK/build/conf/local.conf
 
#echo "LVDSCAMERA_ONE = \"1\"" >> $WORK/build/conf/local.conf
 
 
 
bitbake core-image-weston
 
</pre>
 
</li>
 
 
 
</ol>
 
</li>
 
 
 
</ol>
 
== Building with Qt5 ==
 
Refer to [[R-Car/Boards/ADAS-View-Solution-Kit#Build_with_Qt5 | ADAS View Kit with Qt5]]
 
 
 
== Known issues and limitations ==
 
TBD
 

Revision as of 20:15, 29 June 2020