Yocto: Difference between revisions

From Wiki-DB
Jump to navigationJump to search
 
(23 intermediate revisions by 2 users not shown)
Line 18: Line 18:
|- align="center"
|- align="center"
| Krogoth || 2.1
| Krogoth || 2.1
|- align="center"
| Thud (i.MX6ULL only)|| 2.6
|}
|}


Line 24: Line 26:
More information about Yocto stable branch maintenance at [https://wiki.yoctoproject.org/wiki/Stable_branch_maintenance https://wiki.yoctoproject.org/]
More information about Yocto stable branch maintenance at [https://wiki.yoctoproject.org/wiki/Stable_branch_maintenance https://wiki.yoctoproject.org/]


== Setup Yocto Build System ==
== Setup Yocto Build System & Build Image ==


==== Install Required Host Packages ====
{| border="1"  style="border-collapse:collapse; height:75px; width:300px;"
 
! Name
Install the required packages for your host development system.  The Yocto Project documentation has a listing of install commands for many different linux host systems (Debian, Ubuntu, etc.).
|- align="center"
 
| [[Setup Yocto for Dizzy/Krogoth | Dizzy/Krogoth]] (i.MX6S/DL/D/Q)
[http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#required-packages-for-the-host-development-system Required Packages for the Host Development System]
|- align="center"
 
| [https://github.com/dh-electronics/dhcom_imx6-bsp-platform/tree/thud Thud] (i.MX6ULL only)
==== Download and Install Google's repo utility ====
 
The BSP is based on the Yocto Project, which consists of a number of applicable metadata 'layers'.  These are managed by the repo utility.<br />
$: mkdir ~/bin
$: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$: chmod a+x ~/bin/repo
 
==== Create the BSP directory to download all of the metadata for the BSP layers ====
 
$: PATH=${PATH}:~/bin
$: mkdir fsl-community-bsp
$: cd fsl-community-bsp
 
==== Initialize the repositories ====
 
The next step is to initialize the repositories.  This establishes which branch of the repository will be used for your development. The ''master'' branch is the current development branch. We have tested our BSP layer with the stable branch "dizzy". Which was the latest stable branch during development.
 
'''Note: The master branch is a development branch, not a stable branch.  It is constantly changing with code updates, the adding of new features, and so forth.'''
 
$: repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b dizzy
 
==== Download all of the metadata for the BSP layers ====
 
$: repo sync
 
Once this has completed, you should have all of the metadata source of the Freescale Community BSP in fsl-community-bsp.
 
==== Add DHCOM i.MX6 BSP layer ====
 
To clone the OpenEmbedded / Yocto BSP layer for DHCOM i.MX6 execute the following steps:
 
$: cd fsl-community-bsp/sources
$: git clone –b dizzy https://github.com/dh-electronics/meta-dhcom_imx6.git
 
Edit fsl-community-bsp/build/conf/bblayers.conf (run bitbake once to create build directory, see 'Setup environment and build an image') to add the meta-dhcom_imx6 layer at the end:
 
${BSPDIR}/sources/meta-dhcom_imx6 \
 
== Setup environment and build an image ==
 
To start a build, first set the MACHINE shell environment variable to set the machine.  These are: <br/>
{| border="1"  style="border-collapse:collapse; height:150px; width:500px; margin: 1em auto 1em auto;"
|+DHCOM i.MX6 Machines in Yocto
! Board Type !! MACHINE
|- align="left"
| DHCOM i.MX6 Solo HW200 || <code>  dhcom2bimx6s  </code> (former dhcomimx6s)
|- align="left"
| DHCOM i.MX6 Duallite HW200 || <code>  dhcom2bimx6dl    </code> (former dhcomimx6dl)
|- align="left"
| DHCOM i.MX6 Quad HW200 || <code>  dhcom2bimx6q  </code> (former dhcomimx6q)
|- align="left"
| DHCOM i.MX6 Solo HW300 || <code>  dhcom3bimx6s  </code> (new)
|- align="left"
| DHCOM i.MX6 Duallite HW300 || <code>  dhcom3bimx6dl    </code> (new)
|- align="left"
| DHCOM i.MX6 Quad HW300 || <code>  dhcom3bimx6q  </code> (new)
|}
 
For example, if you have a DHCOM i.MX6 Duallite HW300, then set MACHINE to "dhcom3bimx6dl".
 
$: export MACHINE=dhcom3bimx6dl
 
Run the <code>setup-environment</code> script.  This is a helper script which sets up the environment and creates a build directory for you.  The first time you run this, you will be asked to accept the Freescale end user license agreement (EULA).
 
$: . ./setup-environment build
 
Run bitbake with <code>core-image-minimal</code> as its argument. This will create a small image and should have the shortest possible build time.  Note: all of the sources are downloaded from the internet and built from scratch.  This includes the toolchain (gcc) and all of the native utilities, so building an image for the first time could take a few hours, depending on the performance of your host machine.
 
$: bitbake core-image-minimal
 
==== Locating the images and installing to a microSD card ====
Once the image is built successfully, there are several target images that are built by default.  One of these is an image suitable for loading directly into an SD card.  It contains all of the required binaries (bootloader, kernel, filesystem) in a preformatted binary image.
 
You can find the image at:
 
  build/tmp/deploy/images/<MACHINE>/core-image-minimal-<MACHINE>.sdcard
 
The <code>.sdcard</code> image can be directly copied to an SD card with the <code>dd</code> command:
 
$ sudo dd if=tmp/deploy/images/<MACHINE>/core-image-minimal-<MACHINE>.sdcard of=/dev/sd<N> bs=1M
 
NOTE: '''<MACHINE>''' in the above corresponds to the MACHINE name provided to bitbake. '''"N"''' in the above command is the letter assigned to the SD card.  This will vary depending on your host machine configuration.
 
==== Running the image on DHCOM i.MX6 ====
As this is just a console image, you will need a serial terminal program such as minicom in order to interact with the board and run commands.  Simply plug the microSD card into the slot on the DHCOM i.MX6 module and apply power.  You should immediately see log messages in the serial terminal.  When complete, you should get a login prompt:
 
Poky Next (Yocto Project Reference Distro) 1.7 dhcom3Bimx6dl /dev/ttymxc0<br/>
dhcom3bimx6dl login:
 
The default login username is 'root' and there is no password.
 
=== Other interesting images ===
 
The image <code> core-image-minimal </code> builds relatively quickly due to its small size.  It is a good image to test to see if your board works.  There are other images that you can also try, but can take a good deal longer to build.
 
{| border="1" cellpadding="5" style="border-collapse:collapse; height:150px; margin: 1em auto 1em auto;"
! Image
! Description
|-
! core-image-base
| Basic image with kernel modules and other features
|-
! core-image-x11
| Basic image with X11 support
|}
|}


== Example Configurations ==
== Example Configurations ==


*'''[[Building Qt5 using Yocto | Building Qt5 using Yocto]]'''
*'''[[Add Yocto SDK with QT5 to QT Creator | Add Yocto SDK with QT5 to QT Creator]]'''
*'''[[Building Qt5 for i.MX6 using Yocto Dizzy| Building Qt5 for i.MX6 using Yocto Dizzy]]'''
*'''[[Building Chromium, VLC and X11VNC using Yocto | Building Chromium, VLC and X11VNC using Yocto]]'''
*'''[[Building Chromium, VLC and X11VNC using Yocto | Building Chromium, VLC and X11VNC using Yocto]]'''



Latest revision as of 12:13, 13 May 2020

For general information about the Yocto Project please refer to the official Website. "Yocto is not an embedded Linux distribution – it creates a custom one for you." This says that if you are using Yocto to build your system image you are the distributor. If you're not aware of what this means for you please contact us.

Requirements hardware and software

  • Linux-based (Debian/Ubuntu is recommended) host system to use for building Linux/Yocto
  • min 4GB RAM / > 8GB RAM are recommended
  • disk space (depending on image to build about 80 GB)
  • a microSD card-reader to write the generated image to the microSD card

Supported Stable Branch

With our OpenEmbedded / Yocto BSP Layer for DHCOM i.MX6 we support the following branches:

Name Version
Dizzy 1.7
Krogoth 2.1
Thud (i.MX6ULL only) 2.6

Our BSP layer is based on the Freescale Community BSP.

More information about Yocto stable branch maintenance at https://wiki.yoctoproject.org/

Setup Yocto Build System & Build Image

Name
Dizzy/Krogoth (i.MX6S/DL/D/Q)
Thud (i.MX6ULL only)

Example Configurations

External References