From d0ce0769549f62aa1502aa34a8058b27b80c399f Mon Sep 17 00:00:00 2001 From: valeros Date: Mon, 2 Sep 2019 13:09:47 +0300 Subject: [PATCH 1/5] Don't use TinyUSB stack by default with Adafruit core // Resolve #67, Resolve #69 --- builder/frameworks/arduino.py | 1 - 1 file changed, 1 deletion(-) diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index e56eb2df..eef60b6c 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -153,7 +153,6 @@ if BUILD_CORE == "adafruit": env.Append( - CPPDEFINES=["USE_TINYUSB"], CPPPATH=[ join(FRAMEWORK_DIR, "cores", BUILD_CORE, "Adafruit_TinyUSB_Core"), From a9e43b7a8d4d6cb9c87c2d03df36e3a5e27ce770 Mon Sep 17 00:00:00 2001 From: valeros Date: Mon, 2 Sep 2019 13:50:52 +0300 Subject: [PATCH 2/5] Remove redundant extra flag from samd21g18a manifest --- boards/samd21g18a.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/samd21g18a.json b/boards/samd21g18a.json index b1f09c82..01541d2e 100644 --- a/boards/samd21g18a.json +++ b/boards/samd21g18a.json @@ -2,7 +2,7 @@ "build": { "core": "samd", "cpu": "cortex-m0plus", - "extra_flags": "-DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -D__SAMD21G18A__", + "extra_flags": "-DARDUINO_ARCH_SAMD -D__SAMD21G18A__", "f_cpu": "48000000L", "hwids": [ [ From 714f30735a5a4d5405f87b6bef36992e42f30af9 Mon Sep 17 00:00:00 2001 From: valeros Date: Wed, 11 Sep 2019 12:29:11 +0300 Subject: [PATCH 3/5] Use the latest tool-bossac only with Adafruit boards based on samd51 // Resolve #77 --- builder/main.py | 9 ++++++--- platform.py | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/builder/main.py b/builder/main.py index 45aff7bd..d42b3bf1 100644 --- a/builder/main.py +++ b/builder/main.py @@ -207,10 +207,13 @@ def _jlink_cmd_script(env, source): ], UPLOADCMD="$UPLOADER $UPLOADERFLAGS $SOURCES" ) - if board.get("build.core") == "adafruit": + if board.get("build.core") == "adafruit" and board.get( + "build.mcu").startswith("samd51"): + # special flags for the latest bossac tool env.Append( - UPLOADERFLAGS=["-U", "--offset", - board.get("upload.offset_address")]) + UPLOADERFLAGS=[ + "-U", "--offset", board.get("upload.offset_address")]) + else: env.Append(UPLOADERFLAGS=[ "--erase", diff --git a/platform.py b/platform.py index 70fdfe3c..8f21b88b 100644 --- a/platform.py +++ b/platform.py @@ -49,7 +49,8 @@ def configure_default_packages(self, variables, targets): self.packages["toolchain-gccarmnoneeabi"][ 'version'] = ">=1.40803.0,<1.40805.0" if (board.get("build.core", "") == "adafruit" - and "tool-bossac" in self.packages): + and "tool-bossac" in self.packages + and board.get("build.mcu", "").startswith("samd51")): self.packages["tool-bossac"]['version'] = "~1.10900.0" for name in disabled_pkgs: From efeae7c896cf14fd19a15b7fc265a93c63b78f0e Mon Sep 17 00:00:00 2001 From: valeros Date: Wed, 11 Sep 2019 12:57:39 +0300 Subject: [PATCH 4/5] Allow specifying custom variants directory // Issue #74 --- builder/frameworks/arduino.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index eef60b6c..415a95c7 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -94,14 +94,18 @@ "-Wl,--warn-section-align" ], - LIBPATH=[ - join(FRAMEWORK_DIR, "variants", - board.get("build.variant"), "linker_scripts", "gcc") - ], - LIBS=["m"] ) +variants_dir = join( + "$PROJECT_DIR", board.get("build.variants_dir")) if board.get( + "build.variants_dir", "") else join(FRAMEWORK_DIR, "variants") + +env.Append( + LIBPATH=[ + join(variants_dir, board.get("build.variant"), "linker_scripts", "gcc") + ]) + if "BOARD" in env: env.Append( CCFLAGS=[ @@ -129,8 +133,7 @@ LIBPATH=[ join(SYSTEM_DIR, "CMSIS", "CMSIS", "Lib", "GCC"), - join(FRAMEWORK_DIR, "variants", - board.get("build.variant")) + join(variants_dir, board.get("build.variant")) ] ) @@ -170,7 +173,7 @@ ], LIBPATH=[ - join(FRAMEWORK_DIR, "variants", board.get("build.variant")) + join(variants_dir, board.get("build.variant")) ], LINKFLAGS=[ @@ -207,11 +210,11 @@ if "build.variant" in env.BoardConfig(): env.Append( - CPPPATH=[join(FRAMEWORK_DIR, "variants", board.get("build.variant"))] + CPPPATH=[join(variants_dir, board.get("build.variant"))] ) libs.append(env.BuildLibrary( join("$BUILD_DIR", "FrameworkArduinoVariant"), - join(FRAMEWORK_DIR, "variants", board.get("build.variant")) + join(variants_dir, board.get("build.variant")) )) libs.append(env.BuildLibrary( From 30d801c46f6dfc466fbfd934e3b891d21e89b45c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 23 Sep 2019 10:28:49 +0300 Subject: [PATCH 5/5] Bump version to 3.8.1 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index dccdcdf4..f084f080 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/platformio/platform-atmelsam.git" }, - "version": "3.8.0", + "version": "3.8.1", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json",