X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETARM.py;h=52f25606da5b0e926c30ef7de86ffa4bd7376ed8;hp=9991d55eef817e7dc87a6165971b5a5398313864;hb=436c63f2da19f4f9acdb0fe752d66192594cd318;hpb=8203dc42156b3745f4f79ba7da4845da365902ff diff --git a/client/GoodFETARM.py b/client/GoodFETARM.py index 9991d55..52f2560 100644 --- a/client/GoodFETARM.py +++ b/client/GoodFETARM.py @@ -7,6 +7,7 @@ # import sys, binascii, struct +import atlasutils.smartprint as asp #Global Commands READ = 0x00 @@ -73,7 +74,7 @@ class GoodFETARM(GoodFET): def ARMtest(self): self.ARMreleasecpu() self.ARMhaltcpu() - #print "Status: %s" % self.ARMstatusstr() + print "Status: %s" % self.ARMstatusstr() #Grab ident three times, should be equal. ident1=self.ARMident() @@ -83,9 +84,27 @@ class GoodFETARM(GoodFET): print "Error, repeated ident attempts unequal." print "%04x, %04x, %04x" % (ident1, ident2, ident3) + #Set and Check Registers + regs = [1024+x for x in range(1,15)] + regr = [] + for x in range(len(regs)): + self.ARMset_register(x, regs[x]) + + for x in range(len(regs)): + regr.append(self.ARMget_register(x)) + + for x in range(len(regs)): + if regs[x] != regr[x]: + print "Error, R%d fail: %x != %x"%(x,regs[x],regr[x]) + + return + + + + #Single step, printing PC. print "Tracing execution at startup." - for i in range(1,15): + for i in range(15): pc=self.ARMgetPC() byte=self.ARMpeekcodebyte(i) #print "PC=%04x, %02x" % (pc, byte) @@ -115,8 +134,6 @@ class GoodFETARM(GoodFET): self.writecmd(0x33,SETUP,0,self.data) def ARMget_dbgstate(self): """Read the config register of an ARM.""" - self.writecmd(0x33,GET_DEBUG_STATE,0,self.data) - print "DEBUGGING get_dbgstate: %s"%repr(self.data) retval = struct.unpack(">24, (val>>16)&0xff, (val>>8)&0xff, val&0xff]) - print "DEBUG:SET_REGISTER: %s"%repr(self.data) + self.writecmd(0x33,SET_REGISTER,8,[reg,0,0,0,val&0xff, (val>>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]) retval = struct.unpack(">24, (reg>>16)&0xff, (reg>>8)&0xff, reg&0xff]) - self.writecmd(0x33,GET_REGISTER,16*4,regarray) - print "DEBUG:SET_REGISTER: %s"%repr(self.data) + regarry.extend([reg&0xff, (reg>>8)&0xff, (reg>>16)&0xff, reg>>24]) + self.writecmd(0x33,SET_REGISTERS,16*4,regarry) retval = struct.unpack("