X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETARM.py;h=4d25bd75efa9ec52c21b43180b43a574b3056eda;hp=52f25606da5b0e926c30ef7de86ffa4bd7376ed8;hb=93a6832c63b2373b8662de997c9b954f8aeffe76;hpb=e296256a848905e63a7d881dd5dcea9ce323adca diff --git a/client/GoodFETARM.py b/client/GoodFETARM.py index 52f2560..4d25bd7 100644 --- a/client/GoodFETARM.py +++ b/client/GoodFETARM.py @@ -65,15 +65,15 @@ class GoodFETARM(GoodFET): """A GoodFET variant for use with ARM7TDMI microprocessor.""" def ARMhaltcpu(self): """Halt the CPU.""" - self.writecmd(0x33,HALTCPU,0,self.data) + self.writecmd(0x13,HALTCPU,0,self.data) def ARMreleasecpu(self): """Resume the CPU.""" - self.writecmd(0x33,RESUMECPU,0,self.data) + self.writecmd(0x13,RESUMECPU,0,self.data) def ARMsetModeArm(self): - self.writecmd(0x33,SET_MODE_ARM,0,self.data) + self.writecmd(0x13,SET_MODE_ARM,0,self.data) def ARMtest(self): - self.ARMreleasecpu() - self.ARMhaltcpu() + #self.ARMreleasecpu() + #self.ARMhaltcpu() print "Status: %s" % self.ARMstatusstr() #Grab ident three times, should be equal. @@ -85,7 +85,7 @@ class GoodFETARM(GoodFET): print "%04x, %04x, %04x" % (ident1, ident2, ident3) #Set and Check Registers - regs = [1024+x for x in range(1,15)] + regs = [1024+x for x in range(0,15)] regr = [] for x in range(len(regs)): self.ARMset_register(x, regs[x]) @@ -131,22 +131,23 @@ class GoodFETARM(GoodFET): def setup(self): """Move the FET into the JTAG ARM application.""" #print "Initializing ARM." - self.writecmd(0x33,SETUP,0,self.data) + self.writecmd(0x13,SETUP,0,self.data) def ARMget_dbgstate(self): """Read the config register of an ARM.""" + self.writecmd(0x13,GET_DEBUG_STATE,0,self.data) retval = struct.unpack(">8)&0xff, (val>>16)&0xff, val>>24]) - #self.writecmd(0x33,SET_REGISTER,8,[reg,0,0,0, (val>>16)&0xff, val>>24, val&0xff, (val>>8)&0xff]) + self.writecmd(0x13,SET_REGISTER,8,[reg,0,0,0,val&0xff, (val>>8)&0xff, (val>>16)&0xff, val>>24]) + #self.writecmd(0x13,SET_REGISTER,8,[reg,0,0,0, (val>>16)&0xff, val>>24, val&0xff, (val>>8)&0xff]) retval = struct.unpack(">8)&0xff, (reg>>16)&0xff, reg>>24]) - self.writecmd(0x33,SET_REGISTERS,16*4,regarry) + self.writecmd(0x13,SET_REGISTERS,16*4,regarry) retval = struct.unpack(">8] - self.writecmd(0x33,PEEK,2,self.data) + self.writecmd(0x13,PEEK,2,self.data) retval = struct.unpack(">8] - self.writecmd(0x33, PEEK, 2, self.data) + self.writecmd(0x13, PEEK, 2, self.data) retval = struct.unpack(">8, val] - self.writecmd(0x33, POKE, 3, self.data) + self.writecmd(0x13, POKE, 3, self.data) retval = struct.unpack(">16)&0xFF, (adr>>24)&0xFF] print "Flashing buffer to 0x%06x" % adr - self.writecmd(0x33,MASS_FLASH_PAGE,4,data) + self.writecmd(0x13,MASS_FLASH_PAGE,4,data) def writecmd(self, app, verb, count=0, data=[]): """Write a command and some data to the GoodFET."""