VAR-SOM-AM43 Yocto Krogoth GS: Difference between revisions

From Variscite Wiki
(Krogoth update)
 
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 12: Line 12:
*Install the release on a development machine.
*Install the release on a development machine.
*Build the sources included in this release.
*Build the sources included in this release.
*Instaling the binaries on the VAR-SOM-AM43.
*Installing the binaries on the VAR-SOM-AM43.
*Booting the VAR-SOM-AM43.
*Booting the VAR-SOM-AM43.


Line 42: Line 42:
=== Install the Linaro toolchain ===
=== Install the Linaro toolchain ===
<pre>
<pre>
$ wget --no-check-certificate https://releases.linaro.org/components/toolchain/binaries/latest-5/arm-linux-gnueabihf/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz
$ wget --no-check-certificate https://releases.linaro.org/components/toolchain/binaries/5.3-2016.05/arm-linux-gnueabihf/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz
$ sudo tar xf gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz -C /opt
$ sudo tar xf gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz -C /opt
</pre>
</pre>


Line 61: Line 61:
$ mkdir ~/yocto_varsomam43/tisdk/sources
$ mkdir ~/yocto_varsomam43/tisdk/sources
$ cd ~/yocto_varsomam43/tisdk/sources
$ cd ~/yocto_varsomam43/tisdk/sources
$ git clone https://github.com/varigit/meta-variscite-amx3
$ git clone https://github.com/varigit/meta-variscite-amx3 -b krogoth
</pre>
</pre>


==== Downloading the YOCTO Krogoth 2.1 configuration ====
==== Downloading the Yocto Krogoth 2.1 configuration ====
Download the YOCTO Krogoth 2.1 sources as follows:
Download the Yocto Krogoth 2.1 sources as follows:
<pre>
<pre>
$ cd ~/yocto_varsomam43/tisdk
$ cd ~/yocto_varsomam43/tisdk
$ ./oe-layertool-setup.sh -f sources/meta-variscite-amx3/conf/var-som-amx3_sdk-03.01.00-config.txt
$ ./oe-layertool-setup.sh -f sources/meta-variscite-amx3/conf/var-som-amx3_sdk-03.00.00-config.txt
</pre>
</pre>


Line 87: Line 87:
Recommended to save download time and space.  
Recommended to save download time and space.  
DL_DIR = "/home/&lt;uname&gt;/yocto_dl"<br>
DL_DIR = "/home/&lt;uname&gt;/yocto_dl"<br>
==== TI MIRRORS  ====
One common location for hosting packages, gforge.ti.com, has recently been decommissioned. This will cause fetch failures for the current and past releases. Please add the following lines to your local.cof to configure the build to obtain these packages from the TI mirror.
TI_MIRROR = "http:&#47;&#47;software-dl.ti.com/processor-sdk-mirror/sources/"
MIRRORS += " \
  bzr:&#47;&#47;.*/.*      ${TI_MIRROR} \n \
  cvs:&#47;&#47;.*/.*      ${TI_MIRROR} \n \
  git:&#47;&#47;.*/.*      ${TI_MIRROR} \n \
  gitsm:&#47;&#47;.*/.*    ${TI_MIRROR} \n \
  hg:&#47;&#47;.*/.*      ${TI_MIRROR} \n \
  osc:&#47;&#47;.*/.*      ${TI_MIRROR} \n \
  p4:&#47;&#47;.*/.*      ${TI_MIRROR} \n \
  npm:&#47;&#47;.*/.*      ${TI_MIRROR} \n \
  ftp:&#47;&#47;.*/.*      ${TI_MIRROR} \n \
  https?$:&#47;&#47;.*/.*  ${TI_MIRROR} \n \
  svn:&#47;&#47;.*/.*      ${TI_MIRROR} \n \
"


= Building the VAR-SOM-AM43 Yocto image =
= Building the VAR-SOM-AM43 Yocto image =
Line 100: Line 118:
  $ MACHINE=varsomam43 bitbake tisdk-rootfs-image
  $ MACHINE=varsomam43 bitbake tisdk-rootfs-image


