From: travisutk Date: Thu, 3 Feb 2011 22:21:01 +0000 (+0000) Subject: Closer to MSP430X2 support. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=9afcc58660c97fb70b2f214e2008a86deac531b1;hp=75c003d3ea88663bef3bd54535a228a1d814518f Closer to MSP430X2 support. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@874 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/firmware/apps/jtag/jtag430.c b/firmware/apps/jtag/jtag430.c index 8b90f51..88ff455 100644 --- a/firmware/apps/jtag/jtag430.c +++ b/firmware/apps/jtag/jtag430.c @@ -264,7 +264,6 @@ void jtag430_resettap(){ } -unsigned char jtagid; //! Get the JTAG ID unsigned char jtag430x2_jtagid(){ @@ -410,9 +409,13 @@ void jtag430_handle_fn(uint8_t const app, cmddata[0]=jtag_ir_shift8(IR_BYPASS); txdata(app,verb,1); */ + jtag430x2_start(); cmddata[0]=jtagid; + if(jtagid!=MSP430JTAGID){ + debugstr("Using JTAG430 (instead of JTAG430X2)!"); + } jtag430mode=MSP430MODE; /* So the way this works is that a width of 20 does some diff --git a/firmware/apps/jtag/jtag430x2.c b/firmware/apps/jtag/jtag430x2.c index 685484e..6ba361a 100644 --- a/firmware/apps/jtag/jtag430x2.c +++ b/firmware/apps/jtag/jtag430x2.c @@ -220,23 +220,28 @@ void jtag430x2_handle_fn( uint8_t const app, break; case JTAG430_READMEM: case PEEK: - blocks=(len>4?cmddata[4]:1); at=cmddatalong[0]; - l=0x80; - txhead(app,verb,l); + //Fetch large blocks for bulk fetches, + //small blocks for individual peeks. + if(len>5) + l=(cmddataword[2]);//always even. + else + l=2; + l&=~1;//clear lsbit - while(blocks--){ - for(i=0;i>8); - } + if(l<2) l=2; + + txhead(app,verb,l); + for(i=0;i>8); } break; @@ -258,7 +263,11 @@ void jtag430x2_handle_fn( uint8_t const app, break; //unimplemented functions - case JTAG430_HALTCPU: + case JTAG430_HALTCPU: + //jtag430x2_haltcpu(); + debugstr("Warning, not trying to halt for lack of code."); + txdata(app,verb,0); + break; case JTAG430_RELEASECPU: case JTAG430_SETINSTRFETCH: