MSP430G2553 launchpad cannot upload - no USB FET was found

Hi
I’ve been using pio for Arduino using Debian sid, and it all works well.
However on my old MSP430G2553 launchpad board, I can compile but not upload, failing with the error " No USB FET was found"

I installed the mspdebug package, and can successfully control the board using the rf2500 driver with mspdebug - I just can’t upload using PIO.

Below is the output of an attempt:

Processing lpmsp430g2553 (platform: timsp430; board: lpmsp430g2553; framework: arduino)
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/timsp430/lpmsp430g2553.html
PLATFORM: TI MSP430 2.2.0 > TI LaunchPad MSP-EXP430G2553LP
HARDWARE: MSP430G2553 16MHz, 512B RAM, 16KB Flash
DEBUG: Current (mspdebug) On-board (mspdebug)
PACKAGES: 
 - framework-energiamsp430 1.10807.190926 (1.8.7) 
 - tool-dslite 1.80200.1400 (8.2.0) 
 - tool-mspdebug 1.2400.190926 (24.0) 
 - toolchain-timsp430 1.40603.190926 (4.6.3)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 18 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/lpmsp430g2553/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   7.0% (used 36 bytes from 512 bytes)
Flash: [=         ]   6.6% (used 1084 bytes from 16384 bytes)
Configuring upload protocol...
AVAILABLE: dslite
CURRENT: upload_protocol = dslite
Uploading .pio/build/lpmsp430g2553/firmware.elf
DSLite version 8.2.0.1400
Configuring Debugger (may take a few minutes on first launch)...
        Initializing Register Database...
        Initializing: MSP430
error: MSP430: Error initializing emulator: No USB FET was found
Failed: MSP430: Error initializing emulator: No USB FET was found

Maybe some pointers at MSP430 upload failed "No unused FET found." help? Does manually using a newer version of dslite help?

I did see your previous help on that topic a few days ago. So I went looking for drivers on TI’s site, and attempted to install MSP430_FET_Drivers 1_0_1_1 - this however fails to install, its missing a udev rule file and I’ve asked about that on the TI forums as well.

I have tried using the DSLite from the latest Energia (9.2.0.1793-e1) and also from the latest version of TI’s Uniflash (10.1.0.2076) - both failed with the same error.

I’ve also tried installing the latest ccs from TI, & Energia in the hope that maybe some config is missing in PIO, but I get the same error from both of those tools when they run DSLite.

I’m lost. All I know is that mspdebug rf2500 can talk to the board, but DSLite cannot find it.

Does running sudo pio run -t upload make a difference? What’s the output apprears when starting dmesg -w and pluging in the device?

I’m having the same issue with MSP-EXP430F5529LP on macOS Catalina.

CCS 10 works fine, it compiles, loads and debugs programs on the board.
Energia 1.8.11E23 works fine.

PlatformIO on VS Code is able to compile the sources but it issues the same error reported by flyflytn.

Running pio with sudo does not help. Running PlatformIO DSLite manually with and without sudo yield the same error.

Running Energia included DSLite version 9.2.0.1793 manually with the .hex generated by platformIO works fine without sudo.

I even checked the .ccxml files but pio and energia are identical.

I went a bit further and replaced ~/.platformio/packages/tool-dslite/DebugServer/bin and ~/.platformio/packages/tool-dslite/common/bin with the Energia counterparts. Same error, but now pio seems to be using version 9.2.0.01793 instead of 8.2.0.1400.

Uploading .pio/build/lpmsp430f5529/firmware.elf
DSLite version 9.2.0.1793
Configuring Debugger (may take a few minutes on first launch)...
        Initializing Register Database...
        Initializing: MSP430
error: MSP430: Error initializing emulator: No USB FET was found
Failed: MSP430: Error initializing emulator: No USB FET was found

*** [upload] Error 1

Finally I went a bit further and replaced the folder tool-dslite with the energia courtepart. It parses a lot of files but fails in the end with the same error.

