Block reads in CC_READ_XDATA_MEMORY.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 7 Oct 2010 22:18:42 +0000 (22:18 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 7 Oct 2010 22:18:42 +0000 (22:18 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@748 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/apps/chipcon/chipcon.c
firmware/apps/jtag/jtag430.c

index d2f70ac..c2b7838 100644 (file)
@@ -148,6 +148,7 @@ void cchandle(unsigned char app,
   //Might hurt too.
   //ccdebuginit();
   long i;
   //Might hurt too.
   //ccdebuginit();
   long i;
+  int blocklen, blockadr;
   
   switch(verb){
     //CC_PEEK and CC_POKE will come later.
   
   switch(verb){
     //CC_PEEK and CC_POKE will come later.
@@ -187,6 +188,7 @@ void cchandle(unsigned char app,
     
   //Micro commands!
   case CC_CHIP_ERASE:
     
   //Micro commands!
   case CC_CHIP_ERASE:
+  case CC_MASS_ERASE_FLASH:
     cc_chip_erase();
     txdata(app,verb,1);
     break;
     cc_chip_erase();
     txdata(app,verb,1);
     break;
@@ -244,9 +246,18 @@ void cchandle(unsigned char app,
     txdata(app,verb,1);
     break;
   case CC_READ_XDATA_MEMORY:
     txdata(app,verb,1);
     break;
   case CC_READ_XDATA_MEMORY:
-    cmddata[0]=cc_peekdatabyte(cmddataword[0]);
+    //Read the length.
+    blocklen=1;
+    if(len>2)
+      blocklen=cmddataword[1];
+    blockadr=cmddataword[0];
+    
+    //Return that many bytes.
+    for(i=0;i<blocklen;i++)
+      cmddata[i]=cc_peekdatabyte(blockadr+i);
     txdata(app,verb,1);
     break;
     txdata(app,verb,1);
     break;
+    
   case CC_WRITE_XDATA_MEMORY:
     cmddata[0]=cc_pokedatabyte(cmddataword[0], cmddata[2]);
     txdata(app,verb,1);
   case CC_WRITE_XDATA_MEMORY:
     cmddata[0]=cc_pokedatabyte(cmddataword[0], cmddata[2]);
     txdata(app,verb,1);
@@ -264,9 +275,10 @@ void cchandle(unsigned char app,
       cc_pokedatabyte(i,0xFF);
     txdata(app,verb,0);
     break;
       cc_pokedatabyte(i,0xFF);
     txdata(app,verb,0);
     break;
-  case CC_MASS_ERASE_FLASH:
+  
   case CC_CLOCK_INIT:
   case CC_PROGRAM_FLASH:
   case CC_CLOCK_INIT:
   case CC_PROGRAM_FLASH:
+  default:
     debugstr("This Chipcon command is not yet implemented.");
     txdata(app,NOK,0);//TODO implement me.
     break;
     debugstr("This Chipcon command is not yet implemented.");
     txdata(app,NOK,0);//TODO implement me.
     break;
index f98cc5f..469e03c 100644 (file)
@@ -319,8 +319,6 @@ void jtag430handle(unsigned char app,
   unsigned long at;
   unsigned int i, val;
   
   unsigned long at;
   unsigned int i, val;
   
-  //debugstr("Classic MSP430 handler.");
-  
   
   /* FIXME
    * Sometimes JTAG doesn't init correctly.
   
   /* FIXME
    * Sometimes JTAG doesn't init correctly.