Bringing back MSP430X2 JTAG. Not there yet.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 3 Feb 2011 21:44:18 +0000 (21:44 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 3 Feb 2011 21:44:18 +0000 (21:44 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@872 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/Makefile
firmware/apps/jtag/jtag.c
firmware/apps/jtag/jtag430.c
firmware/apps/jtag/jtag430x2.c
firmware/include/jtag.h
firmware/include/jtag430.h

index 41f8dab..86e794b 100644 (file)
@@ -91,7 +91,7 @@ CC=msp430-gcc -Wall -Os -g -mmcu=$(mcu) -D$(mcu) -D$(platform) -Dplatform=$(plat
 #config = monitor sbw  chipcon nrf ccspi spi jtagarm7 jtag430 jtag430x2 avr
 
 # New default.
-config = monitor chipcon nrf spi jtagarm7 jtag430 avr
+config = monitor chipcon nrf spi jtagarm7 jtag430 jtag430x2 avr
 
 
 # Build the needed list of app and lib object files from the config
index 050e205..bda0fac 100644 (file)
 
 //! Handles a monitor command.
 void jtag_handle_fn(uint8_t const app,
-                                       uint8_t const verb,
-                                       uint32_t const len);
+                   uint8_t const verb,
+                   uint32_t const len);
+
+//! JTAG device ID.
+unsigned char jtagid=0;
 
 // define the jtag app's app_t
 app_t const jtag_app = {
index cd8b6b8..8b90f51 100644 (file)
@@ -174,8 +174,6 @@ void jtag430_writeflash(unsigned int adr, unsigned int data){
 
 //! Power-On Reset
 void jtag430_por(){
-  unsigned int jtagid;
-
   // Perform Reset
   jtag_ir_shift8(IR_CNTRL_SIG_16BIT);
   jtag_dr_shift16(0x2C01); // apply
@@ -373,17 +371,6 @@ void jtag430_setinstrfetch(){
   }
 }
 
-//! Grab the core ID.
-unsigned int jtag430_coreid(){
-  jtag_ir_shift8(IR_COREIP_ID);
-  return jtag_dr_shift16(0);
-}
-
-//! Grab the device ID.
-unsigned long jtag430_deviceid(){
-  jtag_ir_shift8(IR_DEVICE_ID);
-  return jtag_dr_shift20(0);
-}
 
 
 
@@ -551,11 +538,14 @@ void jtag430_handle_fn(uint8_t const app,
     txdata(app,verb,2);
     break;
   case JTAG430_COREIP_ID:
-    cmddataword[0]=jtag430_coreid();
+    //cmddataword[0]=jtag430_coreid();
+    cmddataword[0]=0xdead;
     txdata(app,verb,2);
     break;
   case JTAG430_DEVICE_ID:
-    cmddatalong[0]=jtag430_deviceid();
+    //cmddatalong[0]=jtag430_deviceid();
+    cmddataword[0]=0xdead;
+    cmddataword[0]=0xbeef;
     txdata(app,verb,4);
     break;
   default:
index 445bb10..685484e 100644 (file)
@@ -31,6 +31,17 @@ app_t const jtag430x2_app = {
 };
 
 
+//! Grab the core ID.
+unsigned int jtag430_coreid(){
+  jtag_ir_shift8(IR_COREIP_ID);
+  return jtag_dr_shift16(0);
+}
+
+//! Grab the device ID.
+unsigned long jtag430_deviceid(){
+  jtag_ir_shift8(IR_DEVICE_ID);
+  return jtag_dr_shift20(0);
+}
 
 
 //! Write data to address
index 5735a95..7aa1856 100644 (file)
 
 #define JTAG 0x10
 
+//! JTAG device ID.
+extern unsigned char jtagid;
+
+
 // Generic Commands
 
 //! Shift n bytes.
index 91c4eba..6ac6fcd 100644 (file)
@@ -20,8 +20,10 @@ extern unsigned int jtag430mode;
 
 // JTAG430 Commands
 
-//! Start JTAG, unique to the '430.
+//! Start JTAG, unique to the '430.  Deprecated.
 void jtag430_start();
+//! Same thing, but also for '430X2.
+unsigned char jtag430x2_start();
 //! Reset the TAP state machine, check the fuse.
 void jtag430_resettap();