MSP430 JTAG fix. Looks like a minor bug in Huseby's code, and it might fix the proble...
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Wed, 13 Apr 2011 22:25:22 +0000 (22:25 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Wed, 13 Apr 2011 22:25:22 +0000 (22:25 +0000)
A flash test still needs to be run, and an MSP430 board should be sent his way.
--Travis

git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@986 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/apps/jtag/jtag.c

index bf6f8f8..f072c49 100644 (file)
@@ -519,6 +519,10 @@ uint16_t jtag_trans_16(uint16_t in)
 //! Shift 8 bits of the IR.
 uint8_t jtag_ir_shift_8(uint8_t in)
 {
+  /* Huseby's code, which breaks MSP430 support.
+     The code is broken because either the invalid jtag state error
+     causes the client to give up, or because it adds an extra clock edge.
+     
        if (!in_run_test_idle())
        {
                debugstr("Not in run-test-idle state");
@@ -528,9 +532,24 @@ uint8_t jtag_ir_shift_8(uint8_t in)
        // get intot the right state
        jtag_capture_ir();
        jtag_shift_register();
-
-       // shift IR bits
-       return jtag_trans_8(in);
+  */
+  
+  
+  
+  // idle
+  SETTMS;
+  jtag_tcktock();
+  // select DR
+  jtag_tcktock();
+  // select IR
+  CLRTMS;
+  jtag_tcktock();
+  // capture IR
+  jtag_tcktock();
+  //jtag_state = CAPTURE_IR;
+  jtag_state = SHIFT_IR;
+  // shift IR bits
+  return jtag_trans_8(in);
 }
 
 //! Shift 16 bits of the DR.