Nothing Beats Free
One of the big draws to the
Raspberry Pi and BeagleBone Black is
their ability to run free open source
software and operating systems. The
BeagleBone and Pi are relatively
cheap, and it costs nothing but your
time to program them. The same
holds true on the PC side of the
compilation equation.
Linux is available as a free
download and so are the cross
compilation tools you will need to
feed you dog and bake a Pi. Both the
Pi and BeagleBone can utilize the
ARM versions of the GCC (GNU
Compiler Collection). The GNU
compilers, linkers, and assemblers
have the ability to fall under the
control of another free open source
development tool called Eclipse.
We can load the GNU
compilers, linkers, utilities, and
assemblers directly onto our Pi and
BeagleBone. However, the GNU
compilers and development tools are
better utilized when loaded as cross
compilation systems on a more
powerful PC. I have chosen to run
the Pi and BeagleBone GNU C and
C++ cross compilers on an old
ThinkPad T61 running Ubuntu 13.04.
It is relatively easy to load the
GNU C /C++ compilers on my Linux
laptop. One must simply open a
Ubuntu terminal window and issue
sudo apt-get install g++-arm-Linux-gnueabi. As you can see in
Screenshot 1, my Linux laptop is up
to date. Otherwise, the ARM GNU
cross compiler would be downloaded
and installed.
This particular ARM cross
If you've ever programmed a
PIC or AVR microcontroller,
you most likely built your
embedded application using
cross compilation
techniques. A cross compiler
environment running on your
PC is necessary in this case
because the PIC and AVR
embedded microcontrollers
do not have the memory and
CPU resources that are
necessary to handle a kernel-based operating system and
all of the supporting
firmware. You won't get
utilities, libraries, and
compilers to fit in those
small memory spaces either.
The BeagleBone Black and
Raspberry Pi are complete
embedded systems that
happen to have the capacity
to absorb kernels, libraries,
utilities, applications, and
compilers. Thus, it is possible
to build and deploy an
application using nothing but
a Pi or BeagleBone and the
Linux or Android operating
system the board is running.
The bottleneck is speed. My
Pi and BeagleBone can't
perform compilations as
quickly as my Lenovo
ThinkPad. So, it is
advantageous to do my
compiling on the ThinkPad
and download the resultant
binary to the target Pi or
Black microcontroller.
THE DESIGN CYCLE
Total Eclipse of the
Cross Compiler
Post comments on this article and find any associated files
and/or downloads at www.nutsvolts.com/index.php?/
magazine/article/april2014_DesignCycle.
; BY FRED EADY
; Screenshot 1. Linux is Linux is Linux. If you can get your BeagleBone Black
on the Internet, you can issue this same command and get the same results
that a PC running Linux would produce.
68 April 2014