After the image was built, all images will be located in: ~/yocto_varsomam43/tisdk/build/arago-tmp-external-linaro-toolchain/deploy/images/varsoman43
After the image was built, all images will be located in: ~/yocto_varsomam43/tisdk/build/arago-tmp-external-linaro-toolchain/deploy/images/varsomam43


== Build Results ==
== Build Results ==
Line 107: Line 125:
|-
|-
! scope="col" | Image Name<br/>
! scope="col" | Image Name<br/>
! scope="col" | How to use<br/>
! scope="col" | Description<br/>
|-
|-
| zImage
| zImage
| Kernel uncompressed image
| Compressed kernel image
|-
|-
| zImage-var-som-am43.dtb
| zImage-var-som-am43.dtb
| The VAR-SOM-AM43 kernel device tree
| The VAR-SOM-AM43 kernel device tree
|-
| uImage
| Linux kernel image, same binary for SD-Card or NAND Flash
|-
|-
| MLO  
| MLO  
Line 135: Line 150:
Extract the rootfs as follows:
Extract the rootfs as follows:
<pre> $ sudo mkdir ~/yocto_varsomam43/rootfs
<pre> $ sudo mkdir ~/yocto_varsomam43/rootfs
  $ sudo tar xvf ./arago-tmp-external-linaro-toolchain/deploy/images/varsomam43/tisdk-rootfs-image-varsomam43.tar.gz -C ~/yocto_varsomam43/rootfs
  $ sudo tar xvf ~/yocto_varsomam43/tisdk/build/arago-tmp-external-linaro-toolchain/deploy/images/varsomam43/tisdk-rootfs-image-varsomam43.tar.gz -C ~/yocto_varsomam43/rootfs
</pre>
</pre>
This creates a rootfs directory for the Yocto / VAR-SOM-AM43 build.
This creates a rootfs directory for the Yocto / VAR-SOM-AM43 build.


= Create a bootable SD-Card =
= Create a bootable SD card =
The below procedure will result in a bootable SD-Card:
The below procedure will result in a bootable SD card:
* SD-Card will be partitioned into 2 partitions:
* SD card will be partitioned into 2 partitions:
** FAT32 Boot partition: includes MLO and U-boot required for initial boot
** FAT32 Boot partition: includes MLO and U-boot required for initial boot
** ext3 file system: includes zImage, kernel device tree and a complete rootfs
** ext3 file system: includes zImage, kernel device tree and a complete rootfs
* All NAND flash binaries will be copied to rootfs under /opt/TISDK directory, for[[VAR-SOM-AM43 NAND Flash Burning|  NAND Flash burning]] if required.
* All NAND flash binaries will be copied to rootfs under /opt/TISDK directory, for[[VAR-SOM-AM43 NAND Flash Burning|  NAND Flash burning]] if required.
Please follow the below steps: <br>
Please follow the below steps: <br>
* Insert a 4GB+ SD-Card to host computer
* Insert a 4GB+ SD card to host computer
* Run dmesg command to identify which /dev/sdX was created  
* Run dmesg command to identify which /dev/sdX was created  


* To generate the SD-Card - Run script (and choose the correct /dev/sdX of the 4GB SD-Card inserted):
* To generate the SD card - Run script (and choose the correct /dev/sdX of the 4GB SD card inserted):
<pre>
<pre>
$ cd ~/yocto_varsomam43/tisdk/sources/meta-variscite-amx3/utils
$ cd ~/yocto_varsomam43/tisdk/sources/meta-variscite-amx3/utils
Line 157: Line 172:
= Boot  =
= Boot  =


The Kernel and root the file-system can be booted either from NAND or SD-Card.
The Kernel and root the file-system can be booted either from NAND or SD card.


