Forums

Newbie

Started by neer...@ptgrey.com May 26, 2010
Hi

I am new in the world of ARM, I have been researching the web to find a proper start up tutorial on ARM. For example if I have an ARM board how do I create the startup code and set up the environment to compile C code to a format that I can download via JTAG to the processor.

Thanks. Any help would be greatly appreciated.
On Wed, 26 May 2010 17:57:37 -0400
n...@ptgrey.com wrote:
> I am new in the world of ARM, I have been researching the web to find
> a proper start up tutorial on ARM. For example if I have an ARM
> board how do I create the startup code and set up the environment to
> compile C code to a format that I can download via JTAG to the
> processor.

It's been a while since I've been there, but...

If you're using Windows as your host platform, I think I used the
Yagarto tools. Download both packages, the cross compiler and the tools,
install them, make sure they're in your path.

Then unzip the Atmel "softpack" demo code for your board. This will
result in a directory named something like softpack-1.4-at91sam9261-ek.
Inside that is a "packages" directory. Inside that is a whole bunch
more zip files, of the form "lcd-slideshow-project-1.4-at91sam9216-ek"
and "lcd-slideshow-project-1.4-iar5-at91sam9216-ek". The "iar5" ones
are for the IAR compiler, you're using the Yagarto port of the GNU
compilers, so you want the ones without the "iar" in them.

Unzip that, cd into the resulting dir, then into
"lcd-slideshow-project" (or whatever the project name is for your
device), and run "make".

This will create a couple of different images in your "bin" directory.

Here's where it gets a little more device specific. You need to use
SAM-BA to get one of those images to your device. I actually don't
remember how to use the SAM-BA tool for this because it's slightly
different for each device, and once I figure it out I end up writing a
little TCL that I stuff into my Makefile and forget about it, because
SAM-BA is a TCL capable tool.

Basically, you'll need to set a jumper on your board to make sure
that when it boots it doesn't go somewhere that makes your memory
difficult to get to. Usually this jumper disables flash, you start the
board, and then enable flash. In some boards the jumper wipes the
flash, so you'll enable the jumper, start the board, power off the
board, disable the jumper, restart the board.

In SAM-BA you'll then enable the memory that you're going to load your
code into and program it. A sample script for the AT91SAM9XE-EK (first
TCL script I ran across) looks like:

FLASH::ScriptGPNMV 6
send_file {Flash} "bin/binary_name-flash.bin" 0x200000 0

And the command to invoke SAM-BA (with extra escapes 'cause this is
from my Makefile) with it looks like:

SAM-BA.exe \\jlink\\ARM0 AT91SAM9XE512-EK programboard.tcl

If you have the chance to do the intro day with Atmel on one of their
dev boards, I highly recommend it.

Dan