1.Â Setting up an environment using scratchbox 2 for developing applications for embedded targets.
This wiki will walk you through the process of setting up a cross compiling environment on a Linux machine (Ubuntu 12.04,x64) for developing linux applications for the Pandaboard ES. The same procedure should work on other linux platforms too.
NOTE:Â This wiki assumes you have the basic knowledge required to understand the overall process. This wiki will just help you with the process. In case you encounter terms/tools you are not familiar with, feel free to open a new tab, google it, understand it and comeback!
- A cross compiling toolchain for the pandaboard ES.
- Standard Libraries (libc,libstdc++ (for C/C++ development) ) compiled for the Pandaboard ES.
Obtaining a cross compiling toolchain:
The ubuntu repositories have a compiler for the ARM targets.You can install it by typing the following in a terminal:
sudo ap-get install gcc-arm-linux-gnueabihf
Note that it compiles for ARM cores with VFP units. > gnuabihf> indicates GNU embedded application binary interface hard float. This comes with GCC 4.7 . In case you want a recent version of GCC to have an improved auto vectorization support for utilizing the NEON co-processor for SIMD, you can download the pre-built toolchain binaries fromÂ LInaro’s website ( link to bz2 archive to be used on a linux machine).
sudo apt-get install scratchbox2
Prepare a BUILDROOT. Which is nothing but a copy of the root file system of the pandaboard ES on your host pc. You can either copy the rootfs from the SDcard that you use to boot pandaboard or you can create one using fakeroot. The former method is preferable as it’ll more closely resemble your pandaboard ES.
cd to the rootfs and Init sb2.
export pandarootfs=/path/to/rootfs/of/pandaboard</code> <code>cd $pandarootfs</code>Â <code>sb2-init panda <path to your cross compiler>
sb2-init pandaboardES arm-linux-gnueabi-gcc
provided the $PATH contains arm-linux-gnueabi-gcc.
Now sb2 is initialised and is all set to work for you.
sb2Â in the terminal. You should see something like :
[SB2 simple pandaboardES] user@pandaboardES arm $
You can anytime exit by entering
exitÂ in the terminal.
Now, let’s proceed…
in the terminal to start sb2 in emulator mode with the default configuration(pandaboardES).
Â sb2-show path /etc/apt
to check how /etc/atp is mapped.
To Install into emulated system:
apt-get install build-essential zlib1g-dev libncurses5-dev intltool libxml2-dev libtool
To cross compile some source
cd source sb2 ./configure sb2 make -jN sb2 make install DESTDIR=$pandarootfs