PTXdist 2012.07

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:

  • gawk
  • dialog
  • ncurses-dev
  • bison
  • flex
  • quilt
  • texinfo
  • gettext
  • g++
  • libxml-parser-perl

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.

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:

  • ftp / http proxies
  • username and mail address
  • path for archive of downloaded source packages (aka local package pool)
  • and some more features …

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.

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

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

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:

  • use the up / down arrow keys to navigate in the menu
  • use the left / right arrow keys to navigate between buttons
  • select / deselect packages and options using the SPACE key
  • enter submenus or press buttons using the ENTER key

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

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

  • verify your internet connection or proxy settings.
  • make sure the package source is correct. Some packege source pages will change from time to time. (You can always try to download the source package manually and copy it to your package pool)
  • some packages like bootloaders and kernels where you can select versions need to know about there hash sums. You have to enter the correct hash in the PTXdist configuration.

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.

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.

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

  • hd.img is a bootable image for usage with an SD card
  • hd_emmc.img is a bootable image for usage with the eMMC an TQMa53.
  • barebox-image: bootloader for SD
  • barebox_emmc-image: bootloader for eMMC
  • linuximage: Kernel (zImage)
  • Root file system images

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

  • development system initialisation
  • deployment

The barebox bootloader supports update of

  • bootloader
  • kernel
  • devicetree
  • root FS

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:

  • update_kernel
  • update_barebox
  • update_rootfs

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

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.

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

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

  • Use SD-card boot
  • on your development host add an additional ext3 partition to the SD card
  • copy the hd_emmc.img file to this partition
  • insert the SD card in MBa53 and boot
  • copy the image to the eMMC using the following commands:
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
  • remove SD card
  • configure for eMMC boot (see table)

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.

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.

Disclaimer
TQ-Systems GmbH provides the Board Support Packages (BSP) free of charge. The software included in the shipment has been configured individually for the starter kits. The software is only intended to evaluate the module. The use of the Board Support Packages (BSP) is only allowed within the scope of functionality described by TQ-Systems GmbH. TQ-Systems GmbH does not accept any liability for all further changes of the Board Support Package and for any damage resulting from its use.