Difference between revisions of "RZ-G/Boards/Yocto 2.0"

From eLinux.org
Jump to: navigation, search
m
(Fix a typo)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{TOC right}}
 
{{TOC right}}
This page contains information on building and running Yocto 2.0 on the [[RZ-G/Boards/SK-RZG1E | Renesas RZ/G1E]] and [[RZ-G/Boards/SK-RZG1M | Renesas RZ/G1M]] Starter Kit boards.
+
This page contains information on building a Yocto 2.0 based Linux BSP for the [[RZ-G/Boards/SK-RZG1E | Renesas RZ/G1E]] and [[RZ-G/Boards/SK-RZG1M | Renesas RZ/G1M]] Starter Kit boards.
<br/><br/>Click [http://elinux.org/RZ-G/Boards/Yocto here] for instructions on building Yocto 1.6.1.
+
<br/><br/>[http://elinux.org/RZ-G/Boards/Yocto Click here for instructions on building a Yocto 1.6.1 BSP].
  
== Supported Linux distributions ==
+
== Supported Linux Host distributions ==
Yocto 2.0 [http://git.yoctoproject.org/cgit/cgit.cgi/poky/?h=jethro (Jethro)] is compatible with various Linux distributions - Ubuntu 14 and 15, Debian 7 and 8, Fedora 21 and 21 and others. For a complete list of the supported distributions see the [http://www.yoctoproject.org/docs/2.0/ref-manual/ref-manual.html#detailed-supported-distros Supported Linux Distributions] section of the Yocto 2.0 Reference Manual. Please use one of the distributions on that list, e.g. Ubuntu 14.04 LTS.
+
[http://git.yoctoproject.org/cgit/cgit.cgi/poky/?h=jethro Yocto 2.0 (Jethro)] is compatible with various Linux Host distributions - Ubuntu 14 and 15, Debian 7 and 8, Fedora 21 and 21 and others. For a complete list of the supported distributions see the [http://www.yoctoproject.org/docs/2.0/ref-manual/ref-manual.html#detailed-supported-distros Supported Linux Distributions] section of the Yocto 2.0 Reference Manual. Please use one of the distributions on that list, e.g. Ubuntu 14.04 LTS.
  
 
== Preliminary steps ==
 
== Preliminary steps ==
 
<ol>
 
<ol>
<li>Download proprietary graphics and multimedia libraries and drivers from Renesas. Evaluation version of the libraries is available at <br/>https://www.renesas.com/en-hq/software/D6000548.html<br/>and the related drivers can be downloaded from <br/>https://www.renesas.com/en-hq/software/D6000544.html <br/>
+
<li> Install the required host packages:<br/>
The Graphic packages are required for X11 and Wayland. Multimedia drivers are optional.<br/>
 
<br/>
 
</li>
 
 
 
<li> Install required packages:<br/>
 
 
'''Ubuntu and Debian'''
 
'''Ubuntu and Debian'''
 
<pre>
 
<pre>
Line 28: Line 23:
 
Refer to [http://www.yoctoproject.org/docs/2.0/ref-manual/ref-manual.html#required-packages-for-the-host-development-system Yocto Project Quick Start] for more information.
 
Refer to [http://www.yoctoproject.org/docs/2.0/ref-manual/ref-manual.html#required-packages-for-the-host-development-system Yocto Project Quick Start] for more information.
 
</li>
 
</li>
 +
 +
<li>Download the proprietary Multimedia and Graphics evaluation libraries for RZ/G from Renesas:
 +
<br/>https://www.renesas.com/en-us/software/D6000548.html
 +
<br/>Download the related kernel drivers as well:
 +
<br/>https://www.renesas.com/en-us/software/D6000544.html
 +
<br/>You should have something like this:
 +
<pre>
 +
$ ls -1
 +
RZG_Series_Evaluation_Software_Package_for_Linux-yyyymmdd.tar.gz.zip
 +
RZG_Series_Evaluation_Software_Package_of_Linux_Drivers-yyyymmdd.tar.gz.zip
 +
</pre>
 +
</li>
 +
 +
<li>Download the helper scripts that will set up the build environment:
 +
<br/>[[File:Rzg_scripts_yocto2.0.tar.gz]]
 +
</li>
 +
 +
<li>
 +
Unpack the script files:
 +
<pre>
 +
$ tar -xvf Rzg_scripts_yocto2.0.tar.gz
 +
rzg_bsp_setup_yocto2.0.sh
 +
rzg_demos_setup_yocto2.0.sh
 +
</pre>
 +
</li>
 +
 
</ol>
 
</ol>
  
 
== Building the BSP for the Renesas RZ/G1 Starter Kit Boards ==
 
== Building the BSP for the Renesas RZ/G1 Starter Kit Boards ==
 +
=== Setting up a new build directory ===
 +
These steps need to be executed only once for a new build directory. For subsequent builds in the same directory skip this section and go straight to [[RZ-G/Boards/Yocto_2.0#Building a BSP|Building a BSP]].
 
<ol>
 
<ol>
<li>Create a directory and switch to it <br/>
+
<li>Create a build 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>
 
<pre>
 
export WORK=<path-to-your-build-directory>
 
export WORK=<path-to-your-build-directory>
Line 41: Line 63:
 
</li>
 
</li>
  
<li>Clone the basic Yocto layers:
+
<li>Copy the downloaded multimedia and graphics zip files and the setup scripts to the build directory. You should have something like this:
 
<pre>
 
<pre>
cd $WORK
+
$ ls -1
git clone git://git.yoctoproject.org/poky
+
rzg_bsp_setup_yocto2.0.sh
git clone git://git.openembedded.org/meta-openembedded
+
rzg_demos_setup_yocto2.0.sh
git clone git://git.linaro.org/openembedded/meta-linaro.git
+
RZG_Series_Evaluation_Software_Package_for_Linux-yyyymmdd.tar.gz.zip
 +
RZG_Series_Evaluation_Software_Package_of_Linux_Drivers-yyyymmdd.tar.gz.zip
 
</pre>
 
</pre>
 
</li>
 
</li>
  
 
<li>
 
<li>
Switch to proper branches/commits:
+
Execute the script rzg_bsp_setup_yocto2.0.sh:
 +
<br/>This will clone all necessary repositories, switch to the proper branches/commits, copy files as necessary, etc.
 
<pre>
 
<pre>
cd $WORK/poky
+
./rzg_bsp_setup_yocto2.0.sh
git checkout -b tmp 3b223f75eec1738fbc913858e8e11c8305e3edcb
+
</pre>
 +
</li>
 +
</ol>
  
cd $WORK/meta-openembedded
+
=== Building a BSP ===
git checkout -b tmp dc5634968b270dde250690609f0015f881db81f2
+
Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.
 +
<ol>
 +
<li>Go to your build directory:<br/>
 +
<pre>
 +
export WORK=<path-to-your-build-directory>
 +
cd $WORK
 +
</pre>
 +
</li>
  
cd $WORK/meta-linaro
+
<li>
git checkout -b tmp 12993e6bc8658ee37d303d8d59007f8dd9ab2b30
+
Initialize the build environment:
 +
<br/>Note that this command is executed from the $WORK folder and it changes the current folder to $WORK\build
 +
<pre>
 +
source poky/oe-init-build-env
 
</pre>
 
</pre>
Other versions are not tested for compatibility.
 
 
</li>
 
</li>
  
 
<li>
 
<li>
Clone the Renesas BSP layer:
+
Copy the proper default configuration files (bblayers.conf and local.conf) depending on the target board. Currently two boards are supported -
 +
'skrzg1m' ([[RZ-G/Boards/SK-RZG1M |RZ/G1M Starter Kit]]) and 'skrzg1e' ([[RZ-G/Boards/SK-RZG1E |RZ/G1E Starter Kit]]).
 +
<br/>Note: At this point the current folder should be $WORK/build
 
<pre>
 
<pre>
cd $WORK
+
cp ../meta-renesas/meta-rzg1/templates/<board>/bblayers.conf ./conf
git clone https://github.com/renesas-rz/meta-renesas
+
cp ../meta-renesas/meta-rzg1/templates/<board>/local.conf ./conf/local.conf
 
</pre>
 
</pre>
 +
You can edit the file local.conf, e.g. to enable/disable graphics and multimedia proprietary drivers support.
 
</li>
 
</li>
  
 
<li>
 
<li>
Switch to the yocto_2.0 branch:
+
Start the build <br />
 
<pre>
 
<pre>
cd $WORK/meta-renesas
+
bitbake core-image-weston
git checkout yocto_2.0
 
 
</pre>
 
</pre>
 +
Building the image can take up to a few hours depending on your host system performance.<br/>
 +
After the build has been completed successfully, you should see the output similar to:
 +
<pre class="bash">
 +
NOTE: Tasks Summary: Attempted 4704 tasks of which 31 didn't need to be rerun and all succeeded.
 +
</pre>
 +
and the command prompt should return.
 
</li>
 
</li>
  
 
<li>
 
<li>
Download the proprietary libraries from <br/>https://www.renesas.com/en-hq/software/D6000548.html<br/> and related kernel drivers from https://www.renesas.com/en-hq/software/D6000544.html
+
Bitbake has generated all the necessary files in ./tmp/deploy/images directory. <br/>
 +
'''uImage''' is the kernel image, '''uImage-r8a7745-skrzg1e.dtb''' is the device tree file, '''uImage+dtb''' is the combined kernel and device tree image, '''core-image-weston-skrzg1e.tar.bz2''' is the rootfs, '''modules-skrzg1e.tgz''' are the kernel modules.
 
</li>
 
</li>
  
 
<li>
 
<li>
Create an install folder for the proprietary libraries:
+
You can now boot the [[RZ-G/Boards/SK-RZG1E#Configure U-Boot to boot over TFTP + NFS or from a micro SD card|RZ/G1E]] or [[RZ-G/Boards/SK-RZG1M#Configure U-Boot to boot over TFTP + NFS or from a micro SD card|RZ/G1M]] Starter Kit boards over TFTP and NFS. You can also boot from microSD but note that [https://github.com/renesas-rz/meta-renesas/issues/4#issuecomment-292984843 the microSD slot is recognized as mmcblk1].
 +
</li>
 +
</ol>
 +
 
 +
=== Adding QT to the BSP ===
 +
This section describes how to add Qt 5.6 to the base BSP built by the previous steps.
 +
<ol>
 +
<li>Clone the meta-qt5 layer:
 
<pre>
 
<pre>
 
cd $WORK
 
cd $WORK
mkdir proprietary
+
git clone https://github.com/meta-qt5/meta-qt5.git
 
</pre>
 
</pre>
Copy the downloaded proprietary libraries into this new folder, e.g.:
+
</li>
 +
 
 +
<li>
 +
Switch to the proper branch/commit.
 
<pre>
 
<pre>
cp ~/Downloads/RZG_Series_Evaluation_Software_Package* $WORK/proprietary
+
cd $WORK/meta-qt5
 +
git checkout -b tmp c1b0c9f546289b1592d7a895640de103723a0305
 
</pre>
 
</pre>
 
</li>
 
</li>
  
 
<li>
 
<li>
Unzip the proprietary libraries, e.g.:
+
Add the build layers 'meta-qt5' and 'meta-ruby' to the file $WORK\build\conf\bblayers.conf:
 
<pre>
 
<pre>
cd $WORK/proprietary
+
  ${TOPDIR}/../meta-qt5 \
unzip RZG_Series_Evaluation_Software_Package_for_Linux-20161011.tar.gz.zip
+
  ${TOPDIR}/../meta-openembedded/meta-ruby \
unzip RZG_Series_Evaluation_Software_Package_of_Linux_Drivers-20161011.tar.gz.zip
 
 
</pre>
 
</pre>
You should see the following files:
+
</li>
 +
<li>
 +
 
 +
Add the desired Qt packages to the variable IMAGE_INSTALL. You can do that by modifying the file $WORK\build\conf\local.conf like this:
 
<pre>
 
<pre>
$ ls -l $WORK/proprietary
+
IMAGE_INSTALL_append = " \
total 4.3M
+
    qtbase \
-rw-rw-r-- 1 builduser builduser 3.1M Dec 06 10:25 RZG_Series_Evaluation_Software_Package_for_Linux-20101011.tar.gz
+
    qtbase-fonts \
-rw-rw-r-- 1 builduser builduser 1.2M Dec 06 10:25 RZG_Series_Evaluation_Software_Package_of_Linux_Drivers-20161011.tar.gz
+
    qtbase-plugins \
 +
    qtdeclarative \
 +
    qtdeclarative-qmlplugins \
 +
    qtdeclarative-plugins \
 +
    qtquick1 \
 +
    qtquick1-qmlplugins \
 +
    qtquick1-plugins \
 +
    qtwayland \
 +
    qtwayland-plugins \
 +
    qtbase-examples \
 +
"
 
</pre>
 
</pre>
 
</li>
 
</li>
 +
</ol>
 +
 +
== Building the Renesas demos ==
 +
This section describes how to build a couple of demo BSPs for the Renesas RZ/G boards. The demo BSPs extend the base BSP described in previous sections. Please make sure you have executed the [[RZ-G/Boards/Yocto_2.0#Preliminary steps|preliminary steps]] as well as the steps in section [[RZ-G/Boards/Yocto_2.0#Setting up a new build directory|Setting up a new build directory]]. 
 +
There is no need to build the base BSP or to add the Qt framework manually, as the following steps will do that.
 +
<ol>
  
 
<li>
 
<li>
Populate the meta-renesas layer with graphics and multimedia drivers:
+
Execute the script rzg_demos_setup_yocto2.0.sh:
 +
<br/>This will clone all necessary repositories, switch to the proper branches/commits, etc.
 
<pre>
 
<pre>
cd $WORK/meta-renesas/meta-rzg1
+
cd $WORK
./copy_gfx_software_<board>.sh ../../proprietary
+
./rzg_demos_setup_yocto2.0.sh
./copy_mm_software_lcb.sh ../../proprietary
 
 
</pre>
 
</pre>
 
</li>
 
</li>
  
 
<li>
 
<li>
Setup build environment:
+
If this is a new terminal session, initialize the build environment:
 +
<br/>Note that this command is executed from the $WORK folder and it changes the current folder to $WORK\build
 
<pre>
 
<pre>
cd $WORK
 
 
source poky/oe-init-build-env
 
source poky/oe-init-build-env
 
</pre>
 
</pre>
Line 131: Line 204:
  
 
<li>
 
<li>
Prepare default configuration files:
+
Copy the configuration files for the desired demo BSP and RZ/G board. The two available demos BSPs are 'hmi-demo' (contains various multimedia and video streaming apps) and 'qt-hmi-demo' (contains demos from the Qt framework).
 
<pre>
 
<pre>
 
cd $WORK/build
 
cd $WORK/build
cp ../meta-renesas/meta-rzg1/templates/<board>/bblayers.conf ./conf
+
cp ../meta-rzg-demos/meta-rzg1/<demo_folder>/template/<board>/bblayers.conf ./conf
 +
cp ../meta-rzg-demos/meta-rzg1/<demo_folder>/template/<board>/local.conf ./conf
 
</pre>
 
</pre>
For weston/wayland:
 
<pre>
 
cp ../meta-renesas/meta-rzg1/templates/<board>/local-wayland.conf ./conf/local.conf
 
</pre>
 
For X11:
 
<pre>
 
cp ../meta-renesas/meta-rzg1/templates/<board>/local-x11.conf ./conf/local.conf
 
</pre>
 
Edit local.conf to enable/disable graphics and multimedia proprietary drivers support. The H264 encoder library is not enabled by default,
 
in order to enable it uncomment the following line:<br/>
 
DISTRO_FEATURES_append = " h264avcenc_lib"
 
 
</li>
 
</li>
  
 
<li>
 
<li>
Start the build <br />
+
Build the BSP. The demo BSPs support only the Wayland/Weston environment, X11 is not supported:
For weston/wayland:
 
 
<pre>
 
<pre>
 
bitbake core-image-weston
 
bitbake core-image-weston
 
</pre>
 
</pre>
For X11:
 
<pre>
 
bitbake core-image-x11
 
</pre>
 
Building the image can take up to a few hours depending on your host system performance.<br/>
 
After the build has been completed successfully, you should see the output similar to:
 
<pre class="bash">
 
NOTE: Tasks Summary: Attempted 4704 tasks of which 31 didn't need to be rerun and all succeeded.
 
</pre>
 
and the command prompt should return.
 
</li>
 
 
<li>
 
Bitbake has generated all the necessary files in ./tmp/deploy/images directory. <br/>
 
'''uImage''' is the kernel image, '''uImage-r8a7745-skrzg1e.dtb''' is the device tree file, '''uImage+dtb''' is the combined kernel and device tree image, '''core-image-weston-skrzg1e.tar.bz2''' is the rootfs, '''modules-skrzg1e.tgz''' are the kernel modules.
 
</li>
 
 
<li>
 
You can now boot the [[RZ-G/Boards/SK-RZG1E#Booting over TFTP from U-Boot|RZ/G1E]] or [[RZ-G/Boards/SK-RZG1M#Booting over TFTP from U-Boot|RZ/G1M]] Starter Kit boards over TFTP and NFS
 
 
</li>
 
</li>
 
</ol>
 
</ol>

Latest revision as of 19:10, 28 November 2017

This page contains information on building a Yocto 2.0 based Linux BSP for the Renesas RZ/G1E and Renesas RZ/G1M Starter Kit boards.

Click here for instructions on building a Yocto 1.6.1 BSP.

Supported Linux Host distributions

Yocto 2.0 (Jethro) is compatible with various Linux Host distributions - Ubuntu 14 and 15, Debian 7 and 8, Fedora 21 and 21 and others. For a complete list of the supported distributions see the Supported Linux Distributions section of the Yocto 2.0 Reference Manual. Please use one of the distributions on that list, e.g. Ubuntu 14.04 LTS.

Preliminary steps

  1. Install the required host packages:
    Ubuntu and Debian
    sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
         build-essential chrpath socat
    

    Fedora

    sudo dnf 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 \
         findutils which
    

    Refer to Yocto Project Quick Start for more information.

  2. Download the proprietary Multimedia and Graphics evaluation libraries for RZ/G from Renesas:
    https://www.renesas.com/en-us/software/D6000548.html
    Download the related kernel drivers as well:
    https://www.renesas.com/en-us/software/D6000544.html
    You should have something like this:
    $ ls -1
    RZG_Series_Evaluation_Software_Package_for_Linux-yyyymmdd.tar.gz.zip
    RZG_Series_Evaluation_Software_Package_of_Linux_Drivers-yyyymmdd.tar.gz.zip
    
  3. Download the helper scripts that will set up the build environment:
    File:Rzg scripts yocto2.0.tar.gz
  4. Unpack the script files:
    $ tar -xvf Rzg_scripts_yocto2.0.tar.gz
    rzg_bsp_setup_yocto2.0.sh
    rzg_demos_setup_yocto2.0.sh
    

Building the BSP for the Renesas RZ/G1 Starter Kit Boards

Setting up a new build directory

These steps need to be executed only once for a new build directory. For subsequent builds in the same directory skip this section and go straight to Building a BSP.

  1. Create a build directory and switch to it:
    export WORK=<path-to-your-build-directory>
    mkdir $WORK
    cd $WORK
    
  2. Copy the downloaded multimedia and graphics zip files and the setup scripts to the build directory. You should have something like this:
    $ ls -1
    rzg_bsp_setup_yocto2.0.sh
    rzg_demos_setup_yocto2.0.sh
    RZG_Series_Evaluation_Software_Package_for_Linux-yyyymmdd.tar.gz.zip
    RZG_Series_Evaluation_Software_Package_of_Linux_Drivers-yyyymmdd.tar.gz.zip
    
  3. Execute the script rzg_bsp_setup_yocto2.0.sh:
    This will clone all necessary repositories, switch to the proper branches/commits, copy files as necessary, etc.
    ./rzg_bsp_setup_yocto2.0.sh
    

Building a BSP

Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.

  1. Go to your build directory:
    export WORK=<path-to-your-build-directory>
    cd $WORK
    
  2. Initialize the build environment:
    Note that this command is executed from the $WORK folder and it changes the current folder to $WORK\build
    source poky/oe-init-build-env
    
  3. Copy the proper default configuration files (bblayers.conf and local.conf) depending on the target board. Currently two boards are supported - 'skrzg1m' (RZ/G1M Starter Kit) and 'skrzg1e' (RZ/G1E Starter Kit).
    Note: At this point the current folder should be $WORK/build
    cp ../meta-renesas/meta-rzg1/templates/<board>/bblayers.conf ./conf
    cp ../meta-renesas/meta-rzg1/templates/<board>/local.conf ./conf/local.conf
    

    You can edit the file local.conf, e.g. to enable/disable graphics and multimedia proprietary drivers support.

  4. Start the build
    bitbake core-image-weston
    

    Building the 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.

  5. Bitbake has generated all the necessary files in ./tmp/deploy/images directory.
    uImage is the kernel image, uImage-r8a7745-skrzg1e.dtb is the device tree file, uImage+dtb is the combined kernel and device tree image, core-image-weston-skrzg1e.tar.bz2 is the rootfs, modules-skrzg1e.tgz are the kernel modules.
  6. You can now boot the RZ/G1E or RZ/G1M Starter Kit boards over TFTP and NFS. You can also boot from microSD but note that the microSD slot is recognized as mmcblk1.

Adding QT to the BSP

This section describes how to add Qt 5.6 to the base BSP built by the previous steps.

  1. Clone the meta-qt5 layer:
    cd $WORK
    git clone https://github.com/meta-qt5/meta-qt5.git
    
  2. Switch to the proper branch/commit.
    cd $WORK/meta-qt5
    git checkout -b tmp c1b0c9f546289b1592d7a895640de103723a0305
    
  3. Add the build layers 'meta-qt5' and 'meta-ruby' to the file $WORK\build\conf\bblayers.conf:
      ${TOPDIR}/../meta-qt5 \
      ${TOPDIR}/../meta-openembedded/meta-ruby \
    
  4. Add the desired Qt packages to the variable IMAGE_INSTALL. You can do that by modifying the file $WORK\build\conf\local.conf like this:
    IMAGE_INSTALL_append = " \
        qtbase \
        qtbase-fonts \
        qtbase-plugins \ 
        qtdeclarative \
        qtdeclarative-qmlplugins \
        qtdeclarative-plugins \
        qtquick1 \
        qtquick1-qmlplugins \ 
        qtquick1-plugins \
        qtwayland \
        qtwayland-plugins \
        qtbase-examples \ 
    "
    

Building the Renesas demos

This section describes how to build a couple of demo BSPs for the Renesas RZ/G boards. The demo BSPs extend the base BSP described in previous sections. Please make sure you have executed the preliminary steps as well as the steps in section Setting up a new build directory. There is no need to build the base BSP or to add the Qt framework manually, as the following steps will do that.

  1. Execute the script rzg_demos_setup_yocto2.0.sh:
    This will clone all necessary repositories, switch to the proper branches/commits, etc.
    cd $WORK
    ./rzg_demos_setup_yocto2.0.sh
    
  2. If this is a new terminal session, initialize the build environment:
    Note that this command is executed from the $WORK folder and it changes the current folder to $WORK\build
    source poky/oe-init-build-env
    
  3. Copy the configuration files for the desired demo BSP and RZ/G board. The two available demos BSPs are 'hmi-demo' (contains various multimedia and video streaming apps) and 'qt-hmi-demo' (contains demos from the Qt framework).
    cd $WORK/build
    cp ../meta-rzg-demos/meta-rzg1/<demo_folder>/template/<board>/bblayers.conf ./conf
    cp ../meta-rzg-demos/meta-rzg1/<demo_folder>/template/<board>/local.conf ./conf
    
  4. Build the BSP. The demo BSPs support only the Wayland/Weston environment, X11 is not supported:
    bitbake core-image-weston