Following sections describe various kernel boot options possible.<br>  
Following sections describe various kernel boot options possible.<br>  
Line 167: Line 182:
== Boot from MMC/SD ==
== Boot from MMC/SD ==


For creating a bootable SD , follow instructions on [[VAR-SOM-AM43 Yocto FIDO GS#Create a bootable SD-Card |Creating a bootable SD-Card ]]
For creating a bootable SD , follow instructions on [[VAR-SOM-AM43 Yocto FIDO GS#Create a bootable SD card |Creating a bootable SD card ]]


To boot the bootable SD-Card, follow the steps below:
To boot the bootable SD card, follow the steps below:
*Power-off board
*Power-off board
*Insert the SD card into the SD-Card slot of the custom board
*Insert the SD card into the SD card slot of the custom board
*Press and hold the boot select switch while powering ON the board. Booting without pressing the boot-select button, CPU will boot from NAND-Flash. While currently our NAND is either empty, or has older revisions.
*Press and hold the boot select switch while powering ON the board. Booting without pressing the boot-select button, CPU will boot from NAND flash. While currently our NAND is either empty, or has older revisions.
*Login as root (no password)
*Login as root (no password)


Line 178: Line 193:


Push SW1 to NAND mode (Off), and SW2 to non-eMMC (off) <br>
Push SW1 to NAND mode (Off), and SW2 to non-eMMC (off) <br>
Make sure NAND-Flash binaries were flashed to NAND-Flash : [[VAR-SOM-AM43 NAND Flash Burning | NAND Flash Burning]]
Make sure NAND flash binaries were flashed to NAND flash : [[VAR-SOM-AM43 NAND Flash Burning | NAND Flash Burning]]


= Flash binaries to NAND  =
= Flash binaries to NAND  =
Please refer to : [[VAR-SOM-AM43 NAND Flash Burning | NAND Flash Burning]]
Please refer to : [[VAR-SOM-AM43 NAND Flash Burning | NAND Flash Burning]]


= Pre-built NAND Recovery SD-Card =
= Pre-built NAND Recovery SD card =
Variscite provides a sample bootable NAND-recovery rescue SD-Card<br>
Variscite provides a sample bootable NAND-recovery rescue SD card<br>
Image can be downloaded and mounted on SD-Card from Variscite's FTP, please refer to :<br>
Image can be downloaded and mounted on SD card from Variscite's FTP, please refer to :<br>
[[VAR-SOM-AM43_Yocto_NAND_Recovery | VAR-SOM-AM43 Yocto NAND Recovery]]
[[VAR-SOM-AM43_Yocto_NAND_Recovery | VAR-SOM-AM43 Yocto NAND Recovery]]


Line 206: Line 221:
In order to skip the Touch screen calibration on the first boot on carrier boards without a Touch screen -  
In order to skip the Touch screen calibration on the first boot on carrier boards without a Touch screen -  


Please insert the SD-Card to a Linux machine (or VM) after creating the SD-Card and type the following command to disable touch screen calibration at the first boot:
Please insert the SD card to a Linux machine (or VM) after creating the SD card and type the following command to disable touch screen calibration at the first boot:
<pre>
<pre>
$ sudo touch /media/boot/ws-calibrate.rules
$ sudo touch /media/boot/ws-calibrate.rules
</pre>
</pre>

Latest revision as of 10:22, 25 May 2018

VAR-SOM-AM43 Yocto 2.1 (Krogoth) Distribution User's Guide

About this Manual

This document describes how to install Variscite's Yocto release for the VAR-SOM-AM43.

The Yocto distribution provides a fundamental software platform for development, deployment and execution on VAR-SOM-AM43. It abstracts the functionality provided by the hardware.

In this context, the document contains instructions to:

  • Install the release on a development machine.
  • Build the sources included in this release.
  • Installing the binaries on the VAR-SOM-AM43.
  • Booting the VAR-SOM-AM43.

Installation

Prerequisites

Before starting the installation, make sure below system requirements are met:


The Linux host is used for the following:

  • Recompiling U-Boot / kernel.
  • Hosting the NFS server to boot the EVM with NFS as root filesystem.


Either of Windows or Linux host can be used for:

  • Hosting the TFTP server required for downloading the kernel and file-system images from U-Boot using Ethernet.
  • Running a serial console terminal application


Building the Yocto distribution via Bitbake will produce a complete set of downloaded source code + binaries for each component:

  • Yocto build environment
  • Downloaded Linux kernel source code + build kernel binaries (DTB and zImage) for VAR-SOM-AM43.
  • Downloaded U-Boot source code + build U-boot binaries (MLO and U-boot) for VAR-SOM-AM43.
  • Linux root file-system.

Install the Linaro toolchain

$ wget --no-check-certificate https://releases.linaro.org/components/toolchain/binaries/5.3-2016.05/arm-linux-gnueabihf/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz
$ sudo tar xf gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz -C /opt

Install development tools

$ sudo apt-get install git build-essential diffstat texinfo gawk chrpath gcc-multilib wget socat libsdl1.2-dev mtd-utils dos2unix

Download TI's Yocto Krogoth Distribution

$ mkdir ~/yocto_varsomam43
$ cd ~/yocto_varsomam43
$ git clone git://arago-project.org/git/projects/oe-layersetup.git tisdk

Downloading VAR-SOM-AM43 Support

Download the VAR-SOM-AM43 Yocto support installation from github:

$ mkdir ~/yocto_varsomam43/tisdk/sources
$ cd ~/yocto_varsomam43/tisdk/sources
$ git clone https://github.com/varigit/meta-variscite-amx3 -b krogoth

Downloading the Yocto Krogoth 2.1 configuration

Download the Yocto Krogoth 2.1 sources as follows:

$ cd ~/yocto_varsomam43/tisdk
$ ./oe-layertool-setup.sh -f sources/meta-variscite-amx3/conf/var-som-amx3_sdk-03.00.00-config.txt

local.conf customizations

Edit you local.conf file:

$ cd ~/yocto_varsomam43/tisdk/build
$ gedit conf/local.conf 

Change your parallel build and download directory:

Parallel build

Set the build parameters to fully utilize your host machine BB_NUMBER_THREADS = '4'
PARALLEL_MAKE = '-j 6' BB_NUMBER_THREADS should be your host machine's number of threads minus 2 or same. PARALLEL_MAKE should be the number of threads your host machine has plus two.

Download directory

Recommended to save download time and space. DL_DIR = "/home/<uname>/yocto_dl"

TI MIRRORS

One common location for hosting packages, gforge.ti.com, has recently been decommissioned. This will cause fetch failures for the current and past releases. Please add the following lines to your local.cof to configure the build to obtain these packages from the TI mirror.

TI_MIRROR = "http://software-dl.ti.com/processor-sdk-mirror/sources/"
MIRRORS += " \
 bzr://.*/.*      ${TI_MIRROR} \n \
 cvs://.*/.*      ${TI_MIRROR} \n \
 git://.*/.*      ${TI_MIRROR} \n \
 gitsm://.*/.*    ${TI_MIRROR} \n \
 hg://.*/.*       ${TI_MIRROR} \n \
 osc://.*/.*      ${TI_MIRROR} \n \
 p4://.*/.*       ${TI_MIRROR} \n \
 npm://.*/.*      ${TI_MIRROR} \n \
 ftp://.*/.*      ${TI_MIRROR} \n \
 https?$://.*/.*  ${TI_MIRROR} \n \
 svn://.*/.*      ${TI_MIRROR} \n \
"

Building the VAR-SOM-AM43 Yocto image

First, change directory to the build directory of Yocto:

$ cd ~/yocto_varsomam43/tisdk/build

The developer can build the tisdk-rootfs-image image as follows:

$ export PATH=/opt/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf/bin:$PATH
$ . conf/setenv
$ MACHINE=varsomam43 bitbake tisdk-rootfs-image

After the image was built, all images will be located in: ~/yocto_varsomam43/tisdk/build/arago-tmp-external-linaro-toolchain/deploy/images/varsomam43

Build Results

Image Name
Description
zImage Compressed kernel image
zImage-var-som-am43.dtb The VAR-SOM-AM43 kernel device tree
MLO The MLO is pre-u-boot SW component, required for DDR initialization
u-boot.img U-Boot bootloader
tisdk-rootfs-image-varsomam43.tar.gz Compressed rootfs tarball


If the rootfs directory already exists - Please make sure to erase all its content before extracting a new rootfs image into it:

$ sudo rm -rf ~/yocto_varsomam43/rootfs/*

Extract the rootfs as follows:

 $ sudo mkdir ~/yocto_varsomam43/rootfs
 $ sudo tar xvf ~/yocto_varsomam43/tisdk/build/arago-tmp-external-linaro-toolchain/deploy/images/varsomam43/tisdk-rootfs-image-varsomam43.tar.gz -C ~/yocto_varsomam43/rootfs

This creates a rootfs directory for the Yocto / VAR-SOM-AM43 build.

Create a bootable SD card

The below procedure will result in a bootable SD card:

  • SD card will be partitioned into 2 partitions:
    • FAT32 Boot partition: includes MLO and U-boot required for initial boot
    • ext3 file system: includes zImage, kernel device tree and a complete rootfs
  • All NAND flash binaries will be copied to rootfs under /opt/TISDK directory, for NAND Flash burning if required.

Please follow the below steps:

  • Insert a 4GB+ SD card to host computer
  • Run dmesg command to identify which /dev/sdX was created
  • To generate the SD card - Run script (and choose the correct /dev/sdX of the 4GB SD card inserted):
$ cd ~/yocto_varsomam43/tisdk/sources/meta-variscite-amx3/utils
$ sudo ./create-sdcard-am43.sh ~/yocto_varsomam43/tisdk ~/yocto_varsomam43/rootfs/

Boot

The Kernel and root the file-system can be booted either from NAND or SD card.

Following sections describe various kernel boot options possible.


NOTE:
Pleaes make sure your target board debug serial is connected to host PC with hyperterminal, as described in the quick-start guide.


Boot from MMC/SD

For creating a bootable SD , follow instructions on Creating a bootable SD card

To boot the bootable SD card, follow the steps below:

  • Power-off board
  • Insert the SD card into the SD card slot of the custom board
  • Press and hold the boot select switch while powering ON the board. Booting without pressing the boot-select button, CPU will boot from NAND flash. While currently our NAND is either empty, or has older revisions.
  • Login as root (no password)

Boot from NAND

Push SW1 to NAND mode (Off), and SW2 to non-eMMC (off)
Make sure NAND flash binaries were flashed to NAND flash : NAND Flash Burning

Flash binaries to NAND

Please refer to : NAND Flash Burning

Pre-built NAND Recovery SD card

Variscite provides a sample bootable NAND-recovery rescue SD card
Image can be downloaded and mounted on SD card from Variscite's FTP, please refer to :
VAR-SOM-AM43 Yocto NAND Recovery

Build U-Boot out of yocto tree

Please refer to : Build u-boot out of yocto tree

Building Linux kernel out-of-yocto tree

For manually building the Linux kernel, out of the yocto build system, please refer to :
Build linux kernel out of yocto tree


Out-of-tree Kernel Modules

NOTE:
Some drivers like the SGX and WLAN drivers are delivered as modules outside of the kernel tree. These drivers binaries are already included in the pre-built root file-systems provided by Variscite.

Support carrier boards without a Touch screen

In order to skip the Touch screen calibration on the first boot on carrier boards without a Touch screen -

Please insert the SD card to a Linux machine (or VM) after creating the SD card and type the following command to disable touch screen calibration at the first boot:

$ sudo touch /media/boot/ws-calibrate.rules