CVS: python makefile,1.2,1.3 msp430-jtag.py,1.12,1.13

Chris Liechti <[email protected]>
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.cvs
Message-ID <[email protected]>
Update of /cvsroot/mspgcc/python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4838/python

Modified Files:
	makefile msp430-jtag.py 
Log Message:
- some improvements
- make executables from the ti text tools
- install ti tools on un*x

Index: makefile
===================================================================
RCS file: /cvsroot/mspgcc/python/makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- makefile	1 Mar 2004 02:36:37 -0000	1.2
+++ makefile	27 Dec 2005 14:58:27 -0000	1.3
@@ -10,6 +10,9 @@
 	mkdir -p $(PREFIX)
 	install msp430-bsl.py $(PREFIX)/msp430-bsl
 	install msp430-jtag.py $(PREFIX)/msp430-jtag
+	install msp430-ram-usage.py $(PREFIX)/msp430-ram-usage
+	install titext2ihex.py $(PREFIX)/titext2ihex
+	install ihex2titext.py $(PREFIX)/ihex2titext
 
 
 #generate test files

Index: msp430-jtag.py
===================================================================
RCS file: /cvsroot/mspgcc/python/msp430-jtag.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -d -r1.12 -r1.13
--- msp430-jtag.py	27 Dec 2005 01:12:11 -0000	1.12
+++ msp430-jtag.py	27 Dec 2005 14:58:27 -0000	1.13
@@ -16,7 +16,7 @@
 from msp430 import memory, jtag
 
 
-VERSION = "2.0"
+VERSION = "2.1"
 
 DEBUG = 0                           #disable debug messages by default
 
@@ -39,9 +39,9 @@
 General options:
   -h, --help            Show this help screen.
   -l, --lpt=name        Specify an other parallel port.
-                        (defaults to LPT1 (/dev/parport0 on unix)
+                        (defaults to LPT1 (/dev/parport0 on unix))
   -D, --debug           Increase level of debug messages. This won't be
-                        very useful for the average user...
+                        very useful for the average user.
   -I, --intelhex        Force fileformat to IntelHex
   -T, --titext          Force fileformat to be TI-Text
   -R, --ramsize         Specify the amount of RAM to be used to program
@@ -281,12 +281,15 @@
                 regnum = int(a[1:])
                 results.append(('R%-2d = 0x%%04x' % regnum, jtagobj.getCPURegister, (regnum,)))
             else:
+                try:
                 if '-' in a:
                     start, end = a.split('-', 2)
                     start = int(start, 0)
                     end = int(end, 0)
                 else:
                     start = end = int(a,0)
+                except ValueError:
+                    raise ValueError("--result: Addresses or address ranges must be dec, hex or octal")
                 results.append(('0x%04x: %%r' % start, jtagobj.uploadData, (start, end-start)))
         elif o in ("--timeout", ):
             timeout = float(a)
@@ -320,6 +323,10 @@
         sys.stderr.write("Warning: option --reset ignored as --upload is specified!\n")
         reset = 0
 
+    if startaddr and wait:
+        sys.stderr.write("Warning: option --wait ignored as --upload is specified!\n")
+        wait = 0
+
     #prepare data to download
     jtagobj.data = memory.Memory()                      #prepare downloaded data
     if filetype is not None:                            #if the filetype is given...
@@ -365,6 +372,7 @@
     sys.stderr.flush()
 
     jtagobj.connect(lpt)                                #try to open port
+    abort_due_to_error = 1
     try:
         if ramsize is not None:
             jtagobj.setRamsize(ramsize)
@@ -405,6 +413,7 @@
                 makeihex( (startaddr, data) )           #ouput a intel-hex file
             else:
                 if sys.platform == "win32":
+                    #ensure that the console is in binary mode
                     import os, msvcrt
                     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
                 
@@ -416,10 +425,15 @@
             sys.stderr.flush()
             raw_input()                                 #wait for newline
     
+        abort_due_to_error = 0
     finally:
+        if abort_due_to_error:
+            sys.stderr.write("Cleaning up after error...\n")
         jtagobj.reset(1, 1)                             #reset and release target
         if do_close:
             jtagobj.close()                             #Release communication port
+            if DEBUG:
+                sys.stderr.write("WARNING: JTAG port is left open (--no-close)\n")
 
 if __name__ == '__main__':
     try:



-------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.