From dda86edd18ae559e1817499c3f5810374e5c6980 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 21 Dec 2018 17:11:23 +0200 Subject: [PATCH 1/5] Fix warning about "Unknown upload protocol custom" --- builder/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/main.py b/builder/main.py index b46dba3..1b5a026 100644 --- a/builder/main.py +++ b/builder/main.py @@ -226,7 +226,7 @@ def _jlink_cmd_script(env, source): upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")] # custom upload tool -elif "UPLOADCMD" in env: +elif upload_protocol == "custom": upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")] else: From 5a9cbef05ba4f5d78df2e1826e84ce51f91bddac Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 27 Dec 2018 02:48:52 +0200 Subject: [PATCH 2/5] Text examples with Python 3 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 968775e..16bf220 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: python python: - "2.7" + - "3.5" env: - PLATFORMIO_PROJECT_DIR=examples/arduino-blink From 81c0ebf24ee63f748acd0a8431c844cd280b85c3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 29 Jan 2019 22:30:18 +0200 Subject: [PATCH 3/5] Use Python 3.6 for Travis.CI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 16bf220..d1d421b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python python: - "2.7" - - "3.5" + - "3.6" env: - PLATFORMIO_PROJECT_DIR=examples/arduino-blink From 48c8dc7a748a8947bb02db22f6c4efdd5ebfa3b0 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 31 Jan 2019 16:42:05 +0200 Subject: [PATCH 4/5] Allow to control firmware optimization // Resolve #43 --- builder/frameworks/arduino.py | 65 +++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index 7938f9b..e65a4b3 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -116,7 +116,6 @@ ASFLAGS=["-x", "assembler-with-cpp"], CCFLAGS=[ - "-Os", # optimize for size "-Wall", # show warnings "-ffunction-sections", # place each function in its own section "-fdata-sections", @@ -142,7 +141,6 @@ RANLIBFLAGS=["-s"], LINKFLAGS=[ - "-Os", "-Wl,--gc-sections,--relax", "-mthumb", "-mcpu=%s" % env.BoardConfig().get("build.cpu"), @@ -166,6 +164,69 @@ ] ) + # Optimization + if "TEENSY_OPT_FASTER_LTO" in env['CPPDEFINES']: + env.Append( + CCFLAGS=["-O2", "-flto", "-fno-fat-lto-objects"], + LINKFLAGS=["-O2", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"] + ) + elif "TEENSY_OPT_FAST" in env['CPPDEFINES']: + env.Append( + CCFLAGS=["-O1"], + LINKFLAGS=["-O1"] + ) + elif "TEENSY_OPT_FAST_LTO" in env['CPPDEFINES']: + env.Append( + CCFLAGS=["-O1", "-flto", "-fno-fat-lto-objects"], + LINKFLAGS=["-O1", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"] + ) + elif "TEENSY_OPT_FASTEST" in env['CPPDEFINES']: + env.Append( + CCFLAGS=["-O3"], + LINKFLAGS=["-O3"] + ) + elif "TEENSY_OPT_FASTEST_LTO" in env['CPPDEFINES']: + env.Append( + CCFLAGS=["-O3", "-flto", "-fno-fat-lto-objects"], + LINKFLAGS=["-O3", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"] + ) + elif "TEENSY_OPT_FASTEST_PURE_CODE" in env['CPPDEFINES']: + env.Append( + CCFLAGS=["-O3", "-mpure-code"], + CPPDEFINES=["__PURE_CODE__"], + LINKFLAGS=["-O3", "-mpure-code"] + ) + elif "TEENSY_OPT_FASTEST_PURE_CODE_LTO" in env['CPPDEFINES']: + env.Append( + CCFLAGS=["-O3", "-mpure-code", "-flto", "-fno-fat-lto-objects"], + CPPDEFINES=["__PURE_CODE__"], + LINKFLAGS=["-O3", "-mpure-code", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"] + ) + elif "TEENSY_OPT_DEBUG" in env['CPPDEFINES']: + env.Append( + CCFLAGS=["-g", "-Og"], + LINKFLAGS=["-g", "-Og"] + ) + elif "TEENSY_OPT_DEBUG_LTO" in env['CPPDEFINES']: + env.Append( + CCFLAGS=["-g", "-Og", "-flto", "-fno-fat-lto-objects"], + LINKFLAGS=["-g", "-Og", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"] + ) + elif "TEENSY_OPT_SMALLEST_CODE" in env['CPPDEFINES']: + env.Append( + CCFLAGS=["-Os", "--specs=nano.specs"], + LINKFLAGS=["-Os", "--specs=nano.specs"] + ) + elif "TEENSY_OPT_SMALLEST_CODE_LTO" in env['CPPDEFINES']: + env.Append( + CCFLAGS=["-Os", "--specs=nano.specs", "-flto", "-fno-fat-lto-objects"], + LINKFLAGS=["-Os", "--specs=nano.specs", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"] + ) + # TEENSY_OPT_FASTER + else: + env.Append(CCFLAGS=["-O2"], LINKFLAGS=["-O2"]) + + env.Append( ASFLAGS=env.get("CCFLAGS", [])[:] ) From a058f034c9ac20154a867d93cd173fe9592e8c7f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 31 Jan 2019 18:35:44 +0200 Subject: [PATCH 5/5] Bump version to 3.7.1 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 8a3d94d..13d3a45 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/platformio/platform-teensy.git" }, - "version": "3.7.0", + "version": "3.7.1", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json"