ARM9 Hammer with XBeeSummary

  • Enable 2nd serial port and recompile the kernel
  • Enable serial console on 2nd serial port by modifying root FS
  • Upload and re-flash kernel and root FS on Hammer module
  • Attach XBee module

NOTE: Enabling serial port portion of the following instructions applies only to 2.6.22 Linux kernel version that comes with Hammer board CD.

You will need to follow these instructions from Tincantools to enable 2nd serial (UART2) port on Hammer module. Once done, re-compile , upload and flash your new kernel. The following link will help you with how to do that. Once this is accomplished, let's move on to enabling getty console on UART2. IMHO, this seems to be the easiest way to test serial port functionality. And this is how we do it:

  • gunzip root.tar.gz;
  • mount root.tar into temp dir of your choice ( mkdir temp; mount -o loop root.tar ./temp );
  • 'cd' into mount directory ( cd ./temp )
  • edit etc/inittab: add 'ttySAC2::respawn:/sbin/getty -L ttySAC2 115200 vt100';
    • This is how your final serial port configuration block of etc/inittab will look like.

      # Put a getty on the serial port
      ttySAC0::respawn:/sbin/getty -L ttySAC0 115200 vt100
      ttySAC2::respawn:/sbin/getty -L ttySAC2 115200 vt100

    • To enable 2nd serial in your build root system, you will need to change target/device/Samsung/Hammer/target_skeleto/etc/inittab

  • cd ..
  • unmount modified rootfs ( umount ./temp );
  • gzip it back into root.tar.gz ( gzip root.tar );
  • upload modified rootfs onto Hammer and flash it;
  • if flash was successful, type boot at apex prompt;Validating Hammer 2nd serial with FT232RL breakout

Once system boots up, login as root and type 'ps -A' look for '/sbin/getty -L ttySAC2 115200 vt100'. If found, it means your changes are successful and getty is waiting for connection on UART2.

I've used FT232RL breakout board to validate that 2nd serial is functioning properly. Make sure that you are using 3.3V USB-to-serial adapters. Hammer module pins ARE NOT 5V tolerant.

Ok, at this point we are almost done. Now we just have to wire-up XBee module to Hammer module. One thing to consider though is Xbee current consumption. Regular version of XBee uses about 50mA ( XBee PRO version uses 245mA ). I've setup my Xbee module (regular version) to be powered from Hammer on-board voltage regulator. Though according to the note from Tincantools, this might not be a good idea since board's voltage regulator is already being overstressed but it seems to work well in my case. However, I will consider using off-board power supply for peripheral elements that draw more then 50 mAh. 

Let's move on to wiring up XBee module. Connect following pins on Hammer and XBee modules:

Hammer  Xbee
 TXD2  DIN
 RXD2  DOUT
 +3.3V-OUT  VCC
 GND  GND

And this is pretty much it. Power up your hammer board and start testing inter-XBee communication. :-)

Hammer and XBee setup; Xbee powered from external power supply

Aternative XBee power setup

Here is alternative wiring setup - using external breadboard power supply to power XBee module.You will need to make sure that there is a common ground between Hammer module and external power supply.

Buildroot NOTE

I'm running Gentoo distro on my laptop. An issue that I ran into is that some of my packages under buildroot were failing to compile because make couldn't find i386-pc-linux-gcc on my system. Rightfully so, I have i686-pc-linux-gcc instead. To circumvent this, I've edited line 159 of packages/Makefile.in to say "-e 's/i[3-5,7-9]86/i386/' " instead of "-e 's/i[3-9]86/i386/' ". In plain English, this change allows the build script to skip i686 system types and not to map HOST_ARCH variable to i386.

Here is how final HOST_ARCH block looks like:

HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//'
-e 's/sparc.*/sparc/'
-e 's/arm.*/arm/g'
-e 's/m68k.*/m68k/'
-e 's/ppc/powerpc/g'
-e 's/v850.*/v850/g'
-e 's/sh[234]/sh/'
-e 's/mips-.*/mips/'
-e 's/mipsel-.*/mipsel/'
-e 's/cris.*/cris/'
-e 's/i[3-5,7-9]86/i386/'
)

This is definitely my computer specific issue but I figured it won't hurt to share it since someone might be trying to address it too.

FAKEROOT note

Current version of fakeroot TGZ as of Dec 13, 2008 is 1.11.3. The patch that has to be applied against it a little out of sync. Here is updated content of package/fakeroot/fakeroot-doc.patch file

--- fakeroot/Makefile.am.orig 2006-04-19 11:50:35.000000000 -0600
+++ fakeroot/Makefile.am 2006-04-19 11:50:59.000000000 -0600
@@ -1,5 +1,5 @@
AUTOMAKE_OPTIONS=foreign
CLOCAL_AMFLAGS = -I build-aux
-SUBDIRS=scripts doc test
+SUBDIRS=scripts test

noinst_LTLIBRARIES = libcommunicate.la
libcommunicate_la_SOURCES = communicate.c
--- fakeroot/Makefile.in.orig 2006-04-19 11:50:43.000000000 -0600
+++ fakeroot/Makefile.in 2006-04-19 11:51:21.000000000 -0600
@@ -242,7 +242,7 @@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I build-aux
-SUBDIRS = scripts doc test
+SUBDIRS = scripts test
noinst_LTLIBRARIES = libcommunicate.la
libcommunicate_la_SOURCES = communicate.c
lib_LTLIBRARIES = libfakeroot.la

 

XBee wiring XBee wiring
Hammer and XBee wiring Hammer ARM9 and XBee wiring