Ubuntu 12.04 64-bit Precise Pangolin Host Setup for Building i.MX28 L2.6.35_MX28_SDK_10.12_SOURCE [1] [1]

Document created by Diana Torres Employee on Sep 28, 2015
Version 1Show Document
  • View in full screen mode

 

Overview

Freescale's i.M28EVK development kit provides a platform for running software and evaluating features of the i.MX28 processor. This document provides the details for running the Linux Board Support Package (BSP) on the Ubuntu 12.04 64-bit Precise Pangolin Host on an Intel/AMD architecture computer. The 32-bit host is not covered in this document and does have different configuration steps than described here.

 

An Ubuntu Linux host is used to cross-compile the BSP creating ARM images. The BSP provides a build system named Linux Target Image Builder, (LTIB),  the GNU tool suite for compiling and debugging, U-Boot boot loader, Linux kernel, and a root file system.

Resources

Download Ubuntu 12.04.01

A dedicated computer running Ubuntu or a Virtual Machine, (VMware or VirtualBox), can be used for running the Host Ubuntu software. The Ubuntu image is available for downloaded from the Ubuntu site: Ubuntu 12.04.1 LTS (Precise Pangolin).

 

This Ubuntu host ISO was used with the md5 checksum:

ubuntu-12.04.1-desktop-amd64.iso  06472ddf11382c8da1f32e9487435c3d

 

One way to acquire the ISO is to use zsync to download:

zsync http://releases.ubuntu.com/12.04/ubuntu-12.04.1-desktop-amd64.iso.zsync
 

Once downloaded, installing the ISO is user preference - either a dedicated Linux PC or in a Virtual Machine.

 

Download i.MX28EVK BSP and Documents

The BSP download is from this site L2.6.36_MX28_SDK_10.12_Source and the documents from Linux documentation that requires a free registration to specify login credentials,

 

436e0b8e1c7976c657d530a45f9dbd0c L2.6.35_10.12.01_SDK_source_bundle.tar.gz

de0274320a17c1e989d1ef5c088973e2 L2.6.35_10.12.01_SDK_docs.tar.gz

 

Ubuntu Host Setup

Ubuntu login credentials of

  • User: user
  • Password: user

are used for this documents.

Host Package Update

Once logged in to the Ubuntu host, the existing packages are brought up to date to the latest version before installing the BSP. The Ubuntu package manager used is apt-get.

$ sudo apt-get update
$ sudo apt-get upgrade
 

01. Check all installed packages for new revisions

02. all newer packages found are installed.

 

Addtional packages are required for the ltib build system.

Ubuntu Configuration

PDF

evince is the default pdf reader, another option is zathura.

$ sudo apt-get install zathura

Sudo Priviledges

LTIB requires super user priviledges for some operations. To enable a visudo entry is added to the sudo'ers file. For more information run 'man visudo'.

 

$ sudo visudo
 

The first word, user, is the login account 'user' This can be changed to whatever login you used, or if you have groups configured you can provide a group that developers are in - refer to the man page for sudo for details.

Add this line:

 

user ALL =NOPASSWD: /usr/bin/rpm/ /opt/freescale/ltib/usr/bin/rpm

 

Default Shell

Ubuntu uses the default shell 'dash'. This however causes failures on bash scripting which is part of the ltib system. Change the default shell from 'dash' to 'bash'

 

$ sudo update-alternatives --install /bin/sh sh /bin/bash 1
 

CCACHE

ccache provides a fast C/C++ compiler cache which is supported in the ltib system. To configure once the ccache package has been installed:

$ sudo apt-get install ccache
$ ccache -M 50M
$ ccache -c
 

02. Set the cache limit to 50 Meg

03. Clear the cache folder

 

Directory Layout

The following directory structure is used:

/home/user/freescale/imx28/

|-- archive

|-- L2.6.35_10.12.01_ER_source

|-- L2.6.35_10.12.01_SDK_docs

|-- L2.6.35_10.12.01_SDK_scripts

|-- ltib

|-- ubuntu-imx28-ltib-patch

 

The archive directory is where the BSP and documents are stored; command to create the directory:

$ mkdir -p ~/freescale/imx28/archive

 

Extract SDK and Documents

The following instructions were used to extract the contents of the Software Development Kit:

 

$ cd ~/freescale/imx28/archive
$ tar -zxf L2.6.35_10.12.01_SDK_source_bundle.tar.gz -C ..
 

 

01. Change into the directory containing the tar ball that is compressed.

02. Extract the contents into the directory above (-C ..) the current directory

-z unzip

-x extract

-f L2.6.35_10.12.01_SDK_source_bundle.tar.gz

 

$ tar -zxf L2.6.35_10.12.01_SDK_docs.tar.gz
 

01. Extract the contents into the directory above (-C ..) the current directory

    -z unzip

    -x extract

    -f L2.6.35_10.12.01_SDK_docs.tar.gz this file


The contents of both tar files are now in the directory /home/user/freescale/imx28.

Install BSP Sources

After extracting the content from the L2.6.35_10.12.01_SDK_source_bundle.tar.gz the file L2.6.35_10.12.01_SDK.source.tar.gz contains all the sources and the build system. Extract the contents and install. This will create the ltib directory which is the build system.

