Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Tree [c6f72c] bzr/jtag / funclets /
History



File Date Author Commit
.cvsignore 2005-12-23 cliechti <> [ce05cf] *** empty log message ***
README.txt 2005-12-27 cliechti <> [3f3e13] doc updates
blinking.S 2009-09-25 cliechti@users.sourceforge.net <> [888126] doc updates, fix make clean (missed files)
counter.S 2009-09-25 cliechti@users.sourceforge.net <> [888126] doc updates, fix make clean (missed files)
counterplus.S 2009-09-25 cliechti@users.sourceforge.net <> [888126] doc updates, fix make clean (missed files)
eraseFlash.S 2009-09-25 cliechti@users.sourceforge.net <> [888126] doc updates, fix make clean (missed files)
eraseFlashSegment.S 2009-09-25 cliechti@users.sourceforge.net <> [888126] doc updates, fix make clean (missed files)
ihex2c.py 2005-12-27 cliechti <> [3f3e13] doc updates
lockSegmentA.S 2009-09-25 cliechti@users.sourceforge.net <> [888126] doc updates, fix make clean (missed files)
makefile 2009-09-25 cliechti@users.sourceforge.net <> [888126] doc updates, fix make clean (missed files)
msp430xRAM.x 2009-09-25 cliechti@users.sourceforge.net <> [888126] doc updates, fix make clean (missed files)
progFlash.S 2009-09-25 cliechti@users.sourceforge.net <> [888126] doc updates, fix make clean (missed files)
ramsizeDetect.S 2009-09-25 cliechti@users.sourceforge.net <> [888126] doc updates, fix make clean (missed files)
regtest.S 2009-09-25 cliechti@users.sourceforge.net <> [888126] doc updates, fix make clean (missed files)

Read Me

Funclets
--------
A funclet is a small programm that is downloaded to the MSP430 RAM and
is executed there. They are used for erase and write operations in the
parallel port JTAG library MSP430mspgcc.dll/so.

A funclet must have a special memory layout. It cannot use any interrupts
and it has to setup everything itself. There is no stack init, no variable
init and no library.

Of course they need to be small, so that they fit in the RAM of smaller
devices (256B or even 128B).

As a further restriction every funclet must end with a "jmp $" instruction.
This is used by the download library to detect if the funclet is finished.
Only one such exit is allowed as the end address has to be given in the
table (see below).


Memory Layout
-------------
Funclets usualy start at 0x200, but that is optional.
All entries are words (unsigned short /.word)::

    download address
    start address of executable code
    end address, where the final "jmp $" is located.
    [...optional space for arguments...]
    [executable code of any size]
    jmp $
    [...optional space for data...]

Look at the files .S, it's may be easier to get the facts when looking at
actual sources.


Building
--------
To build funclets, a special linker script is needed to place code in the RAM.
The file msp430xRAM.x contains the needed changes. It's written for 2k RAM so
you won't get any errors when compiling for a smaller device.

The ``ihex2c.py`` script is used to convert intel hex to C source. The source
files are meant to be included and are therefore named ``*.ci``


Usage
-----
Look at the sources and at the makefile for more information on how to
build them.

They can be run with the -f or --funclet option of jtag.py
Example::

    msp430-jtag -f blinking.a43

To embed the funclets in the download libarary, the code must be translated
into a C array. This is done by converting a Intel-Hex with ``ihex2c.py``.


Funclets
--------
blinking.S
    Demo funclet, nothing useful. Plays with a LED array on P1OUT and P2OUT

counter.S
    A 32 bit counter. This is used to measure the DCO frequency when it is 
    run for a specified time, see the file itself for more details.

eraseFlash.S
    Code for MASS and MAIN erase. Used by MSP430mspgcc.dll/so.

eraseFlashSegment.S
    Segment erase code. Used by MSP430mspgcc.dll/so.

progFlash.S
    Programm a block (appended to the funclet) to flash. Used by
    MSP430mspgcc.dll/so.

ramsizeDetect.S
    Try to detect the available RAM by probing.

regtest.S
    Demo funclet. It sets all registers to a defined value, so that
    the register read function can be tested.


part of http://mspgcc.sf.net
chris <cliechti@gmx.net>