VAR-SOM-AM33 Yocto FIDO GS: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
 
(48 intermediate revisions by 2 users not shown)
Line 15: Line 15:
*Instaling the binaries on the VAR-SOM-AM33.
*Instaling the binaries on the VAR-SOM-AM33.
*Booting the VAR-SOM-AM33.
*Booting the VAR-SOM-AM33.
= Installing required packages<br/> =
Follow the link below and install all required packages on your machine.
[http://www.yoctoproject.org/docs/latest/yocto-project-qs/yocto-project-qs.html www.yoctoproject.org/docs/latest/yocto-project-qs/yocto-project-qs.html]
Please make sure you host PC is running Ubuntu 14.04 and install the following packages:
<pre>
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev
sudo apt-get install autoconf libtool libglib2.0-dev libarchive-dev
sudo apt-get install python-git xterm sed cvs subversion coreutils texi2html
sudo apt-get install docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev
sudo apt-get install libglu1-mesa-dev mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils
</pre>


= Installation  =
= Installation  =
Line 23: Line 38:


*Host machine running a Ubuntu 14.04 64 LTS.
*Host machine running a Ubuntu 14.04 64 LTS.
*[http://www.variscite.com/products/evaluation-kits/var-dvk-am33 VAR-SOM-AM33 Evaluation Kit] + VAR-SOM-AM33 Yocto support installation sources and binaries (from FTP). Please refer to support@variscite.com for obtaining FTP credentials.
*[http://www.variscite.com/products/evaluation-kits/var-dvk-am33 VAR-SOM-AM33 Evaluation Kit]


<br/>The Linux host is used for the following:  
<br/>The Linux host is used for the following:  
Line 43: Line 58:
=== Install the Arago toolchain ===
=== Install the Arago toolchain ===
<pre>
<pre>
$ wget --no-check-certificate http://releases.linaro.org/15.05/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf.tar.xz
$ wget --no-check-certificate http://releases.linaro.org/archive/15.05/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf.tar.xz
$ sudo tar -xvf gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf.tar.xz -C /opt
$ sudo tar -xvf gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf.tar.xz -C /opt
</pre>
</pre>


=== Install development tools ===
=== Download TI's Yocto Fido Distribution ===
$ sudo apt-get install git build-essential diffstat texinfo gawk chrpath gcc-multilib wget socat libsdl1.2-dev mtd-utils dos2unix
 
=== Download the Yocto Distribution ===
To quickly start making your own builds using meta-ti BSP layer and meta-arago Distribution layer, you can follow this short Quick Start section by entering below commands. For
more expanded guide with each step detailed and sample output of the entered commands shown, please see the next Detailed Setup section.
<pre>
<pre>
$ mkdir ~/yocto_varsomam33
$ mkdir ~/yocto_varsomam33
Line 68: Line 78:


==== Downloading the YOCTO Fido 1.8 configuration ====
==== Downloading the YOCTO Fido 1.8 configuration ====
Download the YOCTO Fido 1.8 configuration as follows:
Download the YOCTO Fido 1.8 sources as follows:
<pre>
<pre>
$ cd ~/yocto_varsomam33/tisdk
$ cd ~/yocto_varsomam33/tisdk
$ ./oe-layertool-setup.sh -f sources/meta-variscite-amx3/conf/var-som-amx3_sdk-02.00.00-config.txt
$ ./oe-layertool-setup.sh -f sources/meta-variscite-amx3/conf/var-som-amx3_sdk-02.00.00-config.txt
$ cd build
$ . conf/setenv
</pre>
</pre>
At this point, Variscite Yocto support has been installed over the Yocto distribution and ready to be be built.


=== local.conf customizations ===
=== local.conf customizations ===
Line 95: Line 101:
DL_DIR = "/home/&lt;uname&gt;/yocto_dl"<br>
DL_DIR = "/home/&lt;uname&gt;/yocto_dl"<br>


=== Setting up the Toolchain ===
==== TI MIRRORS  ====
<pre>
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.
$ export PATH=/opt/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf/bin:$PATH
 
</pre>
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 \
  git://git.ti.com/ti-cm3-pm-firmware/amx3-cm3.git git://git.ti.com/processor-firmware/ti-amx3-cm3-pm-firmware.git \n \
"


= Building the VAR-SOM-AM33 Yocto image =
= Building the VAR-SOM-AM33 Yocto image =
Line 114: Line 134:
After the image was built, all images will be located in: ~/yocto_varsomam33/tisdk/build/arago-tmp-external-linaro-toolchain/deploy/images/ - Specifically:
After the image was built, all images will be located in: ~/yocto_varsomam33/tisdk/build/arago-tmp-external-linaro-toolchain/deploy/images/ - Specifically:


*MLO image
== Build Results ==
*u-boot.img image
The resulted images are located in tmp/deploy/images/var-som-mx6.<br/>
*zImage
 
*zImage-var-som-am33.dtb
{| class="wikitable"
*Compressed rootfs image: tisdk-rootfs-image-varsomam33.tar.bz2
|-
! scope="col" | Image Name<br/>
! scope="col" | How to use<br/>
|-
| zImage
| Kernel uncompressed image
|-
| zImage-var-som-am33.dtb
| The VAR-SOM-AM33 kernel device tree
|-
| uImage
| Linux kernel image, same binary for SD-Card or NAND Flash
|-
| MLO
| The MLO is pre-u-boot SW component, required for DDR initialization
|-
| u-boot.img
| U-Boot bootloader
|-
| tisdk-rootfs-image-varsomam33.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:
If the rootfs directory already exists - Please make sure to erase all its content before extracting a new rootfs image into it:
Line 129: Line 171:
</pre>
</pre>
This creates a rootfs directory for the Yocto / VAR-SOM-AM33 build.
This creates a rootfs directory for the Yocto / VAR-SOM-AM33 build.
== Linux Root File-System ==
To boot-up Linux, a target file-system is needed. A file-systems is built from the Yocto distribution for VAR-SOM-AM33.
*Demo filesystem (~250MB) - This file system is created by taking the base file system and adding all the additional SDK components such as 3D graphics, matrix, profiling tools, etc... - tisdk-rootfs-image-varsomam33.tar.bz2
Further explanation about customizing these file-systems&nbsp;can be found [http://processors.wiki.ti.com/index.php/AMSDK_File_System_Optimization/Customization here].


= Create a bootable SD-Card =
= Create a bootable SD-Card =
To create a bootable SD-Card image, which includes a UBIFS file-system based recovery image - Please do as follows:
The below procedure will result in a bootable SD-Card:
* Insert a 4GB SD-Card to host computer
* 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[[VAR-SOM-AM33 NAND Flash Burning|  NAND Flash burning]] if required.
Please follow the below steps: <br>
* 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  


Line 149: Line 188:
</pre>
</pre>


= Boot  =


The above procedure will result in a bootable SD-Card including MLO, U-boot, Kernel and file system + Linux recovery image to flash the NAND based on UBI file-system.
The Kernel and root the file-system can be booted either from NAND or SD-Card.
To boot the bootable SD-Card, follow the steps below:
 
* Insert the SD card into the SD/MMC slot of the custom board
* Press and hold the boot select switch while powering ON the board
* Login as root (no password)


Following sections describe various kernel boot options possible.<br>




{{note|'''NOTE:'''<br/> Pleaes make sure your target board debug serial is connected to host PC with hyperterminal, as described in the quick-start guide.|info}}


= Boot  =
The Kernel and root the file-system can be booted either from NAND, SD-Card or can be retrieved via ethernet to RAM using TFTP.
Nand Flash root file-system is UBIFS based which is the most recommended filesystem for nand flashes.
Following sections describe various kernel boot options possible.<br>


== Boot from MMC/SD ==
== Boot from MMC/SD ==


For creating a bootable SD , follow the below instruction on creating a resude SD.&nbsp;[http://www.variwiki.com/index.php?title=VAR-SOM-AM33_Arago_GS#NAND_Recovery http://www.variwiki.com/index.php?title=VAR-SOM-AM33_Arago_GS#NAND_Recovery]
For creating a bootable SD , follow instructions on [[VAR-SOM-AM33 Yocto FIDO GS#Create a bootable SD-Card |Creating a bootable SD-Card ]]


To boot the Linux, type:
To boot the bootable SD-Card, follow the steps below:
 
*Power-off board
U-Boot# run mmc_boot
*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  ==
== Boot from NAND  ==


By default the VAR-SOM-AM33 boots from NAND.  
If boot-select button is not pressed at power-up,by default the VAR-SOM-AM33 boots from NAND. <br>
 
Make sure NAND-Flash binaries were flashed to NAND-Flash : [[VAR-SOM-AM33 NAND Flash Burning | NAND Flash Burning]]
The SPL, U-Boot, kernel uImage and UBIFS filesystem are flashed on the NAND flash at production.
 
=== Flash Images to NAND ===
 
Replacing Nand Flash images can be done from either Linux user space or U-Boot.
 
<u>From U-Boot</u><br>
<pre>U-Boot # mmc rescan
U-Boot # nand erase 0x0 0x280000
U-Boot # mmc rescan
U-Boot # fatload mmc ${mmc_dev} ${loadaddr} MLO
U-Boot # nand write ${loadaddr} 0x0 0x20000
U-Boot # nand write ${loadaddr} 0x20000 0x20000
U-Boot # nand write ${loadaddr} 0x40000 0x20000
U-Boot # fatload mmc ${mmc_dev} ${loadaddr} u-boot.img
U-Boot # nand write ${loadaddr} 0x80000 0x1c0000
U-Boot # fatload mmc ${mmc_dev} ${loadaddr} uImage
U-Boot # nand erase 0x280000 0x500000
U-Boot # nand write ${loadaddr} 0x280000 0x500000
</pre>
<u>From Linux shell</u><u></u><br>
<pre>  &lt;&lt; Install SPL &gt;&gt;
$ flash_erase /dev/mtd0 0 0
$ flash_erase /dev/mtd1 0 0
$ flash_erase /dev/mtd2 0 0
$ flash_erase /dev/mtd3 0 0
$ nandwrite -p /dev/mtd0 &lt;MLO file&gt;
$ nandwrite -p /dev/mtd1 &lt;MLO file&gt;
$ nandwrite -p /dev/mtd2 &lt;MLO file&gt;
$ nandwrite -p /dev/mtd3 &lt;MLO file&gt;
 
  &lt;&lt; Install U-Boot &gt;&gt;
$ flash_erase /dev/mtd4 0 0
$ flash_erase /dev/mtd5 0 0
$ nandwrite -p /dev/mtd4 &lt;u-boot.img file&gt;
 
  &lt;&lt; Install Kernel &gt;&gt;
$ flash_erase /dev/mtd6 0 0
$ nandwrite -p /dev/mtd6 &lt;uImage file&gt;
</pre>
== Boot over Network (Ethernet)  ==
 
{{note|'''NOTE''':<br/>When setting a MAC address please ensure that the LS-bit of the 1st byte is not 1 i.e. when setting the MAC address: y in x'''y''':ab:cd:ef:gh:jk has to be an even number. |info}}
 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; For more info this refer to the wiki page [http://en.wikipedia.org/wiki/MAC_address http://en.wikipedia.org/wiki/MAC_address].<br>
 
When kernel image and root file-system are fetched from a TFTP/NFS server:
 
*Ensure that the SOM is connected to network with DHCP and TFTP server set up
*If the TFTP server supports negotiation between client and server, Disable it
*Copy 'uImage' kernel image to TFTP server's root directory.
*Set 'ethaddr' U-Boot environment variable with proper ethernet address in format 'xx:xx:xx:xx:xx:xx' (replace 'xx' with proper hexadecimal values)<br>
*Setup NFS server and export one of the provided pre-build root file-system
*Execute following commands at U-Boot prompt. Assuming kernel image name as 'uImage':<br>
U-Boot # setenv fdtfile '&lt;var-som-am33.dtb filename on TFTP&gt;'
U-Boot # setenv bootfile &lt;zImage filename on TFTP&gt;
U-Boot # setenv netargs 'setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp vram=50M'
U-Boot # setenv serverip &lt;Server IP address&gt;
U-Boot # setenv rootpath '&lt;Path of the exported root file-system on the NFS server&gt;'
U-Boot # run netboot
 
'''Note, that the roopath parameter should be the directory of the extracted rootfs image, as explained above in section [http://variwiki.com/index.php?title=VAR-SOM-AM33_Yocto_GS#Building_the_VAR-SOM-AM33_Yocto_image Building the VAR-SOM-AM33 Yocto image] extracting the image to '/home/user/yocto_varsomam33/rootfs/'.'''
 
= NAND Recovery  =
 
As an easy and fast way to recover the VAR-SOM-AM33 NAND flash, Variscite provides a recovery SD card image that can be used to install the pre-built Linux and Android systems.<br>This SD card image includes a script (nand-recovery.sh) that installs all the boot images and root file-system.<br>
 
'''Preparing rescue SD-Card'''
 
*Plug your SD card to your Linux machine, run dmesg and see what device is added (i.e. /dev/sd<span style="color: rgb(255, 0, 0);">'''X'''</span>)
*xz -d am33-som-nand-recovery-sd_Yocto_1_6_v1.img.xz
*dd if=am33-som-nand-recovery-sd_Yocto_1_6_v1.img of=/dev/sd<span style="color: rgb(255, 0, 0);">'''X'''</span> bs=128k
*sync
 
 
'''Recover Nand Flash: TI-SDK (Linux with TI Matrix)'''
 
*Insert the SD-card into the SD/MMC slot of the custom board
*Press and hold the boot select switch while powering ON the board<br>
*Login as root (no password)
*From Linux command line, type: "'''nand-recovery.sh -o TISDK'''". (This will install Linux on the NAND)
*Unplug the SD card and reboot
 


'''Recover Nand Flash: Android'''
= Flash binaries to NAND  =
Please refer to : [[VAR-SOM-AM33 NAND Flash Burning | NAND Flash Burning]]


*Insert the SD-card into the SD/MMC slot of the custom board
= Pre-built NAND Recovery SD-Card =
*Press and hold the boot select switch while powering ON the board<br>  
Variscite provides a sample bootable NAND-recovery rescue SD-Card<br>
*Login as root (no password)
Image can be downloaded and mounted on SD-Card from Variscite's FTP, please refer to :<br>
*From Linux command line, type: "'''android-nand.sh'''". (This will install Android on the NAND)
[[VAR-SOM-AM33_Yocto_NAND_Recovery | VAR-SOM-AM33 Yocto NAND Recovery]]
*Unplug the SD card and reboot


= Build U-Boot out of yocto tree =
= Build U-Boot out of yocto tree =
Line 278: Line 225:
Please refer to : [[VAR-SOM-AM33_Yocto Fido R1 Build u-boot out of tree | Build u-boot out of yocto tree]]
Please refer to : [[VAR-SOM-AM33_Yocto Fido R1 Build u-boot out of tree | Build u-boot out of yocto tree]]


= Linux Kernel  =
= Building Linux kernel out-of-yocto tree  =
 
== Downloading source code ==
*Linux kernel sources can be downloaded from&nbsp;'''git@github.com:varigit/VAR-SOM-AMx3-Kernel-4-1.git'''<br>
*The kernel is built automatically by bitbake.
*This directory includes Variscite's patches(already applied)&nbsp;to support the VAR-SOM-AM33.
*Based on the open source repositorie:&nbsp;[git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git], Branch:&nbsp;ti-linux-3.14.y
 
First, clone the git repositories to a local directory, as follows:
<pre>
$ mkdir ~/varsomam33
$ cd ~/varsomam33
$ git clone https://github.com/varigit/VAR-SOM-AMx3-Kernel-4-1.git
</pre>
 
== Setup Toolchain path ==
<pre>
$ export PATH=/opt/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf/bin:$PATH
</pre>
 
== Cleaning the Kernel Sources  ==
 
Prior to compiling the Linux kernel make sure that the kernel sources are clean.
 
Enter linux kernel directory:
 
$ cd VAR-SOM-AM33-Kernel-4-1/
 
{{note|'''NOTE:'''The next step will delete any saved .config file in the kernel tree as well as the generated object files. If you have done a previous configuration and do not wish to lose your configuration file you should save a copy of the configuration file before proceeding. |info}}
 
The command to clean the kernel is:
 
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mrproper
 
== Configuring the Kernel  ==
 
Before compiling the Linux kernel it needs to be configured to select which components will become part of the kernel image:
 
=== Using Default Configurations ===
 
To build the defualt configuration for the VAR-SOM-AM33:
 
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_defconfig
 
=== Customizing the Configuration<br>  ===
 
For configuring the kernel run:
 
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
 
Once the configuration window is open you can select which kernel components will be included in the build. Exiting the configuration will save your selections to a file in the root of the kernel tree called .config.
 
== Compiling the Kernel ==
 
Once the kernel has been configured compile kernel:
 
$ make -j12 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage LOADADDR=0x80200000
 
This will result in a kernel image file being created in the arch/arm/boot/ directory called uImage. This file can be used by u-boot to boot your device.
 
If you selected any components of the kernel to be build as dynamic modules you must issue an additional command to compile those modules. The command is:


$ make -j12 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules
For manually building the Linux kernel, out of the yocto build system, please refer to : <br>
[[VAR-SOM-AM33_Yocto_Fido_R1_Build_Linux_out_of_tree | Build linux kernel out of yocto tree]]


This will result in .ko (kernel object) files being placed in the kernel tree. These .ko files are the dynamic kernel modules. The next section will cover how to install these modules.


== Building the VAR-SOM-AM33 device tree ==
To build the VAR-SOM-AM33 device tree (dtb image), please use the following command line:
<pre>
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- var-som-am33.dtb
</pre>
The image will be located in: arch/arm/boot/dts/var-som-am33.dtb
== Installing the Kernel ==
Once the Linux kernel and modules have been compiled they must be installed. In the case of the kernel image this can be installed by copying the uImage file to the location for downloading using TFTP, or put in an SD-card.
For example: when using TFTP boot, &nbsp;/tftpboot directory is the common location, whereas when booting from SD card, file should be put in the first FAT partition.
To install the kernel modules, provide the rootfs location, see below.
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_varsomam33/rootfs/*
First, extract the rootfs of the tisdk-rootfs-image image as follows:
<pre> $ sudo mkdir ~/yocto_varsomam33/rootfs
$ sudo tar xvf ./arago-tmp-external-linaro-toolchain/deploy/images/varsomam33/tisdk-rootfs-image-varsomam33.tar.gz -C ../../rootfs
</pre>
This command will create a directory tree in that location: lib/modules/&lt;kernel version&gt; which will contain the dynamic modules corresponding to this version of the kernel. The base location should usually be the root of your target file system. The general format of the command is:
$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=<path to root of file system>
For example if you are installing the modules to an NFS share located at ~/yocto_varsomam33/rootfs you would do:
$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=~/yocto_varsomam33/rootfs
=== Installing the kernel to a VAR-SOM-AM33 SD-Card ===
In order to install the kernel to the SD-Card, please follow the instructions below:<br/>1) Insert SD-Card with VAR-SOM-AM33 image.<br/>2) Build the kernel as explained above.<br/>3) Install by executing the following commands:
<pre>$ sudo cp -a arch/arm/boot/zImage /media/rootfs/boot
$ sudo cp -a arch/arm/boot/dts/var-som-am33.dtb /media/rootfs/boot
$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=/media/rootfs
$ sync
$ sudo umount /media/boot
$ sudo umount /media/rootfs
$ sudo umount /media/user
</pre>
=== Out-of-tree Kernel Modules ===
=== Out-of-tree Kernel Modules ===


{{note|'''NOTE:'''<br/> 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.|info}}
{{note|'''NOTE:'''<br/> 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.|info}}


 
= Support carrier boards without a Touch screen =
 
== 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 -  
In order to skip the Touch screen calibration on the first boot on carrier boards without a Touch screen -  

Latest revision as of 18:17, 10 February 2022

VAR-SOM-AM33 Yocto 1.8 (Fido) Distribution User's Guide

About this Manual

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

The Yocto distribution provides a fundamental software platform for development, deployment and execution on VAR-SOM-AM33. 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.
  • Instaling the binaries on the VAR-SOM-AM33.
  • Booting the VAR-SOM-AM33.

Installing required packages

Follow the link below and install all required packages on your machine.

www.yoctoproject.org/docs/latest/yocto-project-qs/yocto-project-qs.html

Please make sure you host PC is running Ubuntu 14.04 and install the following packages:

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev
sudo apt-get install autoconf libtool libglib2.0-dev libarchive-dev
sudo apt-get install python-git xterm sed cvs subversion coreutils texi2html
sudo apt-get install docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev
sudo apt-get install libglu1-mesa-dev mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils

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-AM33.
  • Downloaded U-Boot source code + build U-boot binaries (MLO and U-boot) for VAR-SOM-AM33.
  • Linux root file-system.

Install the Arago toolchain

$ wget --no-check-certificate http://releases.linaro.org/archive/15.05/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf.tar.xz
$ sudo tar -xvf gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf.tar.xz -C /opt

Download TI's Yocto Fido Distribution

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

Downloading VAR-SOM-AM33 Support

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

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

Downloading the YOCTO Fido 1.8 configuration

Download the YOCTO Fido 1.8 sources as follows:

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

local.conf customizations

Edit you local.conf file:

$ cd ~/yocto_varsomam33/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 \
 git://git.ti.com/ti-cm3-pm-firmware/amx3-cm3.git git://git.ti.com/processor-firmware/ti-amx3-cm3-pm-firmware.git \n \
"

Building the VAR-SOM-AM33 Yocto image

First, change directory to the build directory of Yocto:

$ cd ~/yocto_varsomam33/tisdk/build

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

$ export PATH=/opt/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf/bin:$PATH
$ . conf/setenv
$ MACHINE=varsomam33 bitbake tisdk-rootfs-image

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

Build Results

The resulted images are located in tmp/deploy/images/var-som-mx6.

Image Name
How to use
zImage Kernel uncompressed image
zImage-var-som-am33.dtb The VAR-SOM-AM33 kernel device tree
uImage Linux kernel image, same binary for SD-Card or NAND Flash
MLO The MLO is pre-u-boot SW component, required for DDR initialization
u-boot.img U-Boot bootloader
tisdk-rootfs-image-varsomam33.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_varsomam33/rootfs/*

Extract the rootfs as follows:

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

This creates a rootfs directory for the Yocto / VAR-SOM-AM33 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_varsomam33/tisdk/sources/meta-variscite-amx3/utils
$ sudo ./create-sdcard.sh ~/yocto_varsomam33/tisdk ~/yocto_varsomam33/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

If boot-select button is not pressed at power-up,by default the VAR-SOM-AM33 boots from NAND.
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-AM33 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