Building The i.MX28 Board Support Package (BSP) With LTIB - Part 2

In the first part we worked on getting LTIB configured for our machine. We ran into alot of problems but fixed each problem after a bit of online reading. In this part we attempt to actually build the bootloaders, kernel and applications with LTIB which will comprise the BSP

Conrad Gomes • February 6, 2015

Configuring LTIB for i.MX28

LTIB Offers a lot of flexibility in choosing the type of embedded system that is required for the platform. Depending on the use case different aspects can be configured using ltib.

Selecting The Platform

On running ltib it will display the ncurses dialog which is used to select the desired platform. In our case it is Freescale iMX reference boards as shown below:

Ncurses screen with platform selection

On exiting it will ask you if you want to save the configuration. Make sure “yes” is selected and then exit:

Saving the new configuration

Selecting The Freescale Platform Type And Profile

It will then ask you to select the type of Freescale as i.MX28 development platform

Selecting the type of development platform as imx28

Also select the package profile. We select the “(Min profile)”

Selecting the type of profile as “Min profile”

On exiting it will ask you if you want to save the configuration. Make sure “yes” is selected and then exit:

Saving the new configuration of development platform

Configuring The Freescale i.MX28 Board Package

We see the ncurses configuration page for the i.MX28 board. From here the various features of the board can be configured.

Saving and exiting without modifying the default configuration

Default Build

The configuration loaded can be built without modifying it. We can take a look and see what’s happening just by hitting exit and running the LTIB build. The steps are hit exit. Then save the configuration when prompted on the ncurses screen. We see is a failure to build of the kind:

Installing: gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm
Try gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm.md5 from the PPP  
Try gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm.md5 from the GPP
http://bitshrine.org/gpp/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm.md5:
22:44:07 ERROR 404: Not Found.
Try gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm from the PPP
Try gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm from the GPP
http://bitshrine.org/gpp/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm:
22:44:08 ERROR 404: Not Found.
Can't get: gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm at ./ltib line 2560.   
Died at ./ltib line 2560.
traceback:
 main::check_toolchain_setup:2560
  main::pre_build_checks:1465
   main:569


Started: Tue Feb 10 22:25:52 2015
Ended:   Tue Feb 10 22:44:08 2015
Elapsed: 1096 seconds


Build Failed

Exiting on error or interrupt
  • It looks like the toolchain is not found in the PPP and GPP after trying to install it from the local cache

  • The LTIB build fails

For further information about PPP and GPP please check out the following link:
Where do the sources get downloaded from

Selecting The Right Toolchain

The toolchain is the set of tools including the cross-compiler which is required to build the BSP for development on the desired target. By default the toolchain selected is ARM, gcc-4.6.2, multilib, neon optimized, gnueabi/eglibc2.13. We have to change this to ARM, gcc-4.4.4, multilib, neon optimized which is the correct one available in the LTIB system. Run the following to bring up the ncurses configuration page:

ubuntu@ubuntu-VirtualBox:~/beta/projectX/ltib$ ./ltib --configure

With that go to the “Toolchain selection” section and hit Enter on the default option which is Toolchain (ARM, gcc-4.6.2, multilib, neon optimized, gnueabi/eglibc2.13) We see a pop up with a list of toolchains. Select the ARM, gcc-4.4.4, multilib, neon optimized option.

Selecting the appropriate toolchain

On exiting we see the BSP being built which takes some time to complete. This is a test and development profile BSP which is built so it may not be exactly what is required for your target.

sudo /opt/freescale/ltib/usr/bin/rpm --root /home/ubuntu/beta/projectX/ltib/rootfs --dbpath /var/lib/rpm -e --allmatches --nodeps --define '_tmppath /tmp/ltib' modeps 2>/dev/null
sudo /opt/freescale/ltib/usr/bin/rpm --root /home/ubuntu/beta/projectX/ltib/rootfs --dbpath /var/lib/rpm --prefix / --ignorearch -ivh --force --excludedocs --define '_tmppath /tmp/ltib' /home/ubuntu/beta/projectX/ltib/rpm/RPMS/arm/modeps-1.0-1.arm.rpm
error: failed to stat /run/user/110/gvfs: Permission denied
Preparing...                ########################################### [100%]
   1:modeps                 ########################################### [100%]

Processing deployment operations
==================================
making filesystem image file
staging directory is /home/ubuntu/beta/projectX/ltib/rootfs.tmp
removing the boot directory and files
removing man files and directories
removing info files
removing /usr/share/locale directory
removing static libraries
removing target rpm database
stripping binaries and libraries

