diff --git a/boards/adafruit_circuitplayground_m0.json b/boards/adafruit_circuitplayground_m0.json index 6c5538c9..4f712167 100644 --- a/boards/adafruit_circuitplayground_m0.json +++ b/boards/adafruit_circuitplayground_m0.json @@ -26,9 +26,10 @@ "package": "tool-openocd", "executable": "bin/openocd", "arguments": [ - "-f", "scripts/interface/cmsis-dap.cfg", + "-s", "$PACKAGE_DIR/scripts", + "-f", "interface/cmsis-dap.cfg", "-c", "set CHIPNAME at91samd21g18; set ENDIAN little; set telnet_port 0", - "-f", "scripts/target/at91samdXX.cfg" + "-f", "target/at91samdXX.cfg" ] }, "load_cmd": "preload" diff --git a/boards/adafruit_feather_m0.json b/boards/adafruit_feather_m0.json index c1fbaf00..a353cf2f 100644 --- a/boards/adafruit_feather_m0.json +++ b/boards/adafruit_feather_m0.json @@ -2,7 +2,7 @@ "build": { "core": "adafruit", "system": "samd", - "extra_flags": "-D__SAMD21G18A__ -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DARDUINO_SAMD_FEATHER_M0 -lsamd21_qtouch_gcc", + "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DARDUINO_SAMD_FEATHER_M0 -D__SAMD21G18A__", "cpu": "cortex-m0plus", "f_cpu": "48000000L", "hwids": [ @@ -27,9 +27,10 @@ "package": "tool-openocd", "executable": "bin/openocd", "arguments": [ - "-f", "scripts/interface/cmsis-dap.cfg", + "-s", "$PACKAGE_DIR/scripts", + "-f", "interface/cmsis-dap.cfg", "-c", "set CHIPNAME at91samd21g18; set ENDIAN little; set telnet_port 0", - "-f", "scripts/target/at91samdXX.cfg" + "-f", "target/at91samdXX.cfg" ] }, "load_cmd": "preload" diff --git a/boards/adafruit_feather_m0_express.json b/boards/adafruit_feather_m0_express.json index 5d742b77..f4dc9aa4 100644 --- a/boards/adafruit_feather_m0_express.json +++ b/boards/adafruit_feather_m0_express.json @@ -2,7 +2,7 @@ "build": { "core": "adafruit", "system": "samd", - "extra_flags": "-D__SAMD21G18A__ -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DARDUINO_SAMD_FEATHER_M0 -DARDUINO_SAMD_FEATHER_M0_EXPRESS -lsamd21_qtouch_gcc", + "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DARDUINO_SAMD_FEATHER_M0 -DARDUINO_SAMD_FEATHER_M0_EXPRESS -D__SAMD21G18A__", "cpu": "cortex-m0plus", "f_cpu": "48000000L", "hwids": [ diff --git a/boards/adafruit_gemma_m0.json b/boards/adafruit_gemma_m0.json new file mode 100644 index 00000000..0aad4ee2 --- /dev/null +++ b/boards/adafruit_gemma_m0.json @@ -0,0 +1,39 @@ +{ + "build": { + "core": "adafruit", + "system": "samd", + "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_GEMMA_M0 -DCRYSTALLESS -DADAFRUIT_GEMMA_M0 -D__SAMD21E18A__", + "cpu": "cortex-m0plus", + "f_cpu": "48000000L", + "hwids": [ + [ + "0x239A", + "0x801C" + ], + [ + "0x239A", + "0x001C" + ] + ], + "ldscript": "flash_with_bootloader.ld", + "mcu": "samd21e18a", + "usb_product": "Adafruit Gemma M0", + "variant": "gemma_m0" + }, + "frameworks": [ + "arduino" + ], + "name": "Adafruit Gemma M0", + "upload": { + "disable_flushing": true, + "maximum_ram_size": 32768, + "maximum_size": 262144, + "native_usb": true, + "protocol": "sam-ba", + "require_upload_port": true, + "use_1200bps_touch": true, + "wait_for_upload_port": true + }, + "url": "https://www.adafruit.com/product/3501", + "vendor": "Adafruit" +} diff --git a/boards/adafruit_metro_m0.json b/boards/adafruit_metro_m0.json index 9b59f88c..9f3bbc60 100644 --- a/boards/adafruit_metro_m0.json +++ b/boards/adafruit_metro_m0.json @@ -2,7 +2,7 @@ "build": { "core": "adafruit", "system": "samd", - "extra_flags": "-D__SAMD21G18A__ -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DDADAFRUIT_METRO_M0_EXPRESS -lsamd21_qtouch_gcc", + "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DDADAFRUIT_METRO_M0_EXPRESS -D__SAMD21G18A__", "cpu": "cortex-m0plus", "f_cpu": "48000000L", "hwids": [ @@ -27,9 +27,10 @@ "package": "tool-openocd", "executable": "bin/openocd", "arguments": [ - "-f", "scripts/interface/cmsis-dap.cfg", + "-s", "$PACKAGE_DIR/scripts", + "-f", "interface/cmsis-dap.cfg", "-c", "set CHIPNAME at91samd21g18; set ENDIAN little; set telnet_port 0", - "-f", "scripts/target/at91samdXX.cfg" + "-f", "target/at91samdXX.cfg" ] }, "load_cmd": "preload" diff --git a/boards/adafruit_trinket_m0.json b/boards/adafruit_trinket_m0.json new file mode 100644 index 00000000..9643da61 --- /dev/null +++ b/boards/adafruit_trinket_m0.json @@ -0,0 +1,39 @@ +{ + "build": { + "core": "adafruit", + "system": "samd", + "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_TRINKET_M0 -DCRYSTALLESS -DADAFRUIT_TRINKET_M0 -D__SAMD21E18A__", + "cpu": "cortex-m0plus", + "f_cpu": "48000000L", + "hwids": [ + [ + "0x239A", + "0x801E" + ], + [ + "0x239A", + "0x001E" + ] + ], + "ldscript": "flash_with_bootloader.ld", + "mcu": "samd21e18a", + "usb_product": "Adafruit Trinket M0", + "variant": "trinket_m0" + }, + "frameworks": [ + "arduino" + ], + "name": "Adafruit Trinket M0", + "upload": { + "disable_flushing": true, + "maximum_ram_size": 32768, + "maximum_size": 262144, + "native_usb": true, + "protocol": "sam-ba", + "require_upload_port": true, + "use_1200bps_touch": true, + "wait_for_upload_port": true + }, + "url": "https://www.adafruit.com/product/3500", + "vendor": "Adafruit" +} diff --git a/boards/due.json b/boards/due.json index 8f9f3f02..58e2426e 100644 --- a/boards/due.json +++ b/boards/due.json @@ -41,6 +41,6 @@ "use_1200bps_touch": true, "wait_for_upload_port": false }, - "url": "http://www.arduino.org/products/boards/4-arduino-boards/arduino-due", + "url": "https://www.arduino.cc/en/Main/ArduinoBoardDue", "vendor": "Arduino" } \ No newline at end of file diff --git a/boards/dueUSB.json b/boards/dueUSB.json index d56b52c5..b75c59dc 100644 --- a/boards/dueUSB.json +++ b/boards/dueUSB.json @@ -37,6 +37,6 @@ "use_1200bps_touch": true, "wait_for_upload_port": true }, - "url": "http://www.arduino.org/products/boards/4-arduino-boards/arduino-due", + "url": "https://www.arduino.cc/en/Main/ArduinoBoardDue", "vendor": "Arduino" } \ No newline at end of file diff --git a/boards/mkr1000USB.json b/boards/mkr1000USB.json index 2874f1f4..607d3616 100644 --- a/boards/mkr1000USB.json +++ b/boards/mkr1000USB.json @@ -37,9 +37,10 @@ "package": "tool-openocd", "executable": "bin/openocd", "arguments": [ - "-f", "scripts/interface/cmsis-dap.cfg", + "-s", "$PACKAGE_DIR/scripts", + "-f", "interface/cmsis-dap.cfg", "-c", "set CHIPNAME at91samd21g18; set ENDIAN little; set telnet_port 0", - "-f", "scripts/target/at91samdXX.cfg" + "-f", "target/at91samdXX.cfg" ] }, "load_cmd": "preload" diff --git a/boards/mzeroUSB.json b/boards/mzeroUSB.json index f91d68bc..7650ad69 100644 --- a/boards/mzeroUSB.json +++ b/boards/mzeroUSB.json @@ -26,9 +26,10 @@ "package": "tool-openocd", "executable": "bin/openocd", "arguments": [ - "-f", "scripts/interface/cmsis-dap.cfg", + "-s", "$PACKAGE_DIR/scripts", + "-f", "interface/cmsis-dap.cfg", "-c", "set CHIPNAME at91samd21g18; set ENDIAN little; set telnet_port 0", - "-f", "scripts/target/at91samdXX.cfg" + "-f", "target/at91samdXX.cfg" ] }, "load_cmd": "mon program \"$PROG_DIR/firmware.bin\" 0x4000" @@ -58,6 +59,6 @@ "use_1200bps_touch": true, "wait_for_upload_port": true }, - "url": "http://www.arduino.org/products/boards/arduino-m0", + "url": "https://www.arduino.cc/en/Main/ArduinoBoardM0", "vendor": "Arduino" } \ No newline at end of file diff --git a/boards/mzeropro.json b/boards/mzeropro.json index 92b4e578..f2956cf3 100644 --- a/boards/mzeropro.json +++ b/boards/mzeropro.json @@ -26,9 +26,10 @@ "package": "tool-openocd", "executable": "bin/openocd", "arguments": [ - "-f", "scripts/interface/cmsis-dap.cfg", + "-s", "$PACKAGE_DIR/scripts", + "-f", "interface/cmsis-dap.cfg", "-c", "set CHIPNAME at91samd21g18; set ENDIAN little; set telnet_port 0", - "-f", "scripts/target/at91samdXX.cfg" + "-f", "target/at91samdXX.cfg" ] }, "load_cmd": "mon program \"$PROG_DIR/firmware.bin\" 0x4000", @@ -51,6 +52,6 @@ "use_1200bps_touch": false, "wait_for_upload_port": false }, - "url": "http://www.arduino.org/products/boards/arduino-m0-pro", + "url": "https://www.arduino.cc/en/Main/ArduinoBoardM0PRO", "vendor": "Arduino" } \ No newline at end of file diff --git a/boards/mzeroproUSB.json b/boards/mzeroproUSB.json index 76915b28..43fdbbca 100644 --- a/boards/mzeroproUSB.json +++ b/boards/mzeroproUSB.json @@ -41,6 +41,6 @@ "use_1200bps_touch": true, "wait_for_upload_port": true }, - "url": "http://www.arduino.org/products/boards/arduino-m0-pro", + "url": "https://www.arduino.cc/en/Main/ArduinoBoardM0PRO", "vendor": "Arduino" } \ No newline at end of file diff --git a/boards/samd21g18a.json b/boards/samd21g18a.json index 9e99d537..fc7fb403 100644 --- a/boards/samd21g18a.json +++ b/boards/samd21g18a.json @@ -11,9 +11,10 @@ "package": "tool-openocd", "executable": "bin/openocd", "arguments": [ - "-f", "scripts/interface/cmsis-dap.cfg", - "-c", "set CHIPNAME at91samd21g18", - "-f", "scripts/target/at91samdXX.cfg" + "-s", "$PACKAGE_DIR/scripts", + "-f", "interface/cmsis-dap.cfg", + "-c", "set CHIPNAME at91samd21g18;", + "-f", "target/at91samdXX.cfg" ] }, "onboard": true diff --git a/boards/sparkfun_samd21_dev_usb.json b/boards/sparkfun_samd21_dev_usb.json index c2e92504..c63406f5 100644 --- a/boards/sparkfun_samd21_dev_usb.json +++ b/boards/sparkfun_samd21_dev_usb.json @@ -26,9 +26,10 @@ "package": "tool-openocd", "executable": "bin/openocd", "arguments": [ - "-f", "scripts/interface/cmsis-dap.cfg", + "-s", "$PACKAGE_DIR/scripts", + "-f", "interface/cmsis-dap.cfg", "-c", "set CHIPNAME at91samd21g18; set ENDIAN little; set telnet_port 0", - "-f", "scripts/target/at91samdXX.cfg" + "-f", "target/at91samdXX.cfg" ] }, "load_cmd": "preload" diff --git a/boards/sparkfun_samd21_mini_usb.json b/boards/sparkfun_samd21_mini_usb.json index b41f434a..e066c34e 100644 --- a/boards/sparkfun_samd21_mini_usb.json +++ b/boards/sparkfun_samd21_mini_usb.json @@ -26,9 +26,10 @@ "package": "tool-openocd", "executable": "bin/openocd", "arguments": [ - "-f", "scripts/interface/cmsis-dap.cfg", + "-s", "$PACKAGE_DIR/scripts", + "-f", "interface/cmsis-dap.cfg", "-c", "set CHIPNAME at91samd21g18; set ENDIAN little; set telnet_port 0", - "-f", "scripts/target/at91samdXX.cfg" + "-f", "target/at91samdXX.cfg" ] }, "load_cmd": "preload" diff --git a/boards/tian.json b/boards/tian.json index e96b2740..0127c815 100644 --- a/boards/tian.json +++ b/boards/tian.json @@ -36,6 +36,6 @@ "use_1200bps_touch": true, "wait_for_upload_port": true }, - "url": "http://www.arduino.org/products/boards/arduino-tian", + "url": "https://www.arduino.cc/en/Main/ArduinoBoardTian", "vendor": "Arduino" } \ No newline at end of file diff --git a/boards/zero.json b/boards/zero.json index 14fe4384..90013875 100644 --- a/boards/zero.json +++ b/boards/zero.json @@ -26,12 +26,13 @@ "package": "tool-openocd", "executable": "bin/openocd", "arguments": [ - "-f", "scripts/interface/cmsis-dap.cfg", + "-s", "$PACKAGE_DIR/scripts", + "-f", "interface/cmsis-dap.cfg", "-c", "set CHIPNAME at91samd21g18; set ENDIAN little; set telnet_port 0", - "-f", "scripts/target/at91samdXX.cfg" + "-f", "target/at91samdXX.cfg" ] }, - "load_cmd": "preload", + "load_cmd": "mon program \"$PROG_DIR/firmware.bin\" 0x2000", "onboard": true } } diff --git a/builder/main.py b/builder/main.py index a22ac239..15c8f25b 100644 --- a/builder/main.py +++ b/builder/main.py @@ -57,7 +57,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 RANLIB="arm-none-eabi-ranlib", SIZETOOL="arm-none-eabi-size", - ARFLAGS=["rcs"], + ARFLAGS=["rc"], ASFLAGS=["-x", "assembler-with-cpp"], @@ -155,8 +155,6 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 UPLOADERFLAGS=[ "-s", join(platform.get_package_dir("tool-openocd") or "", "scripts"), - "-s", join(platform.get_package_dir("tool-openocd") or "", - "scripts", "board"), "-f", join(env.BoardConfig().get("upload.openocdcfg", "")) ], @@ -213,7 +211,8 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 "avrdude.conf"), "-c", "$UPLOAD_PROTOCOL", "-P", '"$UPLOAD_PORT"', - "-b", "$UPLOAD_SPEED" + "-b", "$UPLOAD_SPEED", + "-u" ], UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS -U flash:w:$SOURCES:i' diff --git a/examples/arduino-blink/platformio.ini b/examples/arduino-blink/platformio.ini index 97629e05..d9abed19 100644 --- a/examples/arduino-blink/platformio.ini +++ b/examples/arduino-blink/platformio.ini @@ -7,10 +7,10 @@ ; Please visit documentation for the other options and examples ; http://docs.platformio.org/page/projectconf.html -[env:adafruit_circuitplayground_m0] +[env:adafruit_gemma_m0] platform = atmelsam framework = arduino -board = adafruit_circuitplayground_m0 +board = adafruit_gemma_m0 [env:adafruit_feather_m0] platform = atmelsam @@ -47,11 +47,6 @@ platform = atmelsam framework = arduino board = mzeropro -[env:mzeroproUSB] -platform = atmelsam -framework = arduino -board = mzeroproUSB - [env:mzeroUSB] platform = atmelsam framework = arduino diff --git a/examples/arduino-external-libs/platformio.ini b/examples/arduino-external-libs/platformio.ini index 97629e05..d9abed19 100644 --- a/examples/arduino-external-libs/platformio.ini +++ b/examples/arduino-external-libs/platformio.ini @@ -7,10 +7,10 @@ ; Please visit documentation for the other options and examples ; http://docs.platformio.org/page/projectconf.html -[env:adafruit_circuitplayground_m0] +[env:adafruit_gemma_m0] platform = atmelsam framework = arduino -board = adafruit_circuitplayground_m0 +board = adafruit_gemma_m0 [env:adafruit_feather_m0] platform = atmelsam @@ -47,11 +47,6 @@ platform = atmelsam framework = arduino board = mzeropro -[env:mzeroproUSB] -platform = atmelsam -framework = arduino -board = mzeroproUSB - [env:mzeroUSB] platform = atmelsam framework = arduino diff --git a/examples/arduino-internal-libs/platformio.ini b/examples/arduino-internal-libs/platformio.ini index 97629e05..d9abed19 100644 --- a/examples/arduino-internal-libs/platformio.ini +++ b/examples/arduino-internal-libs/platformio.ini @@ -7,10 +7,10 @@ ; Please visit documentation for the other options and examples ; http://docs.platformio.org/page/projectconf.html -[env:adafruit_circuitplayground_m0] +[env:adafruit_gemma_m0] platform = atmelsam framework = arduino -board = adafruit_circuitplayground_m0 +board = adafruit_gemma_m0 [env:adafruit_feather_m0] platform = atmelsam @@ -47,11 +47,6 @@ platform = atmelsam framework = arduino board = mzeropro -[env:mzeroproUSB] -platform = atmelsam -framework = arduino -board = mzeroproUSB - [env:mzeroUSB] platform = atmelsam framework = arduino diff --git a/platform.json b/platform.json index 7ee67626..48c08f36 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/platformio/platform-atmelsam.git" }, - "version": "2.5.0", + "version": "2.6.0", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json", @@ -40,12 +40,12 @@ "framework-arduinosam": { "type": "framework", "optional": true, - "version": "~2.10615.0" + "version": "~2.10616.0" }, "framework-mbed": { "type": "framework", "optional": true, - "version": "~4.149.0" + "version": "~4.150.0" }, "framework-simba": { "type": "framework", @@ -65,7 +65,7 @@ "tool-openocd": { "type": "uploader", "optional": true, - "version": "~1.1000.0" + "version": "~1.900.2" } } } diff --git a/platform.py b/platform.py index a8929592..2e5c1592 100644 --- a/platform.py +++ b/platform.py @@ -37,11 +37,10 @@ def configure_default_packages(self, variables, targets): continue if name != upload_tool: del self.packages[name] - + if "mbed" in variables.get("pioframework", []): self.packages["toolchain-gccarmnoneeabi"][ 'version'] = ">=1.60301.0" - return PlatformBase.configure_default_packages(self, variables, targets)