$ tar -zxf L2.6.35_10.12.01_SDK_source.tar.gz
$ cd L2.6.35_10.12.01_ER_source
$ ./install
 

Read the license information and accept by entering YES. An installation directory is then asked for, providing:  .. which is the parent directory.
The installation script copies the packages and will inform you that 'Installation complete, your ltib installation has been placed in ../ltib, to complete the installation:

cd .../ltib
./ltib
 

HOWEVER before doing this, there are packages and patches that need to be applied to run ltib on Ubuntu 12.04.01.

Ubuntu Software Packages for LTIB

The following packages are required. The script pkg-setup.sh attached below has these packages which can be downloaded and executed to install.

$ sh pkg-setup.sh
 

sudo apt-get -y install gettext libgtk2.0-dev rpm bison m4 libfreetype6-dev

sudo apt-get -y install libdbus-glib-1-dev liborbit2-dev intltool

sudo apt-get -y install ccache zlib1g zlib1g-dev gcc g++ libtool

sudo apt-get -y install uuid-dev liblzo2-dev tcl wget libncurses5-dev

sudo apt-get -y install libncursesw5-dev lib32z1 libglib2.0-dev xsltproc

sudo apt-get -y install ia32-libs libc6-dev-i386

The file pkg2-setup.sh contains optional packages for development. To install, download and execute:

$ sh pkg2-setup.sh

Please refer to the document ltib_build_host_setup.pdf for more information on host setup.

Patching LTIB

The location of files from the glibc-devel and zlib Ubuntu 12.04 packages has changed from 9.0.4 Ubuntu which the original ltib was released against. To update ltib operation the following patches are implemented from the directory ~/freescale/imx28/ltib

1. The file ltib is changed at line 2387 adding the '-v' option to the rpm call

OLD:

    system('rpm --force-debian 2>/dev/null') == 0?

NEW:

    system('rpm -v --force-debian 2>/dev/null') == 0?

2. The file bin/Ltibutils.pm is updated to support glibc-devel and zlib.

 

glibc-devel update: Line 563 add check for /usr/lib32/libm.so

'glibc-devel' => sub {-f 'usr/lib/libm.so' || -f '/usr/lib64/libz.so' || -f '/usr/lib32/libm.so'},

 

zlibc update: Line 584 add /lib/x86_64-linux-gnu/libz.so*

zlib => sub{my @f = (glob('/usr/lib/libz.so*'),

              glob('/lib/x86_64-linux-gnu/libz.so*'),

              glob('/lib/libz.so*'),

 

The above patches are also in the attachment 0001-patches-for-12.04-ubuntu.patch.

 

LTIB packages also need adjustments to correctly build on Ubuntu. The tar file below, ubuntu-imx28-ltib-patch.tgz contains all the updates. Download and extract the contents at the same directory level as your ltib source directory.

$ tar -zxf ubuntu-imx28-ltib-patch.tgz

├── ltib

├── ubuntu-imx28-ltib-patch

└── ubuntu-imx28-ltib-patch.tgz

Change directories to ubuntu-imx28-ltib-patch and then run the install-patches.sh script.

$ cd ubuntu-imx28-ltib-patch

$ ./install-patches.sh

 

The following packages are updated:

  • lkc
  • mtd-utils
  • mux_server
  • sparse

Create SD Card Using Ubuntu Host

The tar file L2.6.35_10.12.01_SDK_scripts.tar.gz contains scripts for writing the images from the ltib build to a SD card. Extract the content, copy the scripts to the ltib directory, and update the mk_mx28_sd script to work with the updated fdisk command.

 

$ tar -zxf L2.6.35_10.12.01_SDK_scripts.tar.gz
$ cd L2.6.35_10.12.01_SDK_scripts
$ cp mk_hdr.sh ~/freescale/imx28/ltib
$ cp mk_mx28_sd ~/freescale/imx28/ltib
$ cd ~/freescale/imx28/ltib
 

Edit mk_mx28_sd script and add the 'u' at line 177 then the o command after. This changes cylinders to sectors.

 

OLD:

echo "o

n

 

NEW:

echo "u

o

n

 

Once updated to create the SD card which is at /dev/sdb:

$ ./mk_mx28_sd /dev/sdb
 

NOTE: if mounted automatically, you need to unmount for the script to work

$ sudo umount /dev/sdb*
 

 

 

Media Booting Selection

The i.MX28EVK has a boot option to execute from the SD Card in Slot 0 which is located on the bottom of the EVK. On the top of the EVK there are switches that are read during the start up process to determine what boot media to use. The SD Card in slot 0 is used for this example which requires the settings:

B3/DIP1B2/DIP2B1/DIP3B0/DIP4
1001

Refer to the user guide, i.MX28_Linux_BSP_UG.pdf section 3.2.1. Boot Modes for all options. The user guide is found in the Linux documentation bundle documentation.  Refer to the next section for a picture showing the boot switch location and the SD Card Slot 0 location.

Cable Connections

A computer serial port is connected to the i.MX28EVK serial port. The communication setting is 115200 baud, 8 data bits, No parity, and 1 stop bit. There is NO flow control set for this port. This is typically shown as 115200, 8N1. The power supply is connected

 

iMX28Block.PNG

Outcomes