From a48925c9b0044aad0ec023aae3536fdea27b025e Mon Sep 17 00:00:00 2001 From: valeros Date: Thu, 26 Sep 2019 23:39:29 +0300 Subject: [PATCH 1/5] Update energia framework to 1.8.7E21 // Resolves #8, resolves #10, resolves #11, resolves #13 --- boards/lpmsp430f5529.json | 6 ++-- boards/lpmsp430fr2311.json | 41 +++++++++++++++++++++++ boards/lpmsp430fr2433.json | 41 +++++++++++++++++++++++ boards/lpmsp430fr4133.json | 2 +- boards/lpmsp430fr5739.json | 4 +-- boards/lpmsp430fr5969.json | 4 +-- boards/lpmsp430fr5994.json | 41 +++++++++++++++++++++++ boards/lpmsp430fr6989.json | 4 +-- boards/lpmsp430g2231.json | 61 +++++++++++++++++++++++++++++++++++ boards/lpmsp430g2452.json | 61 +++++++++++++++++++++++++++++++++++ boards/lpmsp430g2553.json | 2 +- builder/frameworks/energia.py | 13 ++++++-- builder/main.py | 23 ++++++++++--- platform.json | 9 ++++-- 14 files changed, 292 insertions(+), 20 deletions(-) create mode 100644 boards/lpmsp430fr2311.json create mode 100644 boards/lpmsp430fr2433.json create mode 100644 boards/lpmsp430fr5994.json create mode 100644 boards/lpmsp430g2231.json create mode 100644 boards/lpmsp430g2452.json diff --git a/boards/lpmsp430f5529.json b/boards/lpmsp430f5529.json index c82e1a2..c0c1374 100644 --- a/boards/lpmsp430f5529.json +++ b/boards/lpmsp430f5529.json @@ -2,7 +2,7 @@ "build": { "core": "msp430", "extra_flags": "-DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430F5529LP", - "f_cpu": "16000000L", + "f_cpu": "25000000L", "hwids": [ [ "0x2341", @@ -33,8 +33,8 @@ "name": "TI LaunchPad MSP-EXP430F5529LP", "upload": { "maximum_ram_size": 8192, - "maximum_size": 131072, - "protocol": "tilib" + "maximum_size": 48128, + "protocol": "dslite" }, "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430f5529lp.html", "vendor": "TI" diff --git a/boards/lpmsp430fr2311.json b/boards/lpmsp430fr2311.json new file mode 100644 index 0000000..9243dbe --- /dev/null +++ b/boards/lpmsp430fr2311.json @@ -0,0 +1,41 @@ +{ + "build": { + "core": "msp430", + "extra_flags": "-DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430FR2311LP", + "f_cpu": "16000000L", + "hwids": [ + [ + "0x2341", + "0x0c9f" + ] + ], + "mcu": "msp430fr2311", + "variant": "MSP-EXP430FR2311LP" + }, + "debug": { + "tools": { + "mspdebug": { + "onboard": true, + "server": { + "arguments": [ + "$UPLOAD_PROTOCOL", + "gdb" + ], + "executable": "mspdebug", + "package": "tool-mspdebug" + } + } + } + }, + "frameworks": [ + "arduino" + ], + "name": "TI LaunchPad MSP-EXP430FR2311LP", + "upload": { + "maximum_ram_size": 1024, + "maximum_size": 3840, + "protocol": "dslite" + }, + "url": "http://www.ti.com/product/MSP430FR2311", + "vendor": "TI" +} diff --git a/boards/lpmsp430fr2433.json b/boards/lpmsp430fr2433.json new file mode 100644 index 0000000..ac390cb --- /dev/null +++ b/boards/lpmsp430fr2433.json @@ -0,0 +1,41 @@ +{ + "build": { + "core": "msp430", + "extra_flags": "-DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430FR2433LP", + "f_cpu": "8000000L", + "hwids": [ + [ + "0x2341", + "0x0c9f" + ] + ], + "mcu": "msp430fr2433", + "variant": "MSP-EXP430FR2433LP" + }, + "debug": { + "tools": { + "mspdebug": { + "onboard": true, + "server": { + "arguments": [ + "$UPLOAD_PROTOCOL", + "gdb" + ], + "executable": "mspdebug", + "package": "tool-mspdebug" + } + } + } + }, + "frameworks": [ + "arduino" + ], + "name": "TI LaunchPad MSP-EXP430FR2433LP", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 15360, + "protocol": "dslite" + }, + "url": "http://www.ti.com/product/MSP430FR2433", + "vendor": "TI" +} diff --git a/boards/lpmsp430fr4133.json b/boards/lpmsp430fr4133.json index e833bbb..c664090 100644 --- a/boards/lpmsp430fr4133.json +++ b/boards/lpmsp430fr4133.json @@ -34,7 +34,7 @@ "upload": { "maximum_ram_size": 2048, "maximum_size": 15360, - "protocol": "tilib" + "protocol": "dslite" }, "url": "http://www.ti.com/tool/msp-exp430fr4133", "vendor": "TI" diff --git a/boards/lpmsp430fr5739.json b/boards/lpmsp430fr5739.json index 394ed84..cf91bd2 100644 --- a/boards/lpmsp430fr5739.json +++ b/boards/lpmsp430fr5739.json @@ -52,8 +52,8 @@ ], "name": "TI FraunchPad MSP-EXP430FR5739LP", "upload": { - "maximum_ram_size": 512, - "maximum_size": 16384, + "maximum_ram_size": 1024, + "maximum_size": 15743, "protocol": "rf2500" }, "url": "http://www.ti.com/tool/msp-exp430fr5739", diff --git a/boards/lpmsp430fr5969.json b/boards/lpmsp430fr5969.json index 23d5051..0467be9 100644 --- a/boards/lpmsp430fr5969.json +++ b/boards/lpmsp430fr5969.json @@ -33,8 +33,8 @@ "name": "TI LaunchPad MSP-EXP430FR5969LP", "upload": { "maximum_ram_size": 2048, - "maximum_size": 65536, - "protocol": "tilib" + "maximum_size": 48128, + "protocol": "dslite" }, "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430fr5969.html", "vendor": "TI" diff --git a/boards/lpmsp430fr5994.json b/boards/lpmsp430fr5994.json new file mode 100644 index 0000000..301789e --- /dev/null +++ b/boards/lpmsp430fr5994.json @@ -0,0 +1,41 @@ +{ + "build": { + "core": "msp430", + "extra_flags": "-DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430FR5994LP", + "f_cpu": "16000000L", + "hwids": [ + [ + "0x2341", + "0x0c9f" + ] + ], + "mcu": "msp430fr5994", + "variant": "MSP-EXP430FR5994LP" + }, + "debug": { + "tools": { + "mspdebug": { + "onboard": true, + "server": { + "arguments": [ + "$UPLOAD_PROTOCOL", + "gdb" + ], + "executable": "mspdebug", + "package": "tool-mspdebug" + } + } + } + }, + "frameworks": [ + "arduino" + ], + "name": "TI LaunchPad MSP-EXP430FR5994LP", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 262144, + "protocol": "dslite" + }, + "url": "http://www.ti.com/product/MSP430FR5994", + "vendor": "TI" +} diff --git a/boards/lpmsp430fr6989.json b/boards/lpmsp430fr6989.json index 6d87f36..799bbdb 100644 --- a/boards/lpmsp430fr6989.json +++ b/boards/lpmsp430fr6989.json @@ -33,8 +33,8 @@ "name": "TI LaunchPad MSP-EXP430FR6989LP", "upload": { "maximum_ram_size": 2048, - "maximum_size": 130048, - "protocol": "tilib" + "maximum_size": 48128, + "protocol": "dslite" }, "url": "http://www.ti.com/tool/msp-exp430fr6989", "vendor": "TI" diff --git a/boards/lpmsp430g2231.json b/boards/lpmsp430g2231.json new file mode 100644 index 0000000..14e7fe1 --- /dev/null +++ b/boards/lpmsp430g2231.json @@ -0,0 +1,61 @@ +{ + "build": { + "core": "msp430", + "extra_flags": "-DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430G2231LP", + "f_cpu": "1000000L", + "hwids": [ + [ + "0x2341", + "0x0c9f" + ] + ], + "mcu": "msp430g2231", + "variant": "MSP-EXP430G2231LP" + }, + "debug": { + "tools": { + "mspdebug": { + "onboard": true, + "server": [ + { + "arguments": [ + "tilib", + "gdb" + ], + "executable": "mspdebug", + "package": "tool-mspdebug", + "system": [ + "windows", + "windows_amd64", + "windows_x86" + ] + }, + { + "arguments": [ + "$UPLOAD_PROTOCOL", + "gdb" + ], + "executable": "mspdebug", + "package": "tool-mspdebug", + "system": [ + "darwin_x86_64", + "linux_i686", + "linux_x86_64" + ] + } + ] + } + } + }, + "frameworks": [ + "arduino" + ], + "name": "TI LaunchPad MSP-EXP430G2 w/ MSP430G2231", + "upload": { + "maximum_ram_size": 256, + "maximum_size": 2048, + "protocol": "rf2500" + }, + "url": "http://www.ti.com/product/MSP430G2231", + "vendor": "TI" +} diff --git a/boards/lpmsp430g2452.json b/boards/lpmsp430g2452.json new file mode 100644 index 0000000..de111cd --- /dev/null +++ b/boards/lpmsp430g2452.json @@ -0,0 +1,61 @@ +{ + "build": { + "core": "msp430", + "extra_flags": "-DENERGIA_ARCH_MSP430 -DENERGIA_MSP_EXP430G2452LP", + "f_cpu": "16000000L", + "hwids": [ + [ + "0x2341", + "0x0c9f" + ] + ], + "mcu": "msp430g2452", + "variant": "MSP-EXP430G2452LP" + }, + "debug": { + "tools": { + "mspdebug": { + "onboard": true, + "server": [ + { + "arguments": [ + "tilib", + "gdb" + ], + "executable": "mspdebug", + "package": "tool-mspdebug", + "system": [ + "windows", + "windows_amd64", + "windows_x86" + ] + }, + { + "arguments": [ + "$UPLOAD_PROTOCOL", + "gdb" + ], + "executable": "mspdebug", + "package": "tool-mspdebug", + "system": [ + "darwin_x86_64", + "linux_i686", + "linux_x86_64" + ] + } + ] + } + } + }, + "frameworks": [ + "arduino" + ], + "name": "TI LaunchPad MSP-EXP430G2 w/ MSP430G2452", + "upload": { + "maximum_ram_size": 256, + "maximum_size": 8192, + "protocol": "rf2500" + }, + "url": "http://www.ti.com/product/MSP430G2452", + "vendor": "TI" +} diff --git a/boards/lpmsp430g2553.json b/boards/lpmsp430g2553.json index f3fb1db..dd97b29 100644 --- a/boards/lpmsp430g2553.json +++ b/boards/lpmsp430g2553.json @@ -54,7 +54,7 @@ "upload": { "maximum_ram_size": 512, "maximum_size": 16384, - "protocol": "rf2500" + "protocol": "dslite" }, "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430g2.html", "vendor": "TI" diff --git a/builder/frameworks/energia.py b/builder/frameworks/energia.py index ebe6547..8ea2563 100644 --- a/builder/frameworks/energia.py +++ b/builder/frameworks/energia.py @@ -35,16 +35,23 @@ FRAMEWORK_VERSION = platform.get_package_version("framework-energiamsp430") assert isdir(FRAMEWORK_DIR) +board = env.BoardConfig() + +variants_dir = join( + "$PROJECT_DIR", board.get("build.variants_dir")) if board.get( + "build.variants_dir", "") else join(FRAMEWORK_DIR, "variants") env.Append( CPPDEFINES=[ - ("ARDUINO", 10805), + ("ARDUINO", 10807), ("ENERGIA", int(FRAMEWORK_VERSION.split(".")[1])) ], CPPPATH=[ join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")), - join(FRAMEWORK_DIR, "variants", env.BoardConfig().get("build.variant")) + join(variants_dir, board.get("build.variant")), + join(platform.get_package_version( + "toolchain-timsp430"), "msp430", "include") ], LIBSOURCE_DIRS=[ @@ -60,7 +67,7 @@ libs.append(env.BuildLibrary( join("$BUILD_DIR", "FrameworkEnergia"), - join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) + join(FRAMEWORK_DIR, "cores", board.get("build.core")) )) env.Append(LIBS=libs) diff --git a/builder/main.py b/builder/main.py index 18a571f..1aa7e18 100644 --- a/builder/main.py +++ b/builder/main.py @@ -36,7 +36,7 @@ PIODEBUGFLAGS=["-O0", "-g3", "-ggdb", "-gdwarf-2"], - SIZEPROGREGEXP=r"^(?:\.text|\.data|\.bootloader)\s+(\d+).*", + SIZEPROGREGEXP=r"^(?:\.text|\.data|\.rodata|\.vectors)\s+([0-9]+).*", SIZEDATAREGEXP=r"^(?:\.data|\.bss|\.noinit)\s+(\d+).*", SIZECHECKCMD="$SIZETOOL -A -d $SOURCES", SIZEPRINTCMD='$SIZETOOL -B -d $SOURCES', @@ -55,7 +55,7 @@ ASFLAGS=["-x", "assembler-with-cpp"], CCFLAGS=[ - "-O2", + "-Os", "-ffunction-sections", # place each function in its own section "-fdata-sections", "-mmcu=$BOARD_MCU" @@ -71,7 +71,7 @@ ], LINKFLAGS=[ - "-O2", + "-Os", "-mmcu=$BOARD_MCU", "-Wl,-gc-sections,-u,main" ], @@ -136,7 +136,22 @@ # Target: Upload firmware # -target_upload = env.Alias("upload", target_firm, +upload_target = target_firm +if env.subst("$UPLOAD_PROTOCOL") == "dslite": + env.Replace( + UPLOADER=join(env.PioPlatform().get_package_dir( + "tool-dslite") or "", "DebugServer", "bin", "DSLite"), + UPLOADERFLAGS=[ + "load", "-c", + join(env.PioPlatform().get_package_dir("tool-dslite") or "", + "%s.ccxml" % env.BoardConfig().get("build.variant")), "-f" + ], + UPLOADCMD="$UPLOADER $UPLOADERFLAGS $SOURCES" + ) + upload_target = target_elf + upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")] + +target_upload = env.Alias("upload", upload_target, env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")) AlwaysBuild(target_upload) diff --git a/platform.json b/platform.json index c31733e..d2e1191 100644 --- a/platform.json +++ b/platform.json @@ -35,12 +35,17 @@ "framework-energiamsp430": { "type": "framework", "optional": true, - "version": "1.10610.0" + "version": "1.10807.0" }, "tool-mspdebug": { "type": "uploader", "optional": true, - "version": "~1.2200.0" + "version": "~1.2400.0" + }, + "tool-dslite": { + "type": "uploader", + "optional": true, + "version": "~1.80200.1400" } } } From 78bb0ebc64482ce00f762f2ef432adeea5c8e01e Mon Sep 17 00:00:00 2001 From: valeros Date: Fri, 27 Sep 2019 00:11:29 +0300 Subject: [PATCH 2/5] Fix framework version --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index d2e1191..355c91c 100644 --- a/platform.json +++ b/platform.json @@ -35,7 +35,7 @@ "framework-energiamsp430": { "type": "framework", "optional": true, - "version": "1.10807.0" + "version": "~1.10807.0" }, "tool-mspdebug": { "type": "uploader", From 198385e400170be2408a0defc16cb25ae6e14214 Mon Sep 17 00:00:00 2001 From: valeros Date: Fri, 27 Sep 2019 00:21:44 +0300 Subject: [PATCH 3/5] Fix incorrect path to toolchain includes --- builder/frameworks/energia.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/frameworks/energia.py b/builder/frameworks/energia.py index 8ea2563..e205225 100644 --- a/builder/frameworks/energia.py +++ b/builder/frameworks/energia.py @@ -50,7 +50,7 @@ CPPPATH=[ join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")), join(variants_dir, board.get("build.variant")), - join(platform.get_package_version( + join(platform.get_package_dir( "toolchain-timsp430"), "msp430", "include") ], From ac7d75b7a83d1780e363907709dddbca4e7487dd Mon Sep 17 00:00:00 2001 From: valeros Date: Fri, 27 Sep 2019 11:53:28 +0300 Subject: [PATCH 4/5] Use the latest possible toolchain --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 355c91c..34a9d17 100644 --- a/platform.json +++ b/platform.json @@ -30,7 +30,7 @@ "packages": { "toolchain-timsp430": { "type": "toolchain", - "version": "~1.40603.0" + "version": "~1.40603.190926" }, "framework-energiamsp430": { "type": "framework", From a2d234d22e0e3cbffbec6b294dec5ff5f244fa5d Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 21 Oct 2019 15:20:15 +0300 Subject: [PATCH 5/5] Bump version to 2.2.0 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 34a9d17..cb70c7f 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/platformio/platform-timsp430.git" }, - "version": "2.1.0", + "version": "2.2.0", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json"