Table of Contents

Build System

PTXdist

Toolchain

BSP Rev. 0101 and newer

BSP Rev. 0100 and older

Preparing the development host

Please note:
The following was tested on Ubuntu 12.04. All newer distributions should work.

To install PTXdist you need Linux on your development workstation (or a virtual machine running Linux). The build system needs some additional packages which may be normally not installed by default. These packages are (names should match for Debian based systems):

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-<version>.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:

Note: you can install more than one PTXdist version in parallel. Then the best way ist to setup an symbolic link to the version needed in your BSP.

Toolchain installation

See download page for links to toolchain download. If using precompiled toolchain install to /opt. Otherwise carefully follow the documentation for building toolchains found here or in the download section.
By default the toolchain will get installed to /opt/OSELAS.Toolchain-<version>.

Follow chapter “Building a toolchain” in the PTXdist manual and keep in mind:

The Toolchain normally is already setup in the BSP project. So you can move on to the next step.

BSP installation

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

$ cd /opt/projekte
$ tar -xvf OSELAS.BSP-TQ-TQMA6x.<version>.tgz
$ cd OSELAS.BSP-TQ-TQMA6x

Using the build system

Getting help

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

Compilation

To start compilation you have to select

The BSP contains reasonable configurations to enable quick start. Enter the following commands to select the configuration:

$ ptxdist platform configs/platform-tq-mba6x/platformconfig
$ ptxdist select configs/ptxconfig

Start building the images:

$ ptxdist go
$ ptxdist images

PTXdist downloads package source to your configured loacal source pool if needed. This pool can be shared by several workstations to minimize download times. If it reports some errors, please

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.

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 to the source code. Follow the instructions of the developers section in the PTXdist manual.

Changes that are made in the build directories 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 guarantee reproducible builds. 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-MBa6x/images.

Complete system images:

The complete system images are intended for

Bootloader images:
Not to be confused with the u-boot*.bin images, these are just intermediate images and will not be booted by the i.MX6.

Linux images:

Rootfs images:

Partition scheme

Changing the partition scheme may affect the boot loader update capability and / or the kernel command line parameters!

SD / eMMC images

Sector Size Usage
0x0000 … 0x0000 0x0001 sector / 512 Byte MBR / Partition Table
0x0001 … 0x0001 0x0001 sector / 512 Byte reserved for ROM loader *)
0x0002 … 0x07ff 0x07fe sectors u-boot
0x0800 … 0x0fff 0x0800 sectors / 1MiB environment
0x1000 … 0x17ff 0x0800 sectors / 1MiB device tree blob

*) See CPU reference Manual. This sector can be used for Redundant Boot Support

Partition Size Usage
1 4 MiB Kernel image
2 256 MiB root FS
3 256 MiB Spare, not formatted
4 —- —-

The partition scheme is defined using the config file config/platform-tq-mba6x/config/uboot-hd.config. The creation of the image is controlled using the PTXdist packages image-uboot-tqma6<q|s>-hd.

To create the image the genimage host tool is used. This tool is automatically selected and built. You can find the build directory under <BSPROOT>/platform-MBa6x/build-host/genimage. There is also a README file documenting how to use this tool.

SPI NOR

Sector Size Usage
0x0000 … 0x0007 0x0008 sectors / 512 KiB U-Boot *)
0x0008 … 0x0008 0x0001 sector / 64 KiB environment0
0x0009 … 0x0009 0x0001 sector / 64 KiB environment1
0x000a … 0x000a 0x0001 sectors / 64 KiB devicetree
0x000b … 0x000f 0x0005 sectors / 320 KiB devicetree
0x0010 … 0x0070 0x0060 sectors / 6 MiB Kernel

*) See CPU reference Manual. The U-Boot image must be placed at offset 0x400

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-mba6x 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. Keep in mind that custom mainboards may need changes in bootloader and device tree. Give the new bootloader config and device tree a new name to cleanly distinguish them from the starterkit mainboard configuration.

If creating BSP for a new motherboard, make sure to create new configurations for bootloaders and device tree.