Executable property on scripts.
[goodfet] / firmware / apps / jtag / jtag430.c
index d0b83cb..1275def 100644 (file)
@@ -276,12 +276,24 @@ void jtag430_setinstrfetch(){
 void jtag430handle(unsigned char app,
                   unsigned char verb,
                   unsigned long len){
-  register char blocks;
   unsigned long at;
   unsigned int i, val;
   
   //debugstr("Classic MSP430 handler.");
   
+  
+  /* FIXME
+   * Sometimes JTAG doesn't init correctly.
+   * This restarts the connection if the masked-rom
+   * chip ID cannot be read.  Should print warning
+   * for testing server.
+   */
+  while((i=jtag430_readmem(0xff0))==0xFFFF){
+    jtag430_start();
+    P1OUT^=1;
+  }
+  P1OUT&=~1;
+    
   switch(verb){
   case START:
     //Enter JTAG mode.