Skip to content

dwelch67/armmite_samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a collection of low level example programs for the LCP2103
on the Coridium ARMmite Pro.  The ARMmite Pro is an Arduino form factor
board that is ARM based instead of AVR based.  It comes preloaded with
tools that make it easy to use without understanding what lies beneath.
These examples are all about what lies beneath.

You will want/need the schematic:
http://www.coridiumcorp.com/files/Schematics/ARMproSCH.pdf

You will also need the users manual
Start here:
http://www.nxp.com/pip/LPC2101_02_03.html
Click on the Download all documentation link.
Unzip the zip file and look for UM10161.pdf.

You are expected to have some C programming experience, this is not
a how to program C tutorial.  Programming assembly language for ARM or
thumb is useful but not required, by the second or third blinker example
a framework is established so that you dont need to write assembler,
just use the files provided.

It is not difficult to create an assembler and linker, a C compiler
a little more difficult, esp if you need/want gcc or C libraries.

These days the best gcc based tools for ARM are from CodeSourcery
http://www.codesourcery.com

At the moment the product is called CodeBench, you want the Lite
Edition for ARM.  Download the current EABI version.  C compiler,
Assembler, and linker are all included.  If you want a pay-for
version with support, by all means, go for it.  Other toolchains
are available, the examples in this repository are limited to
gcc and llvm (see below).

Another compiler which is gaining and possibly passing gcc by is the
LLVM project.  http://llvm.org.
There are pre-built binaries available or you can build it yourself
it is much simpler than the gnu tools and unless you specify not to
you get a compiler for all the targets at the same time in one shot.
With gcc you have to start over and rebuild a separate toolchain for
each specific target and target options.

if on Ubuntu
sudo apt-get install llvm clang

llvm will compile for any of the supported targets, but not necessarily
link, so this repository uses gnu binutils to assemble and link the
code produced by LLVM.

If you get and install CodeSourcery lite for example you wont need
to separately build binutils for arm.  If you only want to use
assembly language or only LLMV and not gcc, then you may want to build
your own binutils.

Get the current binutils sources
http://ftp.gnu.org/gnu/binutils/
As of this writing binutils-2.21.1a is the current

untar the sources somewhere

./configure --target=arm-none-eabi --prefix=/path/to/somewhere/
make
make install
add /path/to/somewhere/bin to your PATH.  Or perhaps dont use the
--prefix configure option



Loading and running programs:

The proglpc directory contains a program that can be used to load
your programs into the device.  Lpc/nxp and some other chip vendors
have a nice feature where a small bootloader is in the part and
depending on the state of an input pin or two you can load your program
using the serial port.  Each vendor does this their own way but what
it provides is a way to program the part without having to use additiona
tools like JTAG programmers, etc.  And you can do this with as little
as two pins (JTAG normally takes 5 or so).

The bootloader itself is in a separate flash from the flash that you
will use for your program.  So you dont have to worry about messing up
the bootloader and bricking the chip.  There is probably a way to
erase and reprogram that bootloader, proglpc is not capable of erasing
that memory.

At the moment proglpc requires a loadC jumper.  This could be as
simple as a paperclip opened up and folded over so that you can
temporarily short the two loadC holes together.  Proglpc takes care of
resetting the part.  So if your program is named program.bin and the
serial port that the ARMmite pro is connected through is /dev/ttyUSB0
then:

proglpc /dev/ttyUSB0 program.bin

The very first time you program you may need to erase the program
shipped on the board, putting anything as a fourth item on the command
line will erase the whole (user) flash before programming the individual
flash blocks for your program.

proglpc /dev/ttyUSB0 program.bin x

Since proglpc is already connected to the serial port of the device
and your program may want to use the uart for debugging, etc (we will
get into some samples) proglpc stays connected and prints out whatever
comes in from the serial port of the device.  Ctrl-C if you are not
interested or done with proglpc.

So at the moment the procedure is:

1) short the loadC pins
2) proglpc /dev/ttyUSB0 program.bin
3) remove the short between loadC pins
4) press the reset button on the board.

About

Example low level programs for the Coridium Armmite pro.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published