CVS: jtag/funclets README.txt,1.1,1.2 ihex2c.py,1.7,1.8
Chris Liechti <[email protected]>
| Newsgroups | gmane.comp.hardware.texas-instruments.msp430.gcc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mspgcc/jtag/funclets
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18865/jtag/funclets
Modified Files:
README.txt ihex2c.py
Log Message:
doc updates
Index: README.txt
===================================================================
RCS file: /cvsroot/mspgcc/jtag/funclets/README.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- README.txt 24 Sep 2002 02:03:02 -0000 1.1
+++ README.txt 27 Dec 2005 01:28:43 -0000 1.2
@@ -16,38 +16,73 @@
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):
+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
+ [...optional space for arguments...]
+ [executable code of any size]
jmp $
- ...optional space for data...
+ [...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:
- jtag.py -f blinking.a43
+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.
+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
Index: ihex2c.py
===================================================================
RCS file: /cvsroot/mspgcc/jtag/funclets/ihex2c.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -d -r1.7 -r1.8
--- ihex2c.py 23 Dec 2005 02:25:42 -0000 1.7
+++ ihex2c.py 27 Dec 2005 01:28:43 -0000 1.8
@@ -1,8 +1,8 @@
#!/usr/bin/env python2.1
"""
-Convert Intel HEX files to C code to embed
+Convert Intel HEX files to C code to embed.
-USAGE: ihex2c.py input.a43 outname.ci [const]
+USAGE: ihex2c.py input.a43 outname.ci ['const']
This generates a file named "outname.ci" which contains an array
named "unsigned short funclet_outname[]" (extension is stripped off).
@@ -18,7 +18,7 @@
(C) 2002 Chris Liechti <[email protected]>
This is distributed under a Python style license.
-Requires Python 2+
+Requires Python 2.1+
"""
import sys
@@ -64,7 +64,7 @@
return "Segment(startaddress = 0x%04x, data=%r)" % (self.startaddress, self.data)
class Memory:
- "represent memory contents. with functions to load files"
+ """represent memory contents. with functions to load files"""
def __init__(self, filename=None):
self.segments = []
if filename:
@@ -81,7 +81,7 @@
return len(self.segments)
def loadIHex(self, file):
- "load data from a (opened) file in Intel-HEX format"
+ """load data from a (opened) file in Intel-HEX format"""
segmentdata = []
currentAddr = 0
startAddr = 0
@@ -110,7 +110,7 @@
self.segments.append( Segment(startAddr, ''.join(segmentdata)) )
def loadTIText(self, file):
- "load data from a (opened) file in TI-Text format"
+ """load data from a (opened) file in TI-Text format"""
next = 1
currentAddr = 0
startAddr = 0
@@ -135,14 +135,14 @@
self.segments.append( Segment(startAddr, ''.join(segmentdata)) )
def loadFile(self, filename):
- "fill memory with the contents of a file. file type is determined from extension"
+ """fill memory with the contents of a file. file type is determined from extension"""
if filename[-4:].lower() == '.txt':
self.loadTIText(open(filename, "rb"))
else:
self.loadIHex(open(filename, "rb"))
def getMemrange(self, fromadr, toadr):
- "get a range of bytes from the memory. unavailable values are filled with 0xff."
+ """get a range of bytes from the memory. unavailable values are filled with 0xff."""
res = ''
toadr = toadr + 1 #python indxes are excluding end, so include it
while fromadr < toadr:
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click