2 # GoodFET Client Library
5 # Good luck with alpha / beta code.
6 # Contributions and bug reports welcome.
8 # NOTE: this is just a hacked up copy of the GoodFETARM.py file
10 import sys, binascii, struct
28 from GoodFET import GoodFET
29 from intelhex import IntelHex
31 class GoodFETXSCALE(GoodFET):
33 """A GoodFET variant for use with XScale processors."""
39 """Move the FET into the JTAG ARM application."""
40 print "Initializing XScale..."
41 self.writecmd(self.APP, SETUP, 0, self.data)
44 """Start debugging."""
45 print "Staring debug..."
46 self.writecmd(self.APP, START, 0, self.data)
50 print "Stopping debug..."
51 self.writecmd(self.APP, STOP, 0, self.data)
54 """Get the Chip ID."""
56 # send the get chip ID command
57 self.writecmd(self.APP, GET_CHIP_ID, 0, [])
60 ident = struct.unpack("<L", "".join(self.data[0:4]))[0]
63 part_number = (ident >> 12) & 0x10
64 manufacturer = ident & 0xFFF
66 print "XScale ID --\n\tmfg: %x\n\tpart: %x\n\tver: %x\n\t(%x)" % (version, part_number, manufacturer, ident)