From: travisutk Date: Mon, 23 Nov 2009 07:44:08 +0000 (+0000) Subject: goodfet.msp430 run; not yet tested. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=ece5c9e0f1fa967a118de9e59ce4b2981aaf132f goodfet.msp430 run; not yet tested. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@235 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/client/GoodFETAVR.py b/client/GoodFETAVR.py index 52f82ba..df4acf4 100644 --- a/client/GoodFETAVR.py +++ b/client/GoodFETAVR.py @@ -25,6 +25,7 @@ class GoodFETAVR(GoodFET): 0x9007: "tiny13", 0x9108: "tiny25", 0x930B: "tiny85", + 0x9206: "tiny45", 0x9001: "S1200", diff --git a/client/GoodFETMSP430.py b/client/GoodFETMSP430.py index d5e5f8f..36a0e1b 100644 --- a/client/GoodFETMSP430.py +++ b/client/GoodFETMSP430.py @@ -128,11 +128,11 @@ class GoodFETMSP430(GoodFET): #MSP430F1xx 0xf16c: "MSP430F161x", - 0xf149: "MSP430F13x", #or f14x(1) - 0xf112: "MSP430F11x", #or f11x1 + 0xf149: "MSP430F13x", #or f14x(1) + 0xf112: "MSP430F11x", #or f11x1 0xf143: "MSP430F14x", - 0xf112: "MSP430F11x", #or F11x1A - 0xf123: "MSP430F1xx", #or F123x + 0xf112: "MSP430F11x", #or F11x1A + 0xf123: "MSP430F1xx", #or F123x 0x1132: "MSP430F1122", #or F1132 0x1232: "MSP430F1222", #or F1232 0xf169: "MSP430F16x", @@ -186,7 +186,12 @@ class GoodFETMSP430(GoodFET): def MSP430masserase(self): """Erase MSP430 flash memory.""" self.writecmd(self.MSP430APP,0xE3,0,None); - + def MSP430setPC(self, pc): + """Set the program counter.""" + self.writecmd(self.MSP430APP,0xC2,2,[pc&0xFF,(pc>>8)&0xFF]); + def MSP430run(self): + """Reset the MSP430 to run on its own.""" + self.writecmd(self.MSP430APP,0x21,0,None); def MSP430dumpbsl(self): self.MSP430dumpmem(0xC00,0xfff); def MSP430dumpallmem(self): diff --git a/client/goodfet.msp430 b/client/goodfet.msp430 index 9fcb68f..be13da6 100755 --- a/client/goodfet.msp430 +++ b/client/goodfet.msp430 @@ -15,6 +15,9 @@ if(len(sys.argv)==1): print "%s erase" % sys.argv[0]; print "%s flash $foo.hex [0x$start 0x$stop]" % sys.argv[0]; print "%s verify $foo.hex [0x$start 0x$stop]" % sys.argv[0]; + print "%s poke 0x$adr 0x$val" % sys.argv[0]; + print "%s peek 0x$start [0x$stop]" % sys.argv[0]; + print "%s run" % sys.argv[0]; sys.exit(); #Initialize FET and set baud rate @@ -151,10 +154,15 @@ if(sys.argv[1]=="poke"): print "Poked to %04x" % client.MSP430peek(start); +if(sys.argv[1]=="run"): + #Set PC to RESET vector's value. + #client.MSP430setPC(client.MSP430peek(0xfffe)); + #client.MSP430releasecpu(); + client.MSP430run(); if(sys.argv[1]=="whatever"): for i in [0x24FF, 0x2500, 0x2502, 0x2504]: print "%04x" % client.MSP430peek(i); -client.MSP430releasecpu(); -client.MSP430stop(); +#client.MSP430releasecpu(); +#client.MSP430stop();