Table of Contents

Build System

PTXdist 2012.07

1. Preparing the development host

Please note:
The following was tested on Ubuntu 10.04 / 12.04. Older versions are not working.

To install PTXdist you need a Linux OS like Ubuntu. The BSP needs some additional packages which are normally not installed. These packages are:

For development it is recommended to have an tftp server for image download and update and an nfs server for network mounted rootfs configured and running.

Build system installation

After installing all packages download PTXdist source, configure, compile and install. See download page for links.

Extract the package ptxdist-2012.07.0.tar.bz2 to a temporary directory and call:

$ ./configure
$ make
$ sudo make install

This will install PTXdist to /usr/local. Afterwards please configure PTXdist with:

$ ptxdist setup 

You have to setup the following things:

Toolchain installation

See download page for links to toolchain download. If using precompiled toolchain install to /opt. Otherwise following the documentation for building toolchains.

Normally the toolchain is alredy configured in the BSP. So nothing further to setup.

BSP installation

Extract the package OSELAS.BSP-TQ-TQMA53.<version>.tgz to any directory (e.g. /opt or /home):

$ cd /opt/projekte
$ tar -xvf OSELAS.BSP-TQ-TQMA53.0101.tgz
$ cd OSELAS.BSP-TQ-TQMA53

Using the build system

Getting help

The manual is your friend. See Downloads where to get it.

Configuration

To configure the system (e.g. add additional packages) you can start the PTXdist menu:

$ ptxdist menu

To add additional packages to your root filesystem simply use the ptxdist tool. The ncurses based UI is the same that is used by the linux kernel with “make menuconfig”. It can be used the following way:

Dependencies between packages should be “automagically” resolved. Software is organized in sections.

Compilation

Select the platform MBa53 and start building the images:

$ ptxdist platform configs/platform-tq-mba53/platformconfig
$ ptxdist go
$ ptxdist images

PTXdist downloads some packages. If it reports some errors please

Changing packages

PTXdist uses release tar balls for software it loads from the net. You have to work with patches, if you need to make changes of the source code. Follow the instructions of the developers section in the PTXdist manual.

Changes that are made in the build directories only will be deleted, when PTXdist needs to redo a buildstep.

Adding own packages

PTXdist needs a package for every bit you need in your root FS. To add your software, files etc. you have to provide local packages. Follow the instructions of the developers section in the PTXdist manual. PTXdist provides templates as starting point for own packages. Type

$ ptxdist newpackage

to see what package templates exist.

Deployment

Finally, you will find the built images in platform-MBa53/images.

The SD-card and eMMC images are complete system images intended for

The barebox bootloader supports update of

To update bootloader / kernel / root FS in a running system you have to copy the images in your tftp directory and rename them to the names that the bootloader environment expects.

To see the names needed type

$ cat /env/config  

at the bootloader prompt.

You can use the update scripts from the barebox environment for update:

To update parts of the barebox environment or the device tree during development you can use also the barebox tftp command.

Adapting BSP for an own product

The BSP was developed for the starterkit. To use it in a product with special needs or a different basebord we suggest to define an own platform. To start with it make a copy of the platform definition and select the new platform definition

$ cd <BSPROOT>
$ cp -r <BSPROOT>/configs/platform-tq-mba53 to <BSPROOT>/configs/<your-cool-platform>
$ ptxdist platform <BSPROOT>/configs/<your-cool-platform>/platformconfig

To start configuring your new platform type

$ ptxdist platformconfig

The first thing to change should be the platform name. Adapt things like kernel configuration, image creation etc. to your needs.

The new system will be built under <BSPROOT>/platform-<platformname_from_platformconfig>

Please read the build system documentation howto go further.

Using different boot media

NFS

To boot the MBa53 from network you need a working bootloader in SD-card or eMMC which is able to get the kernel image over tftp and to provide the kernel with commandline settigns for NFS. Depending on the bootloader location the board has to be configured to load the bootloader. See SD-card and eMMC. You have to provide the images via tftp and nfs and to configure the bootloader to work with your tftp-server and your nfs-server

The following example is given for the barebox loader used in the BSP:

barebox@TQ tqma53: edit /env/config

The following settings have to be configured in the script:

# or set your networking parameters here
eth0.ipaddr=<tqma53 IP> 
eth0.netmask=<tqma53 netmask>
eth0.serverip=<nfs / tftp server ip>
#eth0.gateway=a.b.c.d
#eth0.ethaddr=de:ad:be:ef:00:00
 
ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask::eth0:off

Save environment and reset to make it active:

barebox@TQ tqma53: reset

Verify environment settings:

barebox@TQ tqma53: printenv

Verify eth0 configuration:

barebox@TQ tqma53: devinfo eth0

eMMC

To initialize the eMMC with an newly created image follow the instructions below:

root@tqm:~ mount /dev/mmcblk0p4 /mnt
root@tqm:~ cd /mnt
root@tqm:/mnt dd if=hd_emmc.img of=/dev/mmcblk1 bs=1M conv=fsync
root@tqm:/mnt poweroff

You can also establish an workflow using the Freescale Manufacturing tool.

To boot the MBa53 from an initialized eMMC you have to set the switches S1, S2 and S3.

Switch S1 settings
DIP OFF ON
S2 1 X
S2 2 X
Switch S2 settings
DIP OFF ON
S2 1 X
S2 2 X
S2 3 X
S2 4 X
S2 5 X
S2 6 X
S2 7 X
S2 8 X
Switch S3 settings
DIP OFF ON
S3 1 X
S3 2 X
S3 3 X
S3 4 X
S3 5 X
S3 6 X
S3 7 X
S3 8 X

Power up the MBa53. The login is root without any password. If you connect a DVI monitor to X5 you can see the login prompt.

SD-Card

Copy the hd.img to an SD-card to boot the module via SD-card.

$ dd if=platform-MBa53/images/hd.img of=/dev/sd<n> bs=1M conv=fsync

You have to use the raw device of the SD card not a partition!

To boot the MBa53 from a previously generated SD Card you have to set the switches S1, S2 and S3.

Switch S1 settings
DIP OFF ON
S2 1 X
S2 2 X
Switch S2 settings
DIP OFF ON
S2 1 X
S2 2 X
S2 3 X
S2 4 X
S2 5 X
S2 6 X
S2 7 X
S2 8 X
Switch S3 settings
DIP OFF ON
S3 1 X
S3 2 X
S3 3 X
S3 4 X
S3 5 X
S3 6 X
S3 7 X
S3 8 X

Insert the SDcard in X6 and power up the MBa53. The login is root without any password. If you connect a DVI monitor to X5 you can see the login prompt.