CVS: python/mspgcc jtag.py,1.9,1.10
Chris Liechti <[email protected]> Fri, 06 Oct 2006 06:31:40 -0700
| Newsgroups | gmane.comp.hardware.texas-instruments.msp430.gcc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mspgcc/python/mspgcc
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26668/python/mspgcc
Modified Files:
jtag.py
Log Message:
spy-bi-wire support
Index: jtag.py
===================================================================
RCS file: /cvsroot/mspgcc/python/mspgcc/jtag.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -d -r1.9 -r1.10
--- jtag.py 6 Oct 2006 11:39:41 -0000 1.9
+++ jtag.py 6 Oct 2006 13:31:37 -0000 1.10
@@ -32,7 +32,7 @@
LOCKED_FLASH_ACCESS = 5 #Allows Locked Info Mem Segment A access (if set to '1')
FLASH_SWOP = 6
EDT_TRACE_MODE = 7
-INTERFACE_MODE = 8
+INTERFACE_MODE = 8 # see INTERFACE_TYPE below
SET_MDB_BEFORE_RUN = 9
RAM_PRESERVE_MODE = 10 #Configure whether RAM content should be preserved/restored
@@ -46,6 +46,8 @@
VCC_RESET = 1 << 2 #Cycle Vcc (i.e., a "power on") reset.
ALL_RESETS = PUC_RESET + RST_RESET + VCC_RESET
+# interface type 'spy-bi-wire' or 'JTAG'
+interface = 'JTAG'
DEBUG = 0
@@ -276,6 +278,18 @@
raise IOError("Could not initialize the library (port: %s)" % port)
if DEBUG:
sys.stderr.write('backend library version: %d\n' % (version.value,))
+ if backend == CTYPES_TI:
+ if interface == 'spy-bi-wire':
+ status = MSP430_Configure(INTERFACE_MODE, SPYBIWIRE_IF)
+ if status != STATUS_OK:
+ raise IOError("Could not configure the library: %s" % MSP430_Error_String(MSP430_Error_Number()))
+ else:
+ status = MSP430_Configure(INTERFACE_MODE, JTAG_IF)
+ if status != STATUS_OK:
+ raise IOError("Could not configure the library: %s" % MSP430_Error_String(MSP430_Error_Number()))
+ else:
+ if interface != 'JTAG':
+ raise ValueError("interface != 'JTAG' is not supported with this backend")
def connect(self,):
"""Enable JTAG and connect to target. This stops it.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV