X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETMSP430.py;h=df6f20eabc8e99cb40cceddd412b57f6941a0d7e;hp=ac9ab74aeb10470f01416d87cb9641506207952e;hb=1ef22a7f7983e4bb7513686cd573776a8338c904;hpb=278a9487e60fdcf3e96236580f9542c218a8c1f1 diff --git a/client/GoodFETMSP430.py b/client/GoodFETMSP430.py index ac9ab74..df6f20e 100644 --- a/client/GoodFETMSP430.py +++ b/client/GoodFETMSP430.py @@ -10,8 +10,12 @@ import sys, time, string, cStringIO, struct, glob, serial, os; from GoodFET import GoodFET; class GoodFETMSP430(GoodFET): + #Set APP to be MSP430APP or MSP430X2APP, the latter being preferred. + + #0x16 for class, 0x17 for SBW, 0x11 by default APP=0x11; - MSP430APP=0x11; #Changed by inheritors. + MSP430APP=0x11; + CoreID=0; DeviceID=0; JTAGID=0; @@ -25,12 +29,12 @@ class GoodFETMSP430(GoodFET): self.writecmd(self.MSP430APP,0x21,0,self.data); def MSP430coreid(self): - """Get the Core ID.""" + """Get the Core ID. (MSP430X2 only?)""" self.writecmd(self.MSP430APP,0xF0); CoreID=ord(self.data[0])+(ord(self.data[1])<<8); return CoreID; def MSP430deviceid(self): - """Get the Device ID.""" + """Get the Device ID. (MSP430X2 only?)""" self.writecmd(self.MSP430APP,0xF1); DeviceID=( ord(self.data[0])+(ord(self.data[1])<<8)+ @@ -48,7 +52,7 @@ class GoodFETMSP430(GoodFET): (adr&0xff0000)>>16,(adr&0xff000000)>>24, ]; self.writecmd(self.MSP430APP,0x02,4,self.data); - + #print "Got %i bytes peeking 0x%04x." % (len(self.data),adr); return ord(self.data[0])+(ord(self.data[1])<<8); def MSP430peekblock(self,adr): """Grab a few block from an SPI Flash ROM. Block size is unknown""" @@ -197,7 +201,8 @@ class GoodFETMSP430(GoodFET): print "Tests complete, erasing." self.MSP430masserase(); - + def erase(self): + self.MSP430masserase(); def MSP430masserase(self): """Erase MSP430 flash memory.""" self.writecmd(self.MSP430APP,0xE3,0,None);