projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Firmware now works with older Chipcon radios.
[goodfet]
/
client
/
goodfet.msp430
diff --git
a/client/goodfet.msp430
b/client/goodfet.msp430
index
3140e13
..
be13da6
100755
(executable)
--- a/
client/goodfet.msp430
+++ b/
client/goodfet.msp430
@@
-15,6
+15,9
@@
if(len(sys.argv)==1):
print "%s erase" % sys.argv[0];
print "%s flash $foo.hex [0x$start 0x$stop]" % sys.argv[0];
print "%s verify $foo.hex [0x$start 0x$stop]" % sys.argv[0];
print "%s erase" % sys.argv[0];
print "%s flash $foo.hex [0x$start 0x$stop]" % sys.argv[0];
print "%s verify $foo.hex [0x$start 0x$stop]" % sys.argv[0];
+ print "%s poke 0x$adr 0x$val" % sys.argv[0];
+ print "%s peek 0x$start [0x$stop]" % sys.argv[0];
+ print "%s run" % sys.argv[0];
sys.exit();
#Initialize FET and set baud rate
sys.exit();
#Initialize FET and set baud rate
@@
-39,6
+42,9
@@
if(sys.argv[1]=="info"):
client.MSP430ident());
if(sys.argv[1]=="test"):
client.MSP430test();
client.MSP430ident());
if(sys.argv[1]=="test"):
client.MSP430test();
+if(sys.argv[1]=="glitch"):
+ for foo in range(0,100):
+ print "Identifies as %04x" % client.MSP430ident();
if(sys.argv[1]=="dump"):
f = sys.argv[2];
start=0x0200;
if(sys.argv[1]=="dump"):
f = sys.argv[2];
start=0x0200;
@@
-53,7
+59,7
@@
if(sys.argv[1]=="dump"):
h = IntelHex(None);
i=start;
while i<=stop:
h = IntelHex(None);
i=start;
while i<=stop:
- data=client.MSP430peekblock(i
,0x20
);
+ data=client.MSP430peekblock(i);
print "Dumped %06x."%i;
for j in data:
if i<=stop: h[i]=ord(j);
print "Dumped %06x."%i;
for j in data:
if i<=stop: h[i]=ord(j);
@@
-74,15
+80,37
@@
if(sys.argv[1]=="flash"):
h = IntelHex16bit(f);
h = IntelHex16bit(f);
+ #Should this be default?
+ #Makes flashing multiple images inconvenient.
client.MSP430masserase();
client.MSP430masserase();
+
+ count=0; #Bytes in commit.
+ first=0;
+ vals=[];
+ last=0; #Last address committed.
for i in h._buf.keys():
for i in h._buf.keys():
- #print "%04x: %04x"%(i,h[i>>1]);
+ if((count>0x40 or last+2!=i) and count>0 and i&1==0):
+ #print "%i, %x, %x" % (len(vals), last, i);
+ client.MSP430pokeflashblock(first,vals);
+ count=0;
+ first=0;
+ last=0;
+ vals=[];
if(i>=start and i<stop and i&1==0):
if(i>=start and i<stop and i&1==0):
- client.MSP430pokeflash(i,h[i>>1]);
+ val=h[i>>1];
+ if(count==0):
+ first=i;
+ last=i;
+ count+=2;
+ #val2=client.MSP430pokeflash(i,val);
+ #if(val!=val2):
+ # print "Write error at %04x, %04x!=%04x." %(
+ # i, val, val2);
+ vals+=[val&0xff,(val&0xff00)>>8];
if(i%0x100==0):
print "%04x" % i;
if(i%0x100==0):
print "%04x" % i;
-if(sys.argv[1]=="flashtest"):
-
client.MSP430flashtest(
);
+ if count>0: #last commit, ivt
+
client.MSP430pokeflashblock(first,vals
);
if(sys.argv[1]=="verify"):
f=sys.argv[2];
start=0;
if(sys.argv[1]=="verify"):
f=sys.argv[2];
start=0;
@@
-126,10
+154,15
@@
if(sys.argv[1]=="poke"):
print "Poked to %04x" % client.MSP430peek(start);
print "Poked to %04x" % client.MSP430peek(start);
+if(sys.argv[1]=="run"):
+ #Set PC to RESET vector's value.
+ #client.MSP430setPC(client.MSP430peek(0xfffe));
+ #client.MSP430releasecpu();
+ client.MSP430run();
if(sys.argv[1]=="whatever"):
for i in [0x24FF, 0x2500, 0x2502, 0x2504]:
print "%04x" % client.MSP430peek(i);
if(sys.argv[1]=="whatever"):
for i in [0x24FF, 0x2500, 0x2502, 0x2504]:
print "%04x" % client.MSP430peek(i);
-client.MSP430releasecpu();
-client.MSP430stop();
+
#
client.MSP430releasecpu();
+
#
client.MSP430stop();