Embeded Handheld R&D

Handheld developer platform

This is an old (2003-2005) project where I tried to get to get a cheep R&D platform with a display and JTAG going. Nowdays you can buy these of the shelfs but back then they where quite expensive. There was some trouble getting JTAG working but in the end I manage to get JTAG probing to work but not GDB but it was probably quite near. I also manage to get OSE (Realtime OS from Enea) to startup on the board.

Project goal

Why buy a expensive ARM developer platforms with old and slow ARM chips when you can get an IPAQ for the same price or less.


    • Small formfactor with color screen.
    • Nor flashes for it's easier to handle.
    • Uart device for initial conectivety.
    • JTAG port for debuging is preferable.


    • Gentoo Linux hosted.
    • GCC,binutils, I want to play with them.
    • GDB since I can't afford Lauterbach :)

1. Cross tool's

To be able to generate code for the ARM in the IPAQ we need a compiler, assembler and a linker that produce ARM code. Since you probably want run this on a ARM processor you have to build a set of cross tools. e.g binutils and gcc for ARM. Since some standard C function's would make life much easier, one set of those have to be build also. For c runtime functions there seams to be two avalible for GCC, libc and newlib, newlib is more targeting embeded devices so this will be my choise.

1.1 Downloding tools

Since Im an employer of Enea I have started to use our own gcc 3.4.2 arm cross tool build (Delivered with OSE 5.1). It worked out of the box on my gentoo system. I have also found the Code Sourcery company, it is very active in delivering patches to the arm gcc branch and have made arm gcc more compatible with RVCT ABI, I think this will be avalible in Gcc 4.0 or 4.1, but until then you can use there patched version of gcc see more at codesourcery.com.

1.2 Hardcore people build it themself's

I did go down the route to buld the a cross toolchain myself in the end of 2003 this is my findings:

Making a cross toolchain is not so hard as one migth think, basicly its just a matter of:

# BASE=/home/zingo/projects/handheld/crosstools # TOOLCHAIN=$BASE/toolchain # TARGET=arm-ose-elf # DEST=$TOOLCHAIN/usr/local/$TARGET # cd binutils-2.14 # ./configure --target=$TARGET --prefix=$DEST # make # make install # cd ..

For every package, binutils,gcc,newlib and gdb.

This was the versions I used:

BINUTILSDISTO=binutils-2.14 GCCDISTO=gcc-3.3.1 LINUXDISTO=linux-2.4.19 GLIBCDISTO=glibc-2.3.2 GLIBCTHREADSDISTO=glibc-linuxthreads-2.3.2 NEWLIBDISTO=newlib-1.11.0 GDBDISTO=insight+dejagnu-

But there is some problem, gcc needs a alredy build c-runtime lib to make a full build, but you need gcc to build the c-runtime. The solutions is to compile GCC two times, first time only make the compiler, then make the c-runtime, and recompile the compiler again. This can be done with something like this:

# cd GCC-dir # ./configure --target=$TARGET --prefix=$PREFIX --enable-languages=c --with-local-prefix=${PREFIX}/${TARGET} --without-headers --with-newlib --disable-shared # make # make install # cd .. # mkdir build-newlib; cd build-newlib # ..//configure --target=$TARGET --prefix=$PREFIX # make all install # cd .. # cd # configure --target=$TARGET --prefix=$PREFIX --with-headers= were the headers got installed ~/projects/handheld/crosstools/arm-elf/arm-elf/include --enable-languages=c,c++ --with-local-prefix=${PREFIX}/${TARGET} # make all install # cd ..

But to make everything much easier there is a shell script called build-crossgcc.sh that can be downloaded from http://crossgcc.billgatliff.com or http://kegel.com/crosstool/ and edited to make everything true. I did this and added support for Gdb or insight: build-crossgcc.sh Building this version's gave me some strange problem:

In file included from ../../../../../gcc-3.3.1/libstdc++-v3/ libsupc++/eh_alloc.cc:33: /home/zingo/projects/handheld/crosstools/buildcross/build-gcc/ arm-elf/thumb/libstdc++-v3/include/cstdlib:86: error: ` div_t' not declared

This was solved by removing a header file:

# cd build_gcc # mv gcc/include/stdlib.h gcc/include/_stdlib.h

and rerunning the script.

Mission 1 completed

2. Hardware

After som digging around on the net mostly on handhelds.org I discovered that most new IPAQ have Nand flashes, but 5xxx series of IPAQ still has NOR, I alos discovered that during this project startup time (around 2003-10-28) the linux distro for IPAQ were mostly working on older models and on 5xxx, the other models avalible at this time (19xx and 2xxx) had very little linux support. This means that an IPAQ from the 5xxx series will be ordererd for the project. I also found some hardware manuals on the net for the chips in 5xxx.

2.1 JTAG

I found a drawing on the net on a JTAG interface at jtag-arm9. This interface seems to be hardware compatible with the wiggler from http://www.ocdemon.com/ that has gdb support on Windows. Since I have a WinXP box besides me I can run the remote connection on my WinXP box to debug.

While waiting for the IPAQ to arive I build the JTAG pod. I have to see later if I can use GDB with it. If not it should be able to handle the flashes.

Gert Menke did some detective work and manage to get the JTAG pinouts from the IPAQ 5xxx series, this is the connector between the ipaq motherboard and the "button" board.

    • pin 1-4 - Vcc
    • pin 41 - TDI
    • pin 42 - TCK
    • pin 43 - TMS
    • pin 44 - TDO
    • pin 47-50 - Ground

Please se his site for more info http://evilg.home.t-link.de/jtag-howto/ or http://alk.h10.ru/jtag-howto.

For reference I will add the nice stuff here ripped from his site:

---------------- Stolen from Gert's page --------------

Since it is quite difficult (at least for me) to solder the wires directly to the connector pins, I traced three of the four JTAG-signals to corresponding test points on the main board. The fourth one can be found at one edge of an SMD resistor, as you can see in the picture below. (Click on the image to get a bigger version.)

---------------- end of webpage stealing from Gert's page --------------

To make a big success story in my life short I tryed this with an old and wrong pinout in the end of 2003 that was totaly wrong, I didn't get it to work... Some pictures Later in April 2005 I tried Gert's pins, and it worked directly, openwince jtag software version 0.5.1 detects the pxa250.

This is how it ended up in my ipaq:

I alos added two cables to bring out an external reset button and added a button outside, this makes it possible to reset the ipaq while it's still in the cradle. Great for debugging.

2.2 Debuging

JTAGER - Only Arm 7 and 9, but with som debuging capabilities, I Can't get a proper idcode for my PXA250 out of this yet.

I tried openwince jtag version 0.5.1 ant it detect my PXA250

I just (2005-04-29) found this project on the web:


I have not tested it yet but it will same me some time... This was the aim om my next project... Can't wait to see if it will work.