diff --git a/README.md b/README.md index a554e5e..b1f0690 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,28 @@ MSP430 microcontrollers (MCUs) from Texas Instruments (TI) are 16-bit, RISC-base # Usage -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) -2. Install TI MSP430 development platform: -```bash -# install the latest stable version -> platformio platform install timsp430 - -# install development version -> platformio platform install https://github.com/platformio/platform-timsp430.git +1. [Install PlatformIO](http://platformio.org) +2. Create PlatformIO project and configure a platform option in [platformio.ini](http://docs.platformio.org/page/projectconf.html) file: + +## Stable version + +```ini +[env:stable] +platform = timsp430 +board = ... +... +``` + +## Development version + +```ini +[env:development] +platform = https://github.com/platformio/platform-timsp430.git +board = ... +... ``` + +# Configuration + +Please navigate to [documentation](http://docs.platformio.org/page/platforms/timsp430.html). + diff --git a/boards/lpmsp430f5529.json b/boards/lpmsp430f5529.json index bc67ea5..6964020 100644 --- a/boards/lpmsp430f5529.json +++ b/boards/lpmsp430f5529.json @@ -38,4 +38,4 @@ }, "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430f5529lp.html", "vendor": "TI" -} \ No newline at end of file +} diff --git a/boards/lpmsp430fr4133.json b/boards/lpmsp430fr4133.json index 74034c9..ce95faf 100644 --- a/boards/lpmsp430fr4133.json +++ b/boards/lpmsp430fr4133.json @@ -3,13 +3,13 @@ "core": "msp430", "extra_flags": "-DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430FR4133LP", "f_cpu": "8000000L", - "mcu": "msp430fr4133", "hwids": [ [ "0x2341", "0x0c9f" ] ], + "mcu": "msp430fr4133", "variant": "MSP-EXP430FR4133LP" }, "debug": { @@ -38,4 +38,4 @@ }, "url": "http://www.ti.com/tool/msp-exp430fr4133", "vendor": "TI" -} \ No newline at end of file +} diff --git a/boards/lpmsp430fr5739.json b/boards/lpmsp430fr5739.json index f467b98..86d2906 100644 --- a/boards/lpmsp430fr5739.json +++ b/boards/lpmsp430fr5739.json @@ -3,13 +3,13 @@ "core": "msp430", "extra_flags": "-DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430FR5739LP", "f_cpu": "16000000L", - "mcu": "msp430fr5739", "hwids": [ [ "0x2341", "0x0c9f" ] ], + "mcu": "msp430fr5739", "variant": "MSP-EXP430FR5739LP" }, "debug": { @@ -58,4 +58,4 @@ }, "url": "http://www.ti.com/tool/msp-exp430fr5739", "vendor": "TI" -} \ No newline at end of file +} diff --git a/boards/lpmsp430fr5969.json b/boards/lpmsp430fr5969.json index a82e904..c90f30b 100644 --- a/boards/lpmsp430fr5969.json +++ b/boards/lpmsp430fr5969.json @@ -3,13 +3,13 @@ "core": "msp430", "extra_flags": "-DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430FR5969LP", "f_cpu": "8000000L", - "mcu": "msp430fr5969", "hwids": [ [ "0x2341", "0x0c9f" ] ], + "mcu": "msp430fr5969", "variant": "MSP-EXP430FR5969LP" }, "debug": { @@ -38,4 +38,4 @@ }, "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430fr5969.html", "vendor": "TI" -} \ No newline at end of file +} diff --git a/boards/lpmsp430fr6989.json b/boards/lpmsp430fr6989.json index 48e91da..1db14d9 100644 --- a/boards/lpmsp430fr6989.json +++ b/boards/lpmsp430fr6989.json @@ -3,13 +3,13 @@ "core": "msp430", "extra_flags": "-DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430FR6989LP", "f_cpu": "8000000L", - "mcu": "msp430fr6989", "hwids": [ [ "0x2341", "0x0c9f" ] ], + "mcu": "msp430fr6989", "variant": "MSP-EXP430FR6989LP" }, "debug": { @@ -38,4 +38,4 @@ }, "url": "http://www.ti.com/tool/msp-exp430fr6989", "vendor": "TI" -} \ No newline at end of file +} diff --git a/boards/lpmsp430g2553.json b/boards/lpmsp430g2553.json index aa9d413..ddadcfa 100644 --- a/boards/lpmsp430g2553.json +++ b/boards/lpmsp430g2553.json @@ -58,4 +58,4 @@ }, "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430g2.html", "vendor": "TI" -} \ No newline at end of file +} diff --git a/boards/panStampNRG.json b/boards/panStampNRG.json index 5a4d988..3c58d49 100644 --- a/boards/panStampNRG.json +++ b/boards/panStampNRG.json @@ -1,19 +1,19 @@ { "build": { - "core": "panstamp", - "f_cpu": "12000000L", - "mcu": "cc430f5137", + "core": "panstamp", + "f_cpu": "12000000L", + "mcu": "cc430f5137", "variant": "panstamp_nrg_1.1" - }, + }, "frameworks": [ "arduino" - ], - "name": "PanStamp NRG 1.1", + ], + "name": "PanStamp NRG 1.1", "upload": { - "maximum_ram_size": 4096, - "maximum_size": 32640, + "maximum_ram_size": 4096, + "maximum_size": 32640, "protocol": "flash-bsl" - }, - "url": "http://www.panstamp.com/product/197/", + }, + "url": "http://www.panstamp.com/product/197/", "vendor": "PanStamp" -} \ No newline at end of file +} diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index 2c4c3a1..02db739 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -30,11 +30,10 @@ platform = env.PioPlatform() FRAMEWORK_DIR = platform.get_package_dir("framework-arduinomsp430") -FRAMEWORK_VERSION = platform.get_package_version("framework-arduinomsp430") assert isdir(FRAMEWORK_DIR) env.Append( - CPPDEFINES=[("ARDUINO", int(FRAMEWORK_VERSION.split(".")[1]))], + CPPDEFINES=[("ARDUINO", 10805)], CPPPATH=[ join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) @@ -63,9 +62,7 @@ join(FRAMEWORK_DIR, "variants", env.BoardConfig().get("build.variant")) )) -envsafe = env.Clone() - -libs.append(envsafe.BuildLibrary( +libs.append(env.BuildLibrary( join("$BUILD_DIR", "FrameworkArduino"), join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) )) diff --git a/builder/frameworks/energia.py b/builder/frameworks/energia.py index 267f807..29eb4d6 100644 --- a/builder/frameworks/energia.py +++ b/builder/frameworks/energia.py @@ -37,7 +37,7 @@ env.Append( CPPDEFINES=[ - ("ARDUINO", 10610), + ("ARDUINO", 10805), ("ENERGIA", int(FRAMEWORK_VERSION.split(".")[1])) ], diff --git a/builder/main.py b/builder/main.py index 7a901a7..1accbb7 100644 --- a/builder/main.py +++ b/builder/main.py @@ -35,7 +35,6 @@ ASFLAGS=["-x", "assembler-with-cpp"], CCFLAGS=[ - "-g", # include debugging info (so errors include line numbers) "-O2", "-ffunction-sections", # place each function in its own section "-fdata-sections", @@ -71,7 +70,6 @@ ], UPLOADCMD='$UPLOADER $UPLOADERFLAGS "prog $SOURCES"', - PROGNAME="firmware", PROGSUFFIX=".elf" ) @@ -94,16 +92,20 @@ ) ) +# Allow user to override via pre:script +if env.get("PROGNAME", "program") == "program": + env.Replace(PROGNAME="firmware") + # # Target: Build executable and linkable firmware # target_elf = None if "nobuild" in COMMAND_LINE_TARGETS: - target_firm = join("$BUILD_DIR", "firmware.hex") + target_firm = join("$BUILD_DIR", "${PROGNAME}.hex") else: target_elf = env.BuildProgram() - target_firm = env.ElfToHex(join("$BUILD_DIR", "firmware"), target_elf) + target_firm = env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf) AlwaysBuild(env.Alias("nobuild", target_firm)) target_buildprog = env.Alias("buildprog", target_firm, target_firm) diff --git a/platform.json b/platform.json index a448028..134a6e0 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/platformio/platform-timsp430.git" }, - "version": "2.0.3", + "version": "2.0.4", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json"