2 # GoodFET ARM9 Client Library
4 # Contributions and bug reports welcome.
7 # * full cycle debugging.. halt to resume
8 # * ensure correct PC handling
9 # * flash manipulation (probably need to get the specific chip for this one)
10 # * set security (chip-specific)
12 import sys, binascii, struct, time
13 import atlasutils.smartprint as asp
14 from GoodFET import GoodFET
16 from intelhex import IntelHex
40 # Really ARM specific stuff
48 class GoodFETARM9(GoodFETARM7.GoodFETARM7):
49 def ARM9readMem(self, adr, wordcount):
50 """ Only works in ARM mode currently
51 WARNING: Addresses must be word-aligned!
53 regs = self.ARMget_registers()
54 self.ARMset_registers([0xdeadbeef for x in xrange(14)], 0xe)
57 while (wordcount > 0):
58 count = (wordcount, 0xe)[wordcount>0xd]
59 bitmask = LDM_BITMASKS[count]
60 self.ARMset_register(14,adr)
61 self.ARMdebuginstr(ARM_INSTR_LDMIA_R14_r0_rx | bitmask ,0)
63 #FIXME: do we need the extra nop here?
66 output.extend([self.ARMget_register(x) for x in xrange(count)])
70 # FIXME: handle the rest of the wordcount here.
71 self.ARMset_registers(regs,0xe)