readChunk (may replace readMem) is implemented, moving memory into regs then reading...
[goodfet] / client / goodfet
1 #!/usr/bin/env python
2 # GoodFET Debugger
3
4 # (C) 2009 Travis Goodspeed <travis at radiantmachines.com>
5 #
6 # This code is being rewritten and refactored.  You've been warned!
7
8 import sys, os, code, binascii;
9 #import rlcompleter, readline;
10
11 from GoodFET import GoodFET, getClient;
12 from GoodFETConsole import GoodFETConsole;
13
14 from intelhex import IntelHex;
15
16 if(len(sys.argv)==1):
17     print "Usage: %s [driver|verb]\n" % sys.argv[0];
18     print "driver:= monitor | cc | avr | spi | msp430 | nrf";
19     print "verb:=   scan";
20     print "";
21     print "This is an unfinished client.  You probably want goodfet.$chip instead.";
22     sys.exit(1);
23
24 verb=sys.argv[1];
25 if verb=="scan":
26     from scanwin32 import *;
27     # INIT COMPORT SCAN
28     scan=winScan();
29     #scan.comports();
30     
31     for order, port, desc, hwid in sorted(scan.comports()):
32         # Look for FTDIBUS
33         try:
34             #hwid.index('FTDI')
35             #print "*************"
36             #print "GOODFET FOUND"
37             #print "*************"
38             if hwid.index('FTDI')!=0: continue;
39             print "%s: (%s)" % (port, hwid),
40             try:
41                 serial.Serial(port)
42             except serial.serialutil.SerialException:
43                 print "Busy"
44             else:
45                 print "Ready"
46         except:
47             pass
48     sys.exit(0);
49
50 driver=sys.argv[1];
51 print "Using driver %s" % driver;
52 #client=eval("%s()" % driver);
53 client=getClient(driver);
54 console=client.getConsole();
55 console.run();
56
57 sys.exit(0);