dlbeer / mspdebug

Debugging tool for MSP430 MCUs
GNU General Public License v2.0
190 stars 80 forks source link

tilib: broken for 0.24 and MSP-EXP430FR5969 #36

Open daniel-k opened 7 years ago

daniel-k commented 7 years ago

Hi,

I'm trying to get my EXP-MSP430FR5969 running and it looks like 0.24 is not working with tilib and the latest mspds. I install mspdebug and mspds on Archlinux via AUR, but only a downgrade of mspdebug to 0.23 yields a working debugger.

mspdebug 0.24 wants to update the firmware and then fails:

$ sudo mspdebug tilib --allow-fw-update
MSPDebug version 0.24 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2016 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.
Chip info database from MSP430.dll v3.3.1.4 Copyright (C) 2013 TI, Inc.

Using new (SLAC460L+) API
MSP430_GetNumberOfUsbIfs
MSP430_GetNameOfUsbIf
Found FET: ttyACM0
MSP430_Initialize: ttyACM0
FET firmware update is required.
Starting firmware update (this may take some time)...
Initializing bootloader...
Programming new firmware...
     4 percent done
    20 percent done
    36 percent done
    52 percent done
    52 percent done
    52 percent done
    52 percent done
    52 percent done
    68 percent done
    84 percent done
   100 percent done
Update complete
Done, finishing...
Initializing bootloader...
Programming new firmware...
     4 percent done
    20 percent done
    36 percent done
    52 percent done
    52 percent done
    52 percent done
    52 percent done
    52 percent done
    68 percent done
    84 percent done
   100 percent done
Update complete
Done, finishing...
Initializing bootloader...
Programming new firmware...
     4 percent done
    20 percent done
    36 percent done
    52 percent done
    52 percent done
    52 percent done
    52 percent done
    52 percent done
    68 percent done
    84 percent done
   100 percent done
Update complete
Done, finishing...
tilib: MSP430_FET_FwUpdate: MSP-FET / eZ-FET legacy module update failed (error = 75)
tilib: device initialization failed

Working downgrade to 0.23

$ sudo mspdebug tilib --allow-fw-update
MSPDebug version 0.23 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2015 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.
Chip info database from MSP430.dll v3.3.1.4 Copyright (C) 2013 TI, Inc.

MSP430_GetNumberOfUsbIfs
MSP430_GetNameOfUsbIf
Found FET: ttyACM0
MSP430_Initialize: ttyACM0
Firmware version is 4294967295
MSP430_VCC: 3000 mV
MSP430_OpenDevice
MSP430_GetFoundDevice
Device:  (id = 0x0000)
0 breakpoints available
MSP430_EEM_Init
Chip ID data: 03 00

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

Available options:
    color                       gdb_default_port            
    enable_bsl_access           gdb_loop                    
    enable_fuse_blow            gdbc_xfer_size              
    enable_locked_flash_access  iradix                      
    fet_block_size              quiet                       

Type "help <topic>" for more information.
Use the "opt" command ("help opt") to set options.
Press Ctrl+D to quit.

(mspdebug)

0.23 doesn't work either. 0 breakpoints available and memory reads are non-sense, it just doesn't fail like 0.24.

I also tried current master with slac460s and possibly all combinations [0.23, 0.24, master] x [slac460s, slac460t] but to no avail.

dlbeer commented 7 years ago

The only version of mspdebug likely to work correctly with SLAC460S and up is the current master branch, so I wouldn't bother doing anything further with 0.23 and 0.24.

Unless there's some new incompatibility I'm unaware of, this looks like a problem between your board and the library. You might need to contact TI about this.

daniel-k commented 7 years ago

Well at least the error messages change. In the following, I'm using current master and SLAC460S.

$ sudo mspdebug tilib --allow-fw-update
...

Using new (SLAC460L+) API
MSP430_GetNumberOfUsbIfs
MSP430_GetNameOfUsbIf
Found FET: ttyACM0
MSP430_Initialize: ttyACM0
FET firmware update is required.
Starting firmware update (this may take some time)...
Initializing bootloader...
Programming new firmware...
     4 percent done
     4 percent done
     4 percent done
     4 percent done
     4 percent done
     4 percent done
     4 percent done
    20 percent done
    20 percent done
    20 percent done
    20 percent done
    20 percent done
    36 percent done
    52 percent done
    52 percent done
    52 percent done
    52 percent done
    52 percent done
    68 percent done
    84 percent done
    84 percent done
    84 percent done
    84 percent done
    84 percent done
   100 percent done
Update complete
Done, finishing...
MSP430_VCC: 3000 mV
MSP430_OpenDevice
tilib: MSP430_OpenDevice: Device database not loaded. (error = 98)

So programming more or less works now I guess. But when I subsequently try to connect, I get:

$ sudo mspdebug tilib
...

Using new (SLAC460L+) API
MSP430_GetNumberOfUsbIfs
MSP430_GetNameOfUsbIf
Found FET: ttyACM0
MSP430_Initialize: ttyACM0
tilib: MSP430_Initialize: Interface Communication error (error = 35)
tilib: device initialization failed

And after a while also:

$ sudo mspdebug tilib
...

Using new (SLAC460L+) API
MSP430_GetNumberOfUsbIfs
No unused FET found.

Maybe this helps. There are people on the internet ([1] [2]) who are using the exact same board with mspdebug, so I guess it's not that.

dlbeer commented 7 years ago

Do older versions of the TI library work (pre-S)? If not, do you have access to a Windows machine where you can test Code Composer Studio to see if that works with your board?

daniel-k commented 7 years ago

I finally got hold of slac460r.zip which is non-trivial thanks to TI release policy, and it works now. So I can say that S definitely breaks mspdebug for TI Launchpad FR5969 for me.

spoorcc commented 7 years ago

Thanks @daniel-k, I had the exact same problems, I used slac460r and it again worked for me (FR6989)

CrazyCasta commented 7 years ago

@dlbeer : can we get a 0.25 out to handle this s issue? It would be nice if all the packages could get uploaded so I can stop running self compiled code from my home directory :)

dlbeer commented 7 years ago

Yes, that'd be a good idea. I'm a bit tied up at the moment, but will add this to my to-do list. If I don't hear of anything significantly broken in the master branch within a week, I'll put together a release.