Yocto: Difference between revisions

From Wiki-DB
Jump to navigationJump to search
No edit summary
No edit summary
Line 26: 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 (Thud - i.MX6ull only) ==
== 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"
 
| [[SetupYoctoDizzyKrogoth | Dizzy/Krogoth]] (i.MX6qdl)
[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"
 
| [[SetupYoctoThud | 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 ====
Note: You can use your own BSP directory. In the following we use <code>~/dhcom-yocto-bsp</code>
$: PATH=${PATH}:~/bin
$: cd
$: mkdir dhcom-yocto-bsp
$: cd dhcom-yocto-bsp
 
==== Initialize the repositories ====
 
For Thud:
$: repo init -u https://github.com/dh-electronics/dhcom_imx6-bsp-platform -b thud
 
==== Download all of the metadata for the BSP layers ====
 
$: repo sync
 
Once this has completed, you should have all of the metadata source of DHCOM and Freescale Community BSP in dhcom-yocto-bsp.
 
== Setup environment and build an image (Thud- i.MX6ull only) ==
 
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 !! HW !! MACHINE
|- align="left"
| DHCOM i.MX6 ULL|| 100 || <code>  dhcom1bimx6ull  </code>
|}
|}


For example, if you have a DHCOM i.MX6 Duallite HW300, then use 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).
== Running the image on DHCOM i.MX6 ==
 
$: MACHINE=dhcom1bimx6ull source ./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>.wic.gz
The <code>.wic.gz</code> image can be unziped with <code>gunzip</code> and copied to an SD card with the <code>dd</code> command:
 
$ gunzip -c tmp/deploy/images/<MACHINE>/core-image-minimal-<MACHINE>.wic.gz | sudo dd of=/dev/sd<N> bs=1M iflag=fullblock oflag=direct conv=fsync status=progress
 
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.
 
== Setup Yocto Build System (Krogoth & Dizzy) ==
 
==== Install Required Host Packages ====
 
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.).
 
[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]
 
==== 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 ====
Note: You can use your own BSP directory. In the following we use <code>~/fsl-community-bsp</code>
$: PATH=${PATH}:~/bin
$: cd
$: 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.
 
<span style="color:red">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.</span>
 
For Dizzy use:
$: repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b dizzy
For Krogoth use:
$: repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b krogoth
 
==== 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
For Dizzy use:
$: git clone -b dizzy https://github.com/dh-electronics/meta-dhcom_imx6.git
For Krogoth use:
$: git clone -b krogoth https://github.com/dh-electronics/meta-dhcom_imx6.git
 
Edit <code>~/fsl-community-bsp/build/conf/bblayers.conf</code> (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 (Krogoth & Dizzy) ==
 
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 !! HW !! MACHINE
|- align="left"
| DHCOM i.MX6 Solo || 200 || <code>  dhcom2bimx6s  </code> (former dhcomimx6s)
|- align="left"
| DHCOM i.MX6 DualLite || 200 || <code>  dhcom2bimx6dl    </code> (former dhcomimx6dl)
|- align="left"
| DHCOM i.MX6 Dual || 200 || <code>  dhcom2bimx6d  </code>
|- align="left"
| DHCOM i.MX6 Quad || 200 || <code>  dhcom2bimx6q  </code> (former dhcomimx6q)
|-
|
|- align="left"
| DHCOM i.MX6 Solo || 300 || <code>  dhcom3bimx6s  </code>
|- align="left"
| DHCOM i.MX6 DualLite || 300 || <code>  dhcom3bimx6dl    </code>
|- align="left"
| DHCOM i.MX6 Dual || 300 || <code>  dhcom3bimx6d  </code>
|- align="left"
| DHCOM i.MX6 Quad || 300 || <code>  dhcom3bimx6q  </code>
|-
|
|- align="left"
| DHCOM i.MX6 Solo || 400 || <code>  dhcom4bimx6s  </code> (new)
|- align="left"
| DHCOM i.MX6 DualLite || 400 || <code>  dhcom4bimx6dl    </code> (new)
|- align="left"
| DHCOM i.MX6 Dual || 400 || <code>  dhcom4bimx6d  </code> (new)
|- align="left"
| DHCOM i.MX6 Quad || 400 || <code>  dhcom4bimx6q  </code> (new)
|}
 
For example, if you have a DHCOM i.MX6 Duallite HW300, then use 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).
 
$: MACHINE=dhcom3bimx6dl source ./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:
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:


Line 214: Line 45:
The default login username is 'root' and there is no password.
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
|-
! core-image-sato
| Image with Sato, a mobile environment and visual style for mobile devices.<br/>The image supports X11 with a Sato theme, Pimlico applications, and contains terminal, editor, and file manager.
|}


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

Revision as of 10:39, 18 March 2019

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.MX6qdl)
Thud (i.MX6ull only)


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 (Yocto Project Reference Distro) 2.1.2 dhcom3bimx6dl /dev/ttymxc0
dhcom3bimx6dl login:

The default login username is 'root' and there is no password.


Example Configurations

External References