X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFET.py;h=65fb46cce5a35170e660f25f95fb6ac7716b44ce;hp=4c6e3ed82afcbbbc2f1a5ea9b2770aa53cbfe12c;hb=5fb0341d348e101b30794945a6c91546e25e8e7b;hpb=b6f18d95c8f6effd98cad31e74de8a23a86fea29 diff --git a/client/GoodFET.py b/client/GoodFET.py index 4c6e3ed..65fb46c 100755 --- a/client/GoodFET.py +++ b/client/GoodFET.py @@ -382,7 +382,7 @@ class GoodFET: #TODO include memory in symbol. reg=self.symbols.get(name); return self.pokebyte(reg,val); - def pokebyte(self,address,value): + def pokebyte(self,address,value,memory="vn"): """Set a byte of memory by the monitor.""" self.data=[address&0xff,address>>8,value]; self.writecmd(0,0x03,3,self.data); @@ -478,6 +478,30 @@ class GoodFET: if self.verbose: print "Comm error recognized by monitorecho()."; return 0; return 1; + + def monitor_info(self): + print "GoodFET with %s MCU" % self.infostring(); + print "Clocked at %s" % self.monitorclocking(); + return 1; + + def monitor_list_apps(self, full=False): + self.monitor_info() + old_value = self.besilent + self.besilent = True # turn off automatic call to readcmd + self.writecmd(self.MONITORAPP, 0x82, 1, [int(full)]); + self.besilent = old_value + + # read the build date string + self.readcmd() + print "Build Date: %s" % self.data + print "Firmware apps:" + while True: + self.readcmd() + if self.count == 0: + break + print self.data + return 1; + def monitorclocking(self): """Return the 16-bit clocking value.""" return "0x%04x" % self.monitorgetclock(); @@ -544,6 +568,12 @@ class GoodFET: for foo in range(0,length): data[foo]=self.peek8(address+foo,memory); return data; + def pokeblock(self,address,bytes,memory="vn"): + """Poke a block of a data into memory at an address.""" + for foo in bytes: + self.pokebyte(address,foo,memory); + address=address+1; + return; def loadsymbols(self): """Load symbols from a file.""" return;