diff --git a/builder/frameworks/_bare_arm.py b/builder/frameworks/_bare_arm.py index cc62592..277d58d 100644 --- a/builder/frameworks/_bare_arm.py +++ b/builder/frameworks/_bare_arm.py @@ -34,8 +34,7 @@ "-ffunction-sections", # place each function in its own section "-fdata-sections", "-mthumb", - "-nostdlib", - "-fsingle-precision-constant" + "-nostdlib" ], CXXFLAGS=[ @@ -56,8 +55,7 @@ "-Os", "-Wl,--gc-sections,--relax", "-mthumb", - "-Wl,--defsym=__rtc_localtime=$UNIX_TIME", - "-fsingle-precision-constant" + "-Wl,--defsym=__rtc_localtime=$UNIX_TIME" ], LIBS=["m", "stdc++"] @@ -91,3 +89,17 @@ "-mcpu=%s" % env.BoardConfig().get("build.cpu") ] ) + +if env.BoardConfig().get("build.core", "") != "teensy4": + env.Append( + ASFLAGS=[ + "-mno-unaligned-access", + ], + CCFLAGS=[ + "-mno-unaligned-access", + "-fsingle-precision-constant" + ], + LINKFLAGS=[ + "-fsingle-precision-constant" + ] + ) diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index 58111bb..3cafc98 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -145,8 +145,7 @@ "-fdata-sections", "-mthumb", "-mcpu=%s" % env.BoardConfig().get("build.cpu"), - "-nostdlib", - "-fsingle-precision-constant" + "-nostdlib" ], CXXFLAGS=[ diff --git a/examples/arduino-blink/.gitignore b/examples/arduino-blink/.gitignore index 6c69f4c..03f4a3c 100644 --- a/examples/arduino-blink/.gitignore +++ b/examples/arduino-blink/.gitignore @@ -1,2 +1 @@ -.pioenvs -.piolibdeps +.pio diff --git a/examples/arduino-blink/platformio.ini b/examples/arduino-blink/platformio.ini index 84d9b90..0b58105 100644 --- a/examples/arduino-blink/platformio.ini +++ b/examples/arduino-blink/platformio.ini @@ -12,7 +12,7 @@ platform = teensy framework = arduino board = teensy2 -[env:teensy 2pp] +[env:teensy2pp] platform = teensy framework = arduino board = teensy2pp diff --git a/examples/arduino-hid-usb-mouse/.gitignore b/examples/arduino-hid-usb-mouse/.gitignore index 6c69f4c..03f4a3c 100644 --- a/examples/arduino-hid-usb-mouse/.gitignore +++ b/examples/arduino-hid-usb-mouse/.gitignore @@ -1,2 +1 @@ -.pioenvs -.piolibdeps +.pio diff --git a/examples/arduino-internal-libs/.gitignore b/examples/arduino-internal-libs/.gitignore index 6c69f4c..03f4a3c 100644 --- a/examples/arduino-internal-libs/.gitignore +++ b/examples/arduino-internal-libs/.gitignore @@ -1,2 +1 @@ -.pioenvs -.piolibdeps +.pio diff --git a/examples/mbed-blink/.gitignore b/examples/mbed-blink/.gitignore index 6c69f4c..03f4a3c 100644 --- a/examples/mbed-blink/.gitignore +++ b/examples/mbed-blink/.gitignore @@ -1,2 +1 @@ -.pioenvs -.piolibdeps +.pio diff --git a/examples/mbed-dsp/.gitignore b/examples/mbed-dsp/.gitignore index 6c69f4c..03f4a3c 100644 --- a/examples/mbed-dsp/.gitignore +++ b/examples/mbed-dsp/.gitignore @@ -1,2 +1 @@ -.pioenvs -.piolibdeps +.pio diff --git a/examples/mbed-events/.gitignore b/examples/mbed-events/.gitignore index 6c69f4c..03f4a3c 100644 --- a/examples/mbed-events/.gitignore +++ b/examples/mbed-events/.gitignore @@ -1,2 +1 @@ -.pioenvs -.piolibdeps +.pio diff --git a/examples/mbed-events/platformio.ini b/examples/mbed-events/platformio.ini index 79a2239..e888ac2 100644 --- a/examples/mbed-events/platformio.ini +++ b/examples/mbed-events/platformio.ini @@ -7,7 +7,7 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html -[env:teensy31 events] +[env:teensy31] platform = teensy framework = mbed board = teensy31 diff --git a/examples/mbed-serial/.gitignore b/examples/mbed-serial/.gitignore index 6c69f4c..03f4a3c 100644 --- a/examples/mbed-serial/.gitignore +++ b/examples/mbed-serial/.gitignore @@ -1,2 +1 @@ -.pioenvs -.piolibdeps +.pio diff --git a/platform.json b/platform.json index 7e13e41..f883723 100644 --- a/platform.json +++ b/platform.json @@ -19,7 +19,7 @@ "type": "git", "url": "https://github.com/platformio/platform-teensy.git" }, - "version": "4.17.0", + "version": "4.18.0", "frameworks": { "arduino": { "package": "framework-arduinoteensy", @@ -43,16 +43,22 @@ "optionalVersions": [">=1.60301.0,<1.80000.0"] }, "toolchain-gccarmnoneeabi": { + "type": "toolchain", + "optional": true, + "owner": "platformio", + "version": "~1.80201.0" + }, + "toolchain-gccarmnoneeabi-teensy": { "type": "toolchain", "optional": false, "owner": "platformio", - "version": "~1.50401.0" + "version": "~1.110301.0" }, "framework-arduinoteensy": { "type": "framework", "optional": true, "owner": "platformio", - "version": "~1.157.0" + "version": "~1.158.0" }, "framework-mbed": { "type": "framework", diff --git a/platform.py b/platform.py index 1e04d35..b85b655 100644 --- a/platform.py +++ b/platform.py @@ -32,16 +32,18 @@ def configure_default_packages(self, variables, targets): del self.packages[del_toolchain] frameworks = variables.get("pioframework", []) - if "mbed" in frameworks: - self.packages["toolchain-gccarmnoneeabi"][ - "version"] = ">=1.60301.0,<1.80000.0" - elif "zephyr" in frameworks: + if "arduino" in frameworks: + self.packages.pop("toolchain-gccarmnoneeabi", None) + else: + self.packages["toolchain-gccarmnoneeabi"]["optional"] = False + self.packages.pop("toolchain-gccarmnoneeabi-teensy", None) + + if "zephyr" in frameworks: for p in self.packages: if p in ("tool-cmake", "tool-dtc", "tool-ninja"): self.packages[p]["optional"] = False if not IS_WINDOWS: self.packages["tool-gperf"]["optional"] = False - self.packages["toolchain-gccarmnoneeabi"]["version"] = "~1.80201.0" elif "arduino" in frameworks and board_config.get("build.core", "") == "teensy4": self.packages["tool-teensy"]["optional"] = False