Table of Contents

Build System

The BSP is designed to be used with the PTXdist build system.

Installation

Preparing the development host

Please note:
The following was tested on Ubuntu 10.04 / 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 is 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-TQMa335x.<version>.tgz to any directory (e.g. /opt or /home):

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

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 TQMa335x and start building the images:

# select a rootfs-configuration (minimal for example):
ptxdist platform configs/platforms/tqma335x/mba335x/platformconfig 
ptxdist select configs/platforms/tqma335x/mba335x/ptxconfig
# we have to use git for the patching because of a binary-patch
ptxdist go --git
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-MBa335x/images.

Complete system images:

Bootloader images:

Linux images:

Rootfs images:

Updating the firmware


In this context, firmware refers to a complete system image (see above), including U-Boot, Linux Kernel and Root Filesystem.

For convenience, the default U-Boot environment provides several variables, which can be used to transfer (parts of) the firmware between different storage locations (e.g. SD card, eMMC, NFS, …). The names of these variables adhere to the syntax

upd_<PART>_<TARGET>_<SOURCE>

with the following options

<PART>   = firmware | uboot | kernel | rootfs
<TARGET> = emmc | sd | spi
<SOURCE> = emmc | sd | net

The size of the firmware is stored in mmcfirmwareblksize, please set accordingly if your firmware exceeds the default size of 0x32000.

For example, to copy the whole firmware from SD card to eMMC execute

U-Boot# run upd_firmware_emmc_sd

For further details, please have a look at the contents of the respective environment variable, e.g.

U-Boot# printenv upd_firmware_emmc_sd

upd_firmware_emmc_sd=mmc dev ${sddev} && mmc rescan && mmc read ${loadaddr} 0 ${mmcfirmwareblksize} && mmc dev ${emmcdev} && mmc rescan && mmc write ${loadaddr} 0 ${mmcfirmwareblksize}

Adapting BSP for an own product

todo

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.

Partition scheme

todo

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

The following partition scheme is used for SD / eMMC images

The partition scheme is defined using the config files under config/platforms/tqma335x/mba335x/config/images. The creation of the image is controlled using the project local PTXdist package image-sd.

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-MBa335x/build-host/genimage. There is also a README file documenting how to use this tool.