platformio / platform-timsp430

TI MSP430: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/timsp430
Apache License 2.0
18 stars 16 forks source link

Add TI MSP430 Launchpad Support #9

Open mrdrwest opened 5 years ago

mrdrwest commented 5 years ago

Please add support for the TI MSP430 Launchpads.

The MSP-EXP430G2 and MSP-EXP430G2ET Launchpads do not work with PIO VSCode extension v1.4.0 / PIO 3.6.1rc2

Attempts to upload code results in the following error: Firmware version is 30403004tilib: MSP430_VCC: Could not set device Vcc (error = 10)MSP430_VCC: 3000 mV

TheNoim commented 2 years ago

Sad. Our university uses this and now I am forced to use some other tool and not platform io. I tried to configure it by myself. I ended up with the ability to upload via platform io, but I am not able to debug the code.

This is what I tried. I created a new board definiton:

{
  "build": {
    "core": "msp430",
    "extra_flags": "-DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430G2ET2553LP",
    "f_cpu": "16000000L",
    "hwids": [
      [
        "0x2341",
        "0x0c9f"
      ]
    ],
    "mcu": "msp430g2553",
    "variant": "MSP-EXP430G2ET2553LP"
  },
  "debug": {
    "tools": {
      "mspdebug": {
        "onboard": true,
        "server": [
          {
            "arguments": [
              "tilib",
              "gdb"
            ],
            "executable": "mspdebug",
            "package": "tool-mspdebug",
            "system": [
              "windows",
              "windows_amd64",
              "windows_x86",
              "darwin_x86_64",
              "linux_i686",
              "linux_x86_64"
            ]
          }
        ]
      }
    }
  },
  "frameworks": [
    "arduino"
  ],
  "name": "TI LaunchPad MSP-EXP430G2ET w/ MSP430G2553",
  "upload": {
    "maximum_ram_size": 512,
    "maximum_size": 16384,
    "protocol": "dslite"
  },
  "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430g2.html",
  "vendor": "TI"
}

And copied the dslite version from Energia.

EDIT: OMG, I was finally able to get it to work. I downloaded MSP Debug Stack Developers Package from https://www.ti.com/tool/MSPDS#downloads and used the libmsp430.dylib from there (I put it to /usr/local/lib/libmsp430.dylib). Then I compiled mspdebug with make CFLAGS=-DDEBUG_GDB and replaced the binary in .platformio/packages/tool-mspdebug/. I also installed the MSP FET driver and run mspdebug tilib --allow-fw-update once to update the firmware.

I hope I didn't forget any step, because this is already a long night.

Now I simply can use a project with

[env:lpmsp430get2553]
platform = timsp430
board = lpmsp430get2553
board_build.mcu = msp430g2553
board_build.f_cpu = 16000000L