summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d9b3b0d)
self.data=[app&0xff, verb&0xFF]+data;
self.writecmd(self.GLITCHAPP,0x81,len(self.data),self.data);
#return ord(self.data[0]);
self.data=[app&0xff, verb&0xFF]+data;
self.writecmd(self.GLITCHAPP,0x81,len(self.data),self.data);
#return ord(self.data[0]);
+ def glitchstart(self):
+ """Glitch into the AVR application."""
+ self.glitchVerb(self.APP,0x20,None);
+ def glitchstarttime(self):
+ """Measure the timer of the START verb."""
+ return self.glitchTime(self.APP,0x20,None);
def glitchTime(self,app,verb,data):
"""Time the execution of a verb."""
if data==None: data=[];
def glitchTime(self,app,verb,data):
"""Time the execution of a verb."""
if data==None: data=[];
class GoodFETAVR(GoodFET):
AVRAPP=0x32;
class GoodFETAVR(GoodFET):
AVRAPP=0x32;
AVRVendors={0x1E: "Atmel",
0x00: "Locked",
};
AVRVendors={0x1E: "Atmel",
0x00: "Locked",
};
def start(self):
"""Start the connection."""
self.writecmd(self.AVRAPP,0x20,0,None);
def start(self):
"""Start the connection."""
self.writecmd(self.AVRAPP,0x20,0,None);
- def glitchstart(self):
- """Glitch into the AVR application."""
- self.glitchVerb(self.AVRAPP,0x20,None);
- def glitchstarttime(self):
- """Measure the timer of the START verb."""
- return self.glitchTime(self.AVRAPP,0x20,None);
def forcestart(self):
"""Forcibly start a connection."""
def forcestart(self):
"""Forcibly start a connection."""
class GoodFETCC(GoodFET):
"""A GoodFET variant for use with Chipcon 8051 Zigbeema SoC."""
class GoodFETCC(GoodFET):
"""A GoodFET variant for use with Chipcon 8051 Zigbeema SoC."""
def CChaltcpu(self):
"""Halt the CPU."""
self.writecmd(0x30,0x86,0,self.data);
def CChaltcpu(self):
"""Halt the CPU."""
self.writecmd(0x30,0x86,0,self.data);
def CClockchip(self):
"""Set the flash lock bit in info mem."""
self.writecmd(0x30, 0x9A, 0, None);
def CClockchip(self):
"""Set the flash lock bit in info mem."""
self.writecmd(0x30, 0x9A, 0, None);
+ def lock(self):
+ """Set the flash lock bit in info mem."""
+ self.CClockchip();
CCversions={0x0100:"CC1110",
CCversions={0x0100:"CC1110",
def CCchiperase(self):
"""Erase all of the target's memory."""
self.writecmd(0x30,0x80,0,None);
def CCchiperase(self):
"""Erase all of the target's memory."""
self.writecmd(0x30,0x80,0,None);
+ def erase(self):
+ """Erase all of the target's memory."""
+ self.CCchiperase();
+
def CCstatus(self):
"""Check the status."""
self.writecmd(0x30,0x84,0,None);
def CCstatus(self):
"""Check the status."""
self.writecmd(0x30,0x84,0,None);
"""Start debugging."""
self.writecmd(0x30,0x20,0,self.data);
ident=self.CCidentstr();
"""Start debugging."""
self.writecmd(0x30,0x20,0,self.data);
ident=self.CCidentstr();
- print "Target identifies as %s." % ident;
+ #print "Target identifies as %s." % ident;
#print "Status: %s." % self.CCstatusstr();
self.CCreleasecpu();
self.CChaltcpu();
#print "Status: %s." % self.CCstatusstr();
self.CCreleasecpu();
self.CChaltcpu();
P5OUT|=MOSI+SCK+RST;
P5DIR|=MOSI+SCK+RST;
//P5DIR&=~MISO; //MOSI is MISO
P5OUT|=MOSI+SCK+RST;
P5DIR|=MOSI+SCK+RST;
//P5DIR&=~MISO; //MOSI is MISO
}
//! Initialize the debugger
void ccdebuginit(){
}
//! Initialize the debugger
void ccdebuginit(){
+ delay(30); //So the beginning is ready for glitching.
+
//Two positive debug clock pulses while !RST is low.
//Take RST low, pulse twice, then high.
P5OUT&=~SCK;
//Two positive debug clock pulses while !RST is low.
//Take RST low, pulse twice, then high.
P5OUT&=~SCK;
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
TACTL = TASSEL1 + TACLR; // SMCLK, clear TAR
CCTL0 = CCIE; // CCR0 interrupt enabled
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
TACTL = TASSEL1 + TACLR; // SMCLK, clear TAR
CCTL0 = CCIE; // CCR0 interrupt enabled
- CCR0 = glitchcount+0x30; //clock divider
+ CCR0 = glitchcount+0x15; //clock divider
TACTL |= MC_3;
_EINT(); // Enable interrupts
#endif
TACTL |= MC_3;
_EINT(); // Enable interrupts
#endif
// Timer A0 interrupt service routine
interrupt(TIMERA0_VECTOR) Timer_A (void)
{
// Timer A0 interrupt service routine
interrupt(TIMERA0_VECTOR) Timer_A (void)
{
+ //P5DIR=BIT7; //All else high impedance.
P5OUT|=BIT7;//Normal
TACTL |= MC0;// Stop Timer_A;
P5OUT|=BIT7;//Normal
TACTL |= MC0;// Stop Timer_A;