From b27bfe788715f1d1127a1649ac5e3cbe91037af9 Mon Sep 17 00:00:00 2001 From: travisutk Date: Sat, 15 May 2010 06:08:04 +0000 Subject: [PATCH] Fixing MSP430 JTAG. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@503 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- firmware/Makefile | 5 +++-- firmware/apps/glitch/glitch.c | 3 ++- firmware/goodfet.c | 7 ++++++- firmware/lib/command.c | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/firmware/Makefile b/firmware/Makefile index 9fbf41c..59ef648 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -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 diff --git a/firmware/apps/glitch/glitch.c b/firmware/apps/glitch/glitch.c index 8b43594..c2446d5 100644 --- a/firmware/apps/glitch/glitch.c +++ b/firmware/apps/glitch/glitch.c @@ -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"); diff --git a/firmware/goodfet.c b/firmware/goodfet.c index 97b40c2..acfb7e3 100644 --- a/firmware/goodfet.c +++ b/firmware/goodfet.c @@ -15,7 +15,10 @@ //! 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); diff --git a/firmware/lib/command.c b/firmware/lib/command.c index 5e4287f..8f9501a 100644 --- a/firmware/lib/command.c +++ b/firmware/lib/command.c @@ -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 -- 2.20.1