Fixing MSP430 JTAG.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 15 May 2010 06:08:04 +0000 (06:08 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 15 May 2010 06:08:04 +0000 (06:08 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@503 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/Makefile
firmware/apps/glitch/glitch.c
firmware/goodfet.c
firmware/lib/command.c

index 9fbf41c..59ef648 100644 (file)
@@ -27,7 +27,8 @@ moreapps?=apps/i2c/i2c.o apps/chipcon/chipcon.o apps/glitch/glitch.o apps/jtag/s
 # should include apps/jtag/jtagarm7tdmi.o to build jtag for ARM7
 # should include apps/pic/dspic33f.o to build support for PIC24H/dsPIC33F
 
-apps= $(moreapps) apps/monitor/monitor.o apps/spi/spi.o   apps/jtag/jtag.o apps/jtag/jtag430.o apps/jtag/jtag430x2.o apps/avr/avr.o apps/jtag/ejtag.o apps/jtag/jtagxscale.o
+# Used to include  $(moreapps)
+apps=  apps/monitor/monitor.o apps/spi/spi.o   apps/jtag/jtag.o apps/jtag/jtag430.o apps/jtag/jtag430x2.o apps/avr/avr.o apps/jtag/ejtag.o apps/jtag/jtagxscale.o
 
 #apps/chipcon/chipconasm.o removed
 libs= lib/$(mcu).o lib/command.o apps/jtag/jtag430asm.o  lib/dco_calib.o
@@ -50,7 +51,7 @@ run:
 
 install: $(app).hex
        #$(BSL) -e
-       #ls info.txt && $(BSL) -p info.txt || true  #MSP430F2xx targets only, inelegant.
+       ls info.txt && $(BSL) -p info.txt || true  #MSP430F2xx targets only, inelegant.
        $(BSL) -e -p $(app).hex 
 verify:
        $(BSL) -P $(app).hex -v $(app).hex
index 8b43594..c2446d5 100644 (file)
@@ -73,7 +73,7 @@ void glitchapp(u8 app){
 
 //! Set glitching voltages.
 void glitchvoltages(u16 gnd, u16 vcc){
-  int i;
+  
   //debugstr("Set glitching voltages: GND and VCC");
   //debughex(gnd);
   //debughex(vcc);
@@ -85,6 +85,7 @@ void glitchvoltages(u16 gnd, u16 vcc){
   */
   
   #ifdef DAC12IR
+  int i;
   ADC12CTL0 = REF2_5V + REFON;                  // Internal 2.5V ref on
   // Delay here for reference to settle.
   for(i=0;i!=0xFFFF;i++) asm("nop");
index 97b40c2..acfb7e3 100644 (file)
 
 //! Initialize registers and all that jazz.
 void init(){
+  #ifdef DAC12IR
   int i;
+  #endif
+  
   WDTCTL = WDTPW + WDTHOLD;                 // Stop watchdog timer
   
   //LED out and on.
@@ -93,7 +96,9 @@ void handle(unsigned char app,
     ejtaghandle(app,verb,len);
     break;
   case JTAG430: //Also JTAG430X, JTAG430X2
-    jtag430x2handle(app,verb,len);
+    //Revert this when X2 support returns.
+    //jtag430x2handle(app,verb,len);
+    jtag430handle(app,verb,len);
     break;
   case SMARTCARD:
     smartcardhandle(app,verb,len);
index 5e4287f..8f9501a 100644 (file)
@@ -115,7 +115,7 @@ void txword(unsigned int l){
 
 //! Delay for a count.
 void delay(unsigned int count){
-  volatile unsigned int i=count*2;
+  volatile unsigned int i=count;
   while(i--) asm("nop");
 }
 //! MSDelay