MicroKit
homepage http://www.voti.nl/mkt
on-line manual http://www.voti.nl/mkt/manual
Introduction
MicroKit (mkt) eases ARM application development.
It is neither a compiler nor an IDE, but rather the glue inbetween,
including some basic libraries.
It goal is to ease the development of bare-metal ARM applications by
shielding the user from non-essential details like the chip startup
code, memory layout and the tool (command line) interfaces.
MicroKit builds on the ARMDevEnv we use at the Hogeschool Utrecht,
which is itself a bundling of the Yagarto GNU ARM tools and the PSPad editor.
MicroKit can be used from the command line (my personal preference),
or from an IDE or editor (PSPad, DevCpp, UltraEdit, etc).
Installation
MicroKit should work on Windows XP and Vista machines. To use MicroKit:
- download and install the ARMDevEnv (to its default location: C:\Program Files\ARMDevEnv)
- download and install Python 2.6.2
(it will probably work with other Python versions, including 3.0)
- download and install the Python for windows extensions
(this is the version for Python 2.6.x, you must use a version that matches your Python version)
- download mkt.py and put it in the directory where your source file(s) are
(as yet there is no install for mkt.py, just copy it to every place where you use it)
- download lpc21isp.exe and put it somewhere in your PATH, C:\Program Files\ARMDevEnv\bin would be a good place
Example application
Using MircoKit is (supposed to be) simple: you specify the source file(s),
and MicroKit does the rest: it builds the application and starts the
tool that runs your application on the target system.
This requires that you tell MicroKit some details,
like which ARM chip you use, the frequency at which it runs, the
debug or download tool you use, etc.
These details can be specified by #configure lines in your
source file.
This simple MicropKit application toggles the GPIO 0.0 pin at 1 Hz:
|
#configure chip lpc2148
#configure xtal 12 * MHz
#configure memory ram
#configure run insight
#configure link wiggler
int main( void ){
mkt_pin_configure( 0, mkt_output );
while(1){
mkt_pin_set( 0 );
mkt_wait_us( 500 * 1000 );
mkt_pin_clear( 0, 1 );
mkt_wait_us( 500 * 1000 );
}
return 0;
}
|
Note that the application specifies that it is to be run in RAM,
to be downloaded (and probably debugged) using the Insight debugger,
and that a wiggler (parallel port to JTAG interface) is to be used
as communication link to the target system.
The functions mkt_pin_configure, mkt_pin_set, mkt_pin_clear and
mkt_wait_us are supplied by MicroKit.
There is no need to specify a #include file for these functions,
the source files are processed by MicroKit anyway (to interpret and remove
the #configure lines), so it adds its #include lines automatically.
Use
By default MicroKit will build and download the application.
The command line to do this is
mkt.py file
where file is your source file (or list of source files).
If you just want to build you can add -build, or if you just want
to run an already built application you can add -run.
You can use MicroKit from the PSPad editor that comes with the ARMDevEnv
by using an appropriate Makefile. The command
mkt.py -pspadfile
creates this makefile.
Using MicroKit with the Hogeschool Utrecht ARM boards
MicroKit knows about the ARM boards we use at the Hogeschool Utrecht, so
for those boards the #configuration lines can be simplified, and
functions are provided for instance to write to the LEDs. The
following program shows a kitt display on the LEDs:
|
#configure board hu_arm_v4
#configure memory ram
void show( int n ){
mkt_leds_write( 1 << n );
mkt_wait_us( 100 * 1000 );
}
int main( void ){
int i = 0;
for(;;){
for( i = 0; i < 8; i++ ) show( i );
for( i = 6; i > 0; i-- ) show( i );
}
return 0;
}
|
Note that the xtal, run and com are not configured.
The board has a 12 MHz crystal, so that value is used by default.
Likewise, the board has a build in USB-to-JTAG interface based on the FTDI2232 chip,
so that is used by default, with the Insight debugger.
Interface
A partial list of the C interface:
|
void mkt_wait_us( int us )
void mkt_pin_configure( int pin, in direction mkt_output )
void mkt_pin_direction( int pin, in direction mkt_output )
// direction: mkt_input, mkt_output
void mkt_pin_set( int pin )
void mkt_pin_clear( int pin )
void mkt_pin_write( int pin, int value )
int mkt_pin_read( int pin )
// replace mkt_pin_ with mkt_fixed_pin_ for a faster macro version
void mkt_leds_init( void )
void mkt_leds_write( int leds )
void mkt_clcd_init( void )
void mkt_clcd_char_write( char c )
// \v = clear/home, \n = newline, \r = carriage return
|
Limitations
This is a pre-pre-pre release.
Lots of things might not work as you (and I) would expect.
Known limitations and problems are:
- platforms: tested on Vista, should run on XP, w2k. Will not work on win64
- chips: limited to LPC2106, LPC2148
- chips: limited to LPC2106, LPC2148
- languages: limited to assembler and C (C++ not yet tested)
- boards: limited to hu_arm_v3, hu_arm_v4, MCB2130
- PLL setting not yet supported (cclk = xtal)
- malloc/free not supported (and not yet blocked!)
Feel free to contact me: wouter@voti.nl,
but don't be angry if I take some time to respond.
Blog
05-JUN-2008 :
The basic things seem to work OK with the HU ARM boards,
including ROM and RAM, parallel/serial port and USB, and
PsPAD integration.
06-MAY-2008 :
Some online documentation is available!
25-APR-2008 :
MicroKit is somewhat stable.
Writing to flash on the V4 boards does not work.
Created this page.