STOP command for exiting JTAG430 debugger.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Mon, 23 Nov 2009 07:33:53 +0000 (07:33 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Mon, 23 Nov 2009 07:33:53 +0000 (07:33 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@233 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/apps/jtag/jtag430.c

index 50fc70d..3a2fe68 100644 (file)
@@ -257,6 +257,32 @@ void jtag430_start(){
   jtag430_haltcpu();
 }
 
+//! Start normally, not JTAG.
+void jtag430_stop(){
+  jtagsetup();
+  
+  //Known-good starting position.
+  //Might be unnecessary.
+  SETTST;
+  SETRST;
+  delay(0xFFFF);
+  
+  //Entry sequence from Page 67 of SLAU265A for 4-wire MSP430 JTAG
+  CLRRST;
+  delay(0xFFFF);
+  /*
+  delay(100); //100
+  CLRTST;
+  delay(50);  //50
+  SETTST;
+  delay(50);  //50
+  */
+  SETRST;
+  //P5DIR&=~RST;
+  //delay(0xFFFF);
+  
+}
+
 //! Set CPU to Instruction Fetch
 void jtag430_setinstrfetch(){
   
@@ -301,6 +327,11 @@ void jtag430handle(unsigned char app,
     //TAP setup, fuse check
     jtag430_resettap();
     
+    txdata(app,verb,0);
+    break;
+  case STOP:
+    debugstr("Resetting target.");
+    jtag430_stop();
     txdata(app,verb,0);
     break;
   case JTAG430_HALTCPU: