MSP430-JTAG-TINY-V2 + mspdebug problems

Started by roland, December 07, 2012, 10:36:37 PM

Previous topic - Next topic

roland

Hi,

I'm trying to program a MSP430-CCRF board with the MSP430-JTAG-TINY-V2 using the latest mspdebug.

After plugging the USB cable of the MSP-JTAG-TINY-V2, the first invokation of mspdebug works:

----------------------------------------------
rha@lap597:~/mspdebug$ ./mspdebug -j -d /dev/ttyACM3 olimex
MSPDebug version 0.21 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2012 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Trying to open /dev/ttyACM3 at 115200 bps...
Resetting Olimex command processor...
Initializing FET...
FET protocol version is 1270003010
Set Vcc: 3000 mV
Configured for JTAG (2)
Sending reset...
Using Olimex identification procedure
Device ID: 0x5137
  Code start address: 0x8000
  Code size         : 32768 byte = 32 kb
  RAM  start address: 0x1c00
  RAM  end   address: 0x2bff
  RAM  size         : 4096 byte = 4 kb
Device: CC430F5137
Number of breakpoints: 3
fet: FET returned error code 34 (Not supported by selected interface or interface is not initialized)
fet: warning: message C_IDENT3 failed
fet: FET returned NAK
warning: device does not support power profiling
Chip ID data: 51 37 12

Available commands:
    =           erase       isearch     opt         run         setwatch_w 
    alias       exit        load        power       save_raw    simio       
    break       fill        load_raw    prog        set         step       
    cgraph      gdb         locka       read        setbreak    sym         
    delbreak    help        md          regs        setwatch    verify     
    dis         hexout      mw          reset       setwatch_r  verify_raw 

Available options:
    color           gdb_loop        iradix         
    fet_block_size  gdbc_xfer_size  quiet           

Type "help <topic>" for more information.
Press Ctrl+D to quit.

(mspdebug)
----------------------------------------------

But then, when pressing Ctrl-D and trying to do exactly the same thing again, it looks like this:

----------------------------------------------
rha@lap597:~/mspdebug$ ./mspdebug -j -d /dev/ttyACM3 olimex
MSPDebug version 0.21 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2012 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Trying to open /dev/ttyACM3 at 115200 bps...
Resetting Olimex command processor...
Initializing FET...
FET protocol version is 1270003010
Set Vcc: 3000 mV
Configured for JTAG (2)
Sending reset...
comport: read error: Connection timed out
warning: fet: reset failed
Using Olimex identification procedure
comport: read error: Connection timed out
fet: command C_IDENT1 failed
fet: identify failed
Trying again...
Resetting Olimex command processor...
Initializing FET...
comport: read error: Connection timed out
fet: open failed
rha@lap597:~/mspdebug$
----------------------------------------------

On the MSP430-JTAG-TINY-V2, the red LED is on after this.

And then, invoked for the third time, things fail even earlier:

----------------------------------------------
rha@lap597:~/mspdebug$ ./mspdebug -j -d /dev/ttyACM3 olimex
MSPDebug version 0.21 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2012 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Trying to open /dev/ttyACM3 at 115200 bps...
Resetting Olimex command processor...
Initializing FET...
comport: read error: Connection timed out
fet: open failed
Trying again...
Resetting Olimex command processor...
Initializing FET...
comport: read error: Connection timed out
fet: open failed
rha@lap597:~/mspdebug$
----------------------------------------------

unplugging / plugging the USB cable resets everything, it then works again for 1 cycle.

Does anyone have an idea what could go wrong here?

Greetings,
Roland


LubOlimex

Hey Roland,

I believe you haven't closed the debug session in the first session so the channel used stays open.

A good idea for questions and feedback on MSPDebug would be to mail directly Daniel Beer since I'm not sure he follows this forum.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

TheDude

Hi,
I am facing the same kind of issue. I have a few MSP430-JTAG-TINY-V2 bought a different time so they might have different firmwares. Some of them are working fine (I can program a device several times without unplugging the USB cable) some others stay stuck the second time at "Sending Reset...".
It doesn't seems to depend on mspdebug versions, and I noticed that for the working ones, mspdebug displays "FET protocol version is 10004002", for the others "FET protocol version is 1270003010". So is this it related to FET firmware ?

Best regards,
Laurent

roland

Hello Lub,

What do you mean with "not closed the debug session"? I didn't start anything, I just opened mspdebug and closed it after the command prompt appeared (Ctrl-D).

Given the difference of firmwares that TheDude mentioned, do you have any hint what might go wrong with the new firmware. Or if we can't find anything, can I downgrade to the older, obviously working firmware version?

Greetings,
Roland


nibbler

Same Problem here, I tested it with Ubuntu 12.04, used 2 diffrent JTAG Tiny and 3 diffrent MSP430 Boards (Olimex Proto Board, Olimex Header and some evaluation Board).

Does anyone have a workaround or fix for this?


MSPDebug version 0.18 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2011 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

drivers/olimex.c: Trying to open interface 0 on 004
drivers/olimex.c : driver -61
olimex: rev 1 device
Resetting Olimex command processor...
Initializing FET...
FET protocol version is 10004002
Configured for Spy-Bi-Wire
Set Vcc: 3000 mV
fet: FET returned error code 4 (Could not find device (or device not supported))
fet: command C_IDENT1 failed
fet: identify failed
Trying again...
Resetting Olimex command processor...
Initializing FET...
FET protocol version is 10004002
Configured for Spy-Bi-Wire
Sending reset...
fet: FET returned error code 4 (Could not find device (or device not supported))
warning: fet: reset failed
Set Vcc: 3000 mV
fet: FET returned error code 4 (Could not find device (or device not supported))
fet: command C_IDENT1 failed
fet: identify failed

roland

Hi,

After some debugging, Daniel has included a workaround in the newest version of mspdebug. This workaround disables the final reset of the chip when mspdebug disconnects (only for the specific CC430 chip version that shows this behavior).

Clone the latest git (not tarball!) repository as documented in

   http://mspdebug.sourceforge.net/download.html

compile this + you're done.

Greetings,
Roland

nibbler

Thanks so far, but it didn't fix my problem...

What I did:


sudo apt-get purge mspdebug
git clone git://mspdebug.git.sourceforge.net/gitroot/mspdebug/mspdebug
make WITHOUT_READLINE=1 // otherwise it gives me an readline.h missing error
make install

sudo mspdebug olimex
// this results in:
usbutil: unable to find a device matching 15ba:0031

// whereas:
sudo mspdebug olimex-v1
// this produces the same "C_IDENT1 failed" Error as before, I'm not sure what firmware on my JTAG-Tiny is (guess v1)



did I make an error somewhere?

roland

Hi,

Then you're probably facing a different issue. The one discussed here was definitely related to the CC430F5137 chip, which has difficulties to speak JTAG/SbW when it was previously reset.

This issue only happens with the CC430F5137, not with other MSP430 models.

Greetings,
Roland

TheDude

Hi,
I confirm that the workaround allows to program several times without unplugging the programmer on CC430F5137.
But for me the problem remains as I can not reset my chip anymore until I unplug the Olimex...
It seems that if neither C_CLOSE or C_RESET are done, the JTAG lines stay high and prevents to reset (because of TEST I guess).

No clue about the real cause of this issue? Can't it be a speed problem as the failing programmers (displaying "FET protocol version is 1270003010") are way faster (2x at least) to program than the working ones ("FET protocol version is 10004002") ? May be some reset sequence is done too fast ?

Best regards,
Laurent

roland

Laurent,

Yes, that makes sense, because the 'workaround' that Daniel did in mspdebug is in fact just to bypass the C_RESET function within the shutdown procedure of mspdebug. This way, mspdebug can be invoked multiple times because the CC430 just doesn't notice that the programmer goes away in between.

It's a workaround, not really a solution I think.

Greetings,
Roland