Filesystem stats, including padding:

    Total size            = 15040k
    Total number of files = 1293


Started: Wed Feb 11 04:30:28 2015
Ended:   Wed Feb 11 04:45:46 2015
Elapsed: 918 seconds

Build Succeeded

Exploring The Built BSP

After building, LTIB will generate the following in the rootfs/boot/ directory:

ubuntu@ubuntu-VirtualBox:~/beta/projectX/ltib$ ls -l rootfs/boot/
total 19784
lrwxrwxrwx 1 root root       6 Feb 11 04:42 bootable_kernel -> uImage
-rwxr-xr-x 1 root root   50960 Feb 11 04:45 boot_prep
-rwxr-xr-x 1 root root     803 Feb 11 04:45 create_updater.sh
-rw-r--r-- 1 root root 2586880 Feb 11 04:45 imx28_ivt_linux.sb       
-rw-r--r-- 1 root root  141184 Feb 11 04:45 imx28_ivt_uboot.sb       
-rw-r--r-- 1 root root 2586688 Feb 11 04:45 imx28_linux.sb           
-rw-r--r-- 1 root root  141040 Feb 11 04:45 imx28_uboot.sb           
-rw-r--r-- 1 root root   52953 Feb 11 04:42 linux.config
-rwxr-xr-x 1 root root   14855 Feb 11 04:45 linux_prep
-rwxr-xr-x 1 root root   57469 Feb 11 04:45 power_prep
-rw-r--r-- 1 root root 1224927 Feb 11 04:42 System.map
-rwxr-xr-x 1 root root  518068 Feb 11 04:33 u-boot
-rwxr-xr-x 1 root root  123572 Feb 11 04:33 u-boot.bin
-rw-r--r-- 1 root root 2566320 Feb 11 04:42 uImage                   
-rw-r--r-- 1 root root    1236 Feb 11 04:45 updater.bd
-rw-r--r-- 1 root root    1421 Feb 11 04:45 updater_ivt.bd
-rwxr-xr-x 1 root root 7523413 Feb 11 04:42 vmlinux                  
-rwxr-xr-x 1 root root 2566256 Feb 11 04:42 zImage                   
  • The HAB enabled bootstream of bootlets and kernel image

  • The HAB enabled bootstream of bootloet and uboot image

  • The HAB disabled bootstream of bootlets and kernel image

  • The HAB disabled bootstream of bootloet and uboot image

  • The uboot compatible kernel image

  • The ELF format kernel image

  • The compressed self extracting image of the kernel

The application rootfs is generated in the top directory of ltib as a JFFS2 filesystem image which can be flashed onto a NAND partition. The filesystem format can be changed to EXT2/EXT3/etc.. by changing the configuration of the LTIB build.

ubuntu@ubuntu-VirtualBox:~/beta/projectX/ltib$ ls -l
total 5308
drwxrwxrwx  2 ubuntu ubuntu    4096 Feb 11 03:49 bin
drwxrwxrwx  6 ubuntu ubuntu    4096 Feb 11 04:30 config
-rwxrwxrwx  1 ubuntu ubuntu   17989 Jan  8  2013 COPYING
drwxrwxrwx  3 ubuntu ubuntu    4096 Jan  8  2013 dist
drwxrwxrwx  2 ubuntu ubuntu    4096 Jan  8  2013 doc
-rwxrwxrwx  1 ubuntu ubuntu      41 Jan 30  2013 hash
-rw-rw-r--  1 ubuntu ubuntu    1366 Feb 11 04:30 host_config.log
-rwxrwxrwx  1 ubuntu ubuntu  106077 Jan  8  2013 ltib
-rwxrwxrwx  1 ubuntu ubuntu     952 Jan  8  2013 README
-rw-rw-r--  1 ubuntu ubuntu     227 Feb 11 04:45 RELEASE_INFO
drwxrwxr-x 17 ubuntu ubuntu    4096 Feb 11 04:42 rootfs
lrwxrwxrwx  1 ubuntu ubuntu      14 Feb 11 04:45 rootfs_image -> ./rootfs.jffs2
-rw-r--r--  1 ubuntu ubuntu 5242880 Feb 11 04:45 rootfs.jffs2        
drwxrwxr-x  7 ubuntu ubuntu    4096 Feb 11 04:32 rpm
drwxrwxr-x  2 ubuntu ubuntu    4096 Feb 11 04:45 tmp
drwxrwxr-x  2 ubuntu ubuntu    4096 Feb  4 04:38 ubuntu-ltib-patch
  • JFFS2 image of rootfs

With that we have completed building our first BSP with LTIB