Processing lpmsp430f5529 (platform: timsp430; board: lpmsp430f5529)
-------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/timsp430/lpmsp430f5529.html
PLATFORM: TI MSP430 (2.2.0) > TI LaunchPad MSP-EXP430F5529LP
HARDWARE: MSP430F5529 25MHz, 8KB RAM, 47KB Flash
DEBUG: Current (mspdebug) On-board (mspdebug)
PACKAGES: 
 - tool-dslite 1.80200.1400 (8.2.0) 
 - tool-mspdebug 1.2400.190926 (24.0) 
 - toolchain-timsp430 1.40603.190926 (4.6.3)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/lpmsp430f5529/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 2 bytes from 8192 bytes)
Flash: [          ]   0.6% (used 272 bytes from 48128 bytes)
Configuring upload protocol...
AVAILABLE: dslite
CURRENT: upload_protocol = dslite
Uploading .pio/build/lpmsp430f5529/firmware.elf
DSLite version 8.2.0.1400
Configuring Debugger (may take a few minutes on first launch)...
    Parsing connections/TIMSP430-USB.xml
    Parsing drivers/msp430_emu.xml
    Parsing devices/MSP430F5529.xml
    Parsing ../options/MSP430F5529_TI.xml
    Parsing ../options/MSP430F5529_GNU.xml
    Parsing ../cpus/MSP430Xv2.xml
    Parsing ../Modules/msp430/ADC12_2.xml
    Parsing ../Modules/msp430/Comparator_B_1.xml
    Parsing ../Modules/msp430/CRC16_2.xml
    Parsing ../Modules/msp430/DMA_8.xml
    Parsing ../Modules/msp430/Flash_6.xml
    Parsing ../Modules/msp430/MPY_16__Multiplier__16_Bit_Mode_1.xml
    Parsing ../Modules/msp430/MPY_32__Multiplier__32_Bit_Mode_1.xml
    Parsing ../Modules/msp430/Port_A_1.xml
    Parsing ../Modules/msp430/Port_1_2_5.xml
    Parsing ../Modules/msp430/Port_B_1.xml
    Parsing ../Modules/msp430/Port_3_4_4.xml
    Parsing ../Modules/msp430/Port_C_1.xml
    Parsing ../Modules/msp430/Port_5_6_3.xml
    Parsing ../Modules/msp430/Port_D_1.xml
    Parsing ../Modules/msp430/Port_7_8_3.xml
    Parsing ../Modules/msp430/Port_J_1.xml
    Parsing ../Modules/msp430/Port_Mapping_Control_1.xml
    Parsing ../Modules/msp430/Port_Mapping_Port_4_1.xml
    Parsing ../Modules/msp430/PMM__Power_Management_System_2.xml
    Parsing ../Modules/msp430/RC__RAM_Control_Module_2.xml
    Parsing ../Modules/msp430/Shared_Reference_1.xml
    Parsing ../Modules/msp430/RTC__Real_Time_Clock_1.xml
    Parsing ../Modules/msp430/SFR__Special_Function_Registers_1.xml
    Parsing ../Modules/msp430/SYS__System_Module_2.xml
    Parsing ../Modules/msp430/Timer0_A5_1.xml
    Parsing ../Modules/msp430/Timer1_A3_1.xml
    Parsing ../Modules/msp430/Timer2_A3_1.xml
    Parsing ../Modules/msp430/Timer0_B7_1.xml
    Parsing ../Modules/msp430/USB_Control_1.xml
    Parsing ../Modules/msp430/USB_Operation_1.xml
    Parsing ../Modules/msp430/UCS__Unified_System_Clock_3.xml
    Parsing ../Modules/msp430/USCI_A0__UART_Mode_2.xml
    Parsing ../Modules/msp430/USCI_A0__SPI_Mode_2.xml
    Parsing ../Modules/msp430/USCI_B0__SPI_Mode_2.xml
    Parsing ../Modules/msp430/USCI_B0__I2C_Mode_3.xml
    Parsing ../Modules/msp430/USCI_A1__UART_Mode_2.xml
    Parsing ../Modules/msp430/USCI_A1__SPI_Mode_2.xml
    Parsing ../Modules/msp430/USCI_B1__SPI_Mode_2.xml
    Parsing ../Modules/msp430/USCI_B1__I2C_Mode_2.xml
    Parsing ../Modules/msp430/Watchdog_Timer_2.xml
    Parsing ../Modules/msp430/MSP430Xv2_NotVisible.xml
    Initializing Register Database...
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2028_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/ICEPick_C_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2003_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2031_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2006_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2001_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS470RXX_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2027_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2004_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/ICEPick_D_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS470REX_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS320C28XX_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2030_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2007_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/CS_DAP_0_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/MSP430_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2029_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2002_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2008_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2005_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2032_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2000_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/CS_DAP_PC_0_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/TMS192C2026_regids.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/drivers/TI_reg_ids/ICEPick_M_regids.xml
    Parsing /Users/edil/.ti/.platformio/3/0/4327258960521144129.cache
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/ADC12_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Comparator_B_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/CRC16_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/DMA_8.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Flash_6.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/MPY_16__Multiplier__16_Bit_Mode_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/MPY_32__Multiplier__32_Bit_Mode_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Port_A_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Port_1_2_5.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Port_B_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Port_3_4_4.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Port_C_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Port_5_6_3.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Port_D_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Port_7_8_3.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Port_J_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Port_Mapping_Control_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Port_Mapping_Port_4_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/PMM__Power_Management_System_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/RC__RAM_Control_Module_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Shared_Reference_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/RTC__Real_Time_Clock_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/SFR__Special_Function_Registers_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/SYS__System_Module_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Timer0_A5_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Timer1_A3_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Timer2_A3_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Timer0_B7_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/USB_Control_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/USB_Operation_1.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/UCS__Unified_System_Clock_3.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/USCI_A0__UART_Mode_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/USCI_A0__SPI_Mode_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/USCI_B0__SPI_Mode_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/USCI_B0__I2C_Mode_3.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/USCI_A1__UART_Mode_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/USCI_A1__SPI_Mode_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/USCI_B1__SPI_Mode_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/USCI_B1__I2C_Mode_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/Watchdog_Timer_2.xml
    Parsing /Users/edil/.platformio/packages/BAK_dslite/common/targetdb/Modules/msp430/MSP430Xv2_NotVisible.xml
    Initializing: MSP430
error: MSP430: Error initializing emulator: No USB FET was found
Failed: MSP430: Error initializing emulator: No USB FET was found

*** [upload] Error 1

OSX does not give nice dmesg messages, but lsusb gives:

Bus 020 Device 042: ID 056a:033e Wacom Co., Ltd CTH-690 [Intuos Art (M)]
Bus 020 Device 041: ID 2047:0013 Texas Instruments
Bus 020 Device 040: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
Bus 020 Device 026: ID 2516:0059 Cooler Master Co., Ltd.
Bus 001 Device 004: ID 2109:0817 VIA Labs, Inc.
Bus 020 Device 058: ID 2109:2817 VIA Labs, Inc.

which seems fine and ccs and energia are able to detect the board automatically anyhow.

There must be something else missing.

The same happens with platformio-ide.useDevelopmentPIOCore VS Code option set to true.

How are you invoking DSLite to upload the hex file?

Also, if uploading in the Arduino IDE with the same DSLite version works, can you enable “Verbose Upload” in the Arduino IDE settings, upload and post the log here?

Same for PlatformIO with the “Verbose Upload” build task. That should show differences in DSLite invocation if there are any.

This is Energia output.

/Users/edil/Library/Energia15/packages/energia/tools/dslite/9.3.0.1863/DebugServer/bin/DSLite load -c /Users/edil/Library/Energia15/packages/energia/tools/dslite/9.3.0.1863/MSP-EXP430F5529LP.ccxml -f /var/folders/zd/8cfgzzt17953y48x35__p1h80000gn/T/arduino_build_870525/Blink.ino.elf 
    DSLite version 9.3.0.1863
    Configuring Debugger (may take a few minutes on first launch)...
    	Initializing Register Database...
    	Initializing: MSP430
    	Executing Startup Scripts: MSP430
    Connecting...
    Loading Program: /var/folders/zd/8cfgzzt17953y48x35__p1h80000gn/T/arduino_build_870525/Blink.ino.elf
    	Preparing ... 
    	.text: 0 of 1078 at 0x4400
    	.text: 0 of 128 at 0xff80: 88%
    	Finished: 88%
    	Setting PC to entry point.: 88%
    info: MSP430:  Flash/FRAM usage is 1224 bytes. RAM usage is 0 bytes.
    Running...
    Success

This is pio run -v -t upload:

Processing lpmsp430f5529 (platform: timsp430; board: lpmsp430f5529)
-----------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/timsp430/lpmsp430f5529.html
PLATFORM: TI MSP430 (2.2.0) > TI LaunchPad MSP-EXP430F5529LP
HARDWARE: MSP430F5529 25MHz, 8KB RAM, 47KB Flash
DEBUG: Current (mspdebug) On-board (mspdebug)
PACKAGES:
 - tool-dslite 1.80200.1400 (8.2.0)
 - tool-mspdebug 1.2400.190926 (24.0)
 - toolchain-timsp430 1.40603.190926 (4.6.3)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
MethodWrapper(["checkprogsize"], [".pio/build/lpmsp430f5529/firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 2 bytes from 8192 bytes)
Flash: [          ]   0.6% (used 272 bytes from 48128 bytes)
.pio/build/lpmsp430f5529/firmware.elf  :
section          size    addr
.text             144   17408
.noinit             2    9216
.vectors          128   65408
.debug_aranges    120       0
.debug_info       666       0
.debug_abbrev     120       0
.debug_line       519       0
Total            1699
<lambda>(["upload"], [".pio/build/lpmsp430f5529/firmware.elf"])
AVAILABLE: dslite
CURRENT: upload_protocol = dslite
/Users/edil/.platformio/packages/tool-dslite/DebugServer/bin/DSLite load -c /Users/edil/.platformio/packages/tool-dslite/MSP-EXP430F5529LP.ccxml -f .pio/build/lpmsp430f5529/firmware.elf
DSLite version 8.2.0.1400
Configuring Debugger (may take a few minutes on first launch)...
	Initializing Register Database...
	Initializing: MSP430
error: MSP430: Error initializing emulator: No USB FET was found
Failed: MSP430: Error initializing emulator: No USB FET was found

*** [upload] Error 1

This is calling energia dslite manually:

/Applications/Energia.app/Contents/Java/hardware/tools/DSLite/DebugServer/bin/DSLite load --config=/Applications/Energia.app/Contents/Java/hardware/tools/DSLite/MSP-EXP430F5529LP.ccxml -f .pio/build/lpmsp430f5529/firmware.hex
DSLite version 9.2.0.1793
Configuring Debugger (may take a few minutes on first launch)...
	Initializing Register Database...
	Initializing: MSP430
	Executing Startup Scripts: MSP430
Connecting...
Loading Program: .pio/build/lpmsp430f5529/firmware.hex
	Preparing ...
	0 of 144 at 0x4400
	0 of 128 at 0xff80: 52%
	Finished: 52%
	Setting PC to entry point.: 52%
info: MSP430:  There were 272 bytes written.
Running...
Success

This is calling pio dslite manually:

~/.platformio/packages/tool-dslite/DebugServer/bin/DSLite load --config=/Users/edil/.platformio/packages/tool-dslite/MSP-EXP430F5529LP.ccxml -f .pio/build/lpmsp430f5529/firmware.hex
DSLite version 8.2.0.1400
Configuring Debugger (may take a few minutes on first launch)...
	Initializing Register Database...
	Initializing: MSP430
error: MSP430: Error initializing emulator: No USB FET was found
Failed: MSP430: Error initializing emulator: No USB FET was found

I see no difference between invocations other than the paths of the tools and config files. sudo makes no difference for the pio tools.

The problem is the msp430.dylib driver shipped with pio.

I installed the Texas Instruments GCC Toolchain 9.2.0 (MSP430-GCC-OPENSOURCE IDE, configuration, compiler or debugger | TI.com) and replaced the original version on ~/.platformio/packages/tool-dslite/DebugServer/drivers with the Texas one.

It succeeded loading the binary onto the board. I don’t know yet how to debug with pio to check if it is all.

Processing lpmsp430f5529 (platform: timsp430; board: lpmsp430f5529)
--------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/timsp430/lpmsp430f5529.html
PLATFORM: TI MSP430 (2.2.0) > TI LaunchPad MSP-EXP430F5529LP
HARDWARE: MSP430F5529 25MHz, 8KB RAM, 47KB Flash
DEBUG: Current (mspdebug) On-board (mspdebug)
PACKAGES:
 - tool-dslite 1.80200.1400 (8.2.0)
 - tool-mspdebug 1.2400.190926 (24.0)
 - toolchain-timsp430 1.40603.190926 (4.6.3)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
msp430-gcc -o .pio/build/lpmsp430f5529/src/blink.o -c -Os -ffunction-sections -fdata-sections -mmcu=msp430f5529 -DF_CPU=25000000L -DPLATFORMIO=50003 -DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430F5529LP -Iinclude -Isrc src/blink.c
msp430-gcc -o .pio/build/lpmsp430f5529/firmware.elf -Os -mmcu=msp430f5529 -Wl,-gc-sections,-u,main .pio/build/lpmsp430f5529/src/blink.o -L.pio/build/lpmsp430f5529 -Wl,--start-group -lm -Wl,--end-group
MethodWrapper(["checkprogsize"], [".pio/build/lpmsp430f5529/firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 2 bytes from 8192 bytes)
Flash: [          ]   0.6% (used 272 bytes from 48128 bytes)
.pio/build/lpmsp430f5529/firmware.elf  :
section          size    addr
.text             144   17408
.noinit             2    9216
.vectors          128   65408
.debug_aranges    120       0
.debug_info       666       0
.debug_abbrev     120       0
.debug_line       519       0
Total            1699
<lambda>(["upload"], [".pio/build/lpmsp430f5529/firmware.elf"])
AVAILABLE: dslite
CURRENT: upload_protocol = dslite
/Users/edil/.platformio/packages/tool-dslite/DebugServer/bin/DSLite load -c /Users/edil/.platformio/packages/tool-dslite/MSP-EXP430F5529LP.ccxml -f .pio/build/lpmsp430f5529/firmware.elf
DSLite version 8.2.0.1400
Configuring Debugger (may take a few minutes on first launch)...
	Initializing Register Database...
	Initializing: MSP430
	Executing Startup Scripts: MSP430
Connecting...
Loading Program: .pio/build/lpmsp430f5529/firmware.elf
	Preparing ...
	.text: 0 of 144 at 0x4400
	.text: 0 of 128 at 0xff80: 52%
	Finished: 52%
	Setting PC to entry point.: 52%
info: MSP430:  Flash/FRAM usage is 274 bytes. RAM usage is 0 bytes.
Running...
Success
1 Like

@ivankravets can you have a look at above package version? May solve a lot of problems

Disclaimer: sorry for the long reply… I’m really excited with the principles behind platformIO. It seems to be extremely fitted to be used in classrooms to expose the toolchain quite a bit more for my students without all the incidental complexity of setting up the toolchain themselves (which is a really pain in the **s for novices).

I confirm debugging does not work either, probably for all MSP430 boards. I’m still trying to fiddle to see if I can figure out a solution but I got stuck…

  1. To upload, as described above, the msp430.dylib for dslite is broken. It can be solved by taking the binary file from Texas instruments open source tools as described above.

  2. Default compiler flags are buggy. Can be easily solved by adding debug_build_flags = -O0 -g3 -ggdb3 to the platformio.ini file. Would be nice to have those as default…

    $ pio debug -v
    Processing lpmsp430f5529 (platform: timsp430; board: lpmsp430f5529)
    --------------------------------------------------------------------------------
    CONFIGURATION: https://docs.platformio.org/page/boards/timsp430/lpmsp430f5529.html
    PLATFORM: TI MSP430 (2.2.0) > TI LaunchPad MSP-EXP430F5529LP
    HARDWARE: MSP430F5529 25MHz, 8KB RAM, 47KB Flash
    DEBUG: Current (mspdebug) On-board (mspdebug)
    PACKAGES:
     - toolchain-timsp430 1.40603.190926 (4.6.3)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 0 compatible libraries
    Scanning dependencies...
    No dependencies
    Building in debug mode
    msp430-g++ -o .pio/build/lpmsp430f5529/src/main.o -c -fno-exceptions -fno-threadsafe-statics -ffunction-sections -fdata-sections -mmcu=msp430f5529 -Og -g2 -ggdb2 -DF_CPU=25000000L -DPLATFORMIO=50003 -DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430F5529LP -D__PLATFORMIO_BUILD_DEBUG__ -Iinclude -Isrc src/main.cpp
    cc1plus: error: argument to '-O' should be a non-negative integer
    *** [.pio/build/lpmsp430f5529/src/main.o] Error 1
  1. The debugger, however is based on mspdebug and it is being requested to use the dslite driver by default which it does not understand.
    $ piodebuggdb -v
    Preparing firmware for debugging...
    Processing lpmsp430f5529 (platform: timsp430; board: lpmsp430f5529; debug_build_flags: -O0 -g3 -ggdb3)
    --------------------------------------------------------------------------------
    CONFIGURATION: https://docs.platformio.org/page/boards/timsp430/lpmsp430f5529.html
    PLATFORM: TI MSP430 (2.2.0) > TI LaunchPad MSP-EXP430F5529LP
    HARDWARE: MSP430F5529 25MHz, 8KB RAM, 47KB Flash
    DEBUG: Current (mspdebug) On-board (mspdebug)
    PACKAGES:
     - toolchain-timsp430 1.40603.190926 (4.6.3)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 0 compatible libraries
    Scanning dependencies...
    No dependencies
    Building in debug mode
    MethodWrapper(["checkprogsize"], [".pio/build/lpmsp430f5529/firmware.elf"])
    Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
    RAM:   [          ]   0.0% (used 2 bytes from 8192 bytes)
    Flash: [          ]   0.7% (used 330 bytes from 48128 bytes)
    .pio/build/lpmsp430f5529/firmware.elf  :
    section           size    addr
    .text              202   17408
    .noinit              2    9216
    .vectors           128   65408
    .debug_aranges     144       0
    .debug_info        882       0
    .debug_abbrev      277       0
    .debug_line        812       0
    .debug_frame        60       0
    .debug_str         206       0
    .debug_loc          64       0
    .debug_macinfo   75105       0
    .debug_ranges       12       0
    Total            77894
    ========================= [SUCCESS] Took 0.37 seconds =========================
    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.

    Unknown driver: dslite. Try --help for a list.
    Reading symbols from /Users/jose.edil/2-development/ti/pio-workspace/Blink/.pio/build/lpmsp430f5529/firmware.elf...done.
    (gdb)

I’m quite familiar with mspdebug and even tough the command line does not show in the log, it is probably trying to call it with mspdebug dslite which yields

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.

Unknown driver: dslite. Try --help for a list.

In my experience, mspdebug works best with the Launchpad boards using the tilib driver (which is based on the same lib I pointed before in the dslite solution). Unfortunately the pio version yields:

❯ ./mspdebug tilib
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.

tilib_api: can't find libmsp430.so: dlopen(libmsp430.so, 1): image not found

which is quite weird as in OSX the dynamic libraries use the .dylib suffix. Anyhow, I copied the same libmsp430.dylib to the ~/.platformio/packages/tool-mspdebug folder and renamed accordingly and it connects to the board when called from within the ~/.platformio/packages/tool-mspdebug folder:

❯ ls
builtin_tools_versions.txt mspdebug
libmsp430.so               package.json
jose.edil in .platformio/packages/tool-mspdebug
❯ ./mspdebug tilib
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: usbmodem141201
MSP430_Initialize: usbmodem141201
Firmware version is 31501001
…

This does not work in VS Code, however, it complains about not finding the library file. The default folder mspdebug looks for the library is /usr/local/lib (I inspected the source code a long time ago…) so the libmsp430.dylib should be renamed and copied there. This breaks the nice sandbox of platformIO but I could not advance without it…

By adding

debug_tool = mspdebug
upload_protocol = tilib

to the project .ini file pio now tries do do everything with mspdebug. It uploads the binary on the CLI and in VS Code, but the debugger in VS Code seems to start and then halt. In the command line it is able to start everything but:

❯ piodebuggdb -v
Preparing firmware for debugging...
Processing lpmsp430f5529 (platform: timsp430; board: lpmsp430f5529; upload_protocol: tilib; debug_tool: mspdebug; debug_build_flags: -O0 -g3 -ggdb3)
--------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/timsp430/lpmsp430f5529.html
PLATFORM: TI MSP430 (2.2.0) > TI LaunchPad MSP-EXP430F5529LP
HARDWARE: MSP430F5529 25MHz, 8KB RAM, 47KB Flash
DEBUG: Current (mspdebug) On-board (mspdebug)
PACKAGES:
 - toolchain-timsp430 1.40603.190926 (4.6.3)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
MethodWrapper(["checkprogsize"], [".pio/build/lpmsp430f5529/firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 2 bytes from 8192 bytes)
Flash: [          ]   0.7% (used 330 bytes from 48128 bytes)
.pio/build/lpmsp430f5529/firmware.elf  :
section           size    addr
.text              202   17408
.noinit              2    9216
.vectors           128   65408
.debug_aranges     144       0
.debug_info        882       0
.debug_abbrev      277       0
.debug_line        812       0
.debug_frame        60       0
.debug_str         206       0
.debug_loc          64       0
.debug_macinfo   75105       0
.debug_ranges       12       0
Total            77894
========================= [SUCCESS] Took 0.40 seconds =========================
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: usbmodem141201
MSP430_Initialize: usbmodem141201
Firmware version is 31501001
MSP430_VCC: 3000 mV
Reading symbols from /Users/jose.edil/2-development/ti/pio-workspace/Blink/.pio/build/lpmsp430f5529/firmware.elf...done.
(gdb) MSP430_OpenDevice
MSP430_GetFoundDevice
Device: MSP430F5529 (id = 0x002f)
8 breakpoints available
MSP430_EEM_Init
Chip ID data:
  ver_id:         2955
  ver_sub_id:     0000
  revision:       19
  fab:            55
  self:           5555
  config:         12
Device: MSP430F5529
Bound to port 2000. Now waiting for connection...

it freezes waiting for some input after the mspdebug initialization which might be what is causing VS Code to abandon the debugging process. Pressing enter gives me the (gdb) command line. I had to manually connect to the server, which from the platformIO source code it should be able to automatically do it (if I correctly understood it):

(gdb) target remote :2000
Client connected from 127.0.0.1:51154
Clearing all breakpoints...
Reading    2 bytes from 0x4400
Remote debugging using :2000
_reset_vector__ () at ../../../gcc/gcc/config/msp430/crt0.S:105
	in ../../../gcc/gcc/config/msp430/crt0.S
105	../../../gcc/gcc/config/msp430/crt0.S: No such file or directory.

continue starts the program on the board as supposed to be, but everytime I try to stop to execution with ctrl-c gdb breaks and I can’t debug properly…

(gdb) c
Reading    2 bytes from 0x43fa
Reading    2 bytes from 0x43fc
Reading    2 bytes from 0x43fe
Continuing.
Running
^CMSP430_Run

Program received signal SIGTRAP, Trace/breakpoint trap.
../../../gdb/gdb/thread.c:79: internal-error: inferior_thread: Assertion `tp' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
../../../gdb/gdb/thread.c:79: internal-error: inferior_thread: Assertion `tp' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
Remote connection closed

@maxgerhardt isn’t probably better to take this into some issue tracker?

The problem here is the -Og flag which PlatformIO assumes is interstood by all GCC/G++ compilers for “Optimize Debug”, yet MSP430-G++ seems to be restricted in that regards and doesn’t understand it; there should be -O0 there as the next best thing.

Maybe build_unflags = -Og and build_flags = -O0 in the platformio.ini works?

Actually a solution for that is known in Unable to use mspdebug tool using MSP430G2452 · Issue #15 · platformio/platform-timsp430 · GitHub

Please check Issues · platformio/platform-timsp430 · GitHub for existing issues and comment there or create new issues, it’s the main repository for PlatformIO’s TI MSP430 integration

1 Like