Code Development for the GESBC-9G20 single board computer

Hardware Documentation

Glomation GESBC-9G20:

Atmel AT91SAM9G20 manual:

Various recipes for software tool preparation


New (2013.10.04) instructions (by example) for arm cross compiling from SLF6 (ie uboonedaq-evb)
The example is xcompiling the linux kernel.
Basically "setup gcc v4_3_2 -qarm" and then use, for example, arm-unknown-linux-gnueabi-gcc.
(please pardon the 3 line prompt (date,dir,host) used in the following example)
Start with:

uboonedaq-evb :^) ls
total 76500
-rw-rw-rw- 1 ron    47526 Aug 29 16:08 config-3.2.43-2013.
-rw-rw-rw- 1 ron 78202792 Aug 29 14:40 linux-3.2.43.tar.bz2
uboonedaq-evb :^) 

Then init the environment with the following commands (which should have no output):
. /uboone/setup
setup gcc v4_3_2 -qarm
tar xjf linux-3.2.43.tar.bz2
cd linux-3.2.43
mkdir $PWD-$target
cp ../config-3.2.43-2013. $PWD-$target/.config
{ test -z "${target-}" && echo set target variable && return
  make ARCH=`expr "$target" : '\([^-]*\)'` CROSS_COMPILE=$target- O=$PWD-$target "$@" 

The xcompiler should be... and the kernel build should be...:

uboonedaq-evb :^) type arm-unknown-linux-gnueabi-gcc
arm-unknown-linux-gnueabi-gcc is /uboone/gcc/4.8.1/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc
uboonedaq-evb :^) # the xcompiler tools have the "target" architecture (arm-unknown-linux-gnueabi) prepended
uboonedaq-evb :^) xmake -j30 uImage
  GEN     /home/ron/src/linux/linux-3.2.43-arm-unknown-linux-gnueabi/Makefile
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
[snip many lines of kernel compile output]
  AS      arch/arm/boot/compressed/piggy.gzip.o
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE  arch/arm/boot/uImage
Image Name:   Linux-3.2.43
Created:      Fri Oct  4 14:37:52 2013
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    1930184 Bytes = 1884.95 kB = 1.84 MB
Load Address: 20008000
Entry Point:  20008000
  Image arch/arm/boot/uImage is ready
uboonedaq-evb :^) 

NOTE: Instructions below are obsolete. (The recommended cross-compiler is targeted to the older kernel that used to come on Glomation 9G20s, and won't work with either the new one that ships nor the one we are now going to install on all of them.)

For compiling code to run on the 9G20, use the ARM cross development tool chain recommended on the Glomation support page. More specifically, download Generic-arm_gcc-4.2.3-glibc-2.3.3.tar.bz2 and unpack. Add the path to the "bin" directory of the unpacked archive to your path. The C compiler is arm-unknown-linux-gnu-gcc.


NOTE: In principle the following would work if adjusted to use an up-to-date cross-compiler, but this has not been tried yet.

To make a cross-debugger for the board, the best thing to do is to make gdbserver for the 9G20 (Arm architecture) and gdb for another "host" computer with "ARM" as the target architecture. Of course the "host" gdb still has to be compiled for the host architecture on which it runs. Here's a recipe that worked for me on an x86_64-based Scientific Linux 5.3 system:

 tar xjf gdb-7.5.tar.bz2
 cd gdb-7.5
 ./configure --target=arm-unknown-linux-gnu
 cd gdb/gdbserver
 rm config.cache
 CC=arm-unknown-linux-gnu-gcc ./configure --host=arm-unknown-linux-gnu

In my case I also had to add a definition for PTRACE_GETSIGINFO to gdbserver/linux-arm-low.c and had to compile gdbserver/remote-utils.c without the "-Wall" option due to a picky compiler warning.

Once you have successfully compiled as above, copy the gdbserver program (which you just made in the gdb-7.5/gdb/gdbserver directory) over to the SBC, and use it along with the gdb program (which you just made in gdb-7.5/gdb) as described in the gdbserver documentation.

This really helps debugging.

Compiling an EPICS IOC for the 9G20

Use the instructions at, except change the path names and version numbers accordingly.

  • Use EPICS base 3.14.12 (not 3.14.10).
  • Instead of /opt/EPICS/base-3.14.10, use (where ever EPICS is installed)/base-3.14.12.
  • Instead of /usr/local/arm-linux-gnu, use wherever you installed your GCC cross-compiler.

Additionally, you should add the following to ${EPICS_BASE}/configure/os/CONFIG_SITE.Common.linux-arm:


Adding the line above to the CONFIG_SITE.Common.linux-arm file will do two things: (1) add debugging symbols to the Arm executable, allowing the use of GDB, and (2) specifies a lower level of optimization. The second point may be important: I find softIoc crashes at init unless I do this.

Here for reference is a script I source to set up my environment before building EPICS IOCs for the 9G20 at K-State. This would need to be modified for the correct installation locations for EPICS and the GCC cross-compiler on a different computer. Note simply using the script below is not sufficient: you have to also modify the three EPICS config files as described on the page referenced above.

echo This is the configure for EPICS for the Arm-based 9G20
# see


# EPICS_HOST_ARCH is where the compile is happening (not where EPICS will run)


export EPICS
export PATH