diff --git a/.travis.yml b/.travis.yml index 3ed1568..957d2cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ env: - PLATFORMIO_PROJECT_DIR=examples/arduino-external-libs - PLATFORMIO_PROJECT_DIR=examples/arduino-internal-libs - PLATFORMIO_PROJECT_DIR=examples/arduino-web-thing-led + - PLATFORMIO_PROJECT_DIR=examples/cmsis-blink - PLATFORMIO_PROJECT_DIR=examples/mbed-blink - PLATFORMIO_PROJECT_DIR=examples/mbed-dsp # - PLATFORMIO_PROJECT_DIR=examples/mbed-events diff --git a/appveyor.yml b/appveyor.yml index d43fcf4..39671f0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,6 +6,7 @@ environment: - PLATFORMIO_PROJECT_DIR: "examples/arduino-external-libs" - PLATFORMIO_PROJECT_DIR: "examples/arduino-internal-libs" - PLATFORMIO_PROJECT_DIR: "examples/arduino-web-thing-led" + - PLATFORMIO_PROJECT_DIR: "examples/cmsis-blink" - PLATFORMIO_PROJECT_DIR: "examples/mbed-blink" - PLATFORMIO_PROJECT_DIR: "examples/mbed-dsp" # - PLATFORMIO_PROJECT_DIR: "examples/mbed-events" diff --git a/boards/adafruit_circuitplayground_m0.json b/boards/adafruit_circuitplayground_m0.json index 1555637..4ad35fb 100644 --- a/boards/adafruit_circuitplayground_m0.json +++ b/boards/adafruit_circuitplayground_m0.json @@ -27,7 +27,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Circuit Playground Express", "upload": { diff --git a/boards/adafruit_crickit_m0.json b/boards/adafruit_crickit_m0.json index 18b9f91..1115780 100644 --- a/boards/adafruit_crickit_m0.json +++ b/boards/adafruit_crickit_m0.json @@ -27,7 +27,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Crickit M0", "upload": { diff --git a/boards/adafruit_feather_m0.json b/boards/adafruit_feather_m0.json index 2d7368f..77babd8 100644 --- a/boards/adafruit_feather_m0.json +++ b/boards/adafruit_feather_m0.json @@ -31,7 +31,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Feather M0", "upload": { diff --git a/boards/adafruit_feather_m0_express.json b/boards/adafruit_feather_m0_express.json index 545bf5a..d4bc53d 100644 --- a/boards/adafruit_feather_m0_express.json +++ b/boards/adafruit_feather_m0_express.json @@ -27,7 +27,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Feather M0 Express", "upload": { diff --git a/boards/adafruit_feather_m4.json b/boards/adafruit_feather_m4.json index cdb08ba..445706f 100644 --- a/boards/adafruit_feather_m4.json +++ b/boards/adafruit_feather_m4.json @@ -41,7 +41,8 @@ "svd_path": "ATSAMD51J19A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Feather M4 Express", "upload": { diff --git a/boards/adafruit_gemma_m0.json b/boards/adafruit_gemma_m0.json index c95e200..07da62c 100644 --- a/boards/adafruit_gemma_m0.json +++ b/boards/adafruit_gemma_m0.json @@ -27,7 +27,8 @@ "svd_path": "ATSAMD21E18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Gemma M0", "upload": { diff --git a/boards/adafruit_grandcentral_m4.json b/boards/adafruit_grandcentral_m4.json index 92243fb..9a6878a 100644 --- a/boards/adafruit_grandcentral_m4.json +++ b/boards/adafruit_grandcentral_m4.json @@ -37,7 +37,8 @@ "svd_path": "ATSAMD51P20A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Grand Central M4", "upload": { diff --git a/boards/adafruit_hallowing.json b/boards/adafruit_hallowing.json index 07b4564..b64951e 100644 --- a/boards/adafruit_hallowing.json +++ b/boards/adafruit_hallowing.json @@ -27,7 +27,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Hallowing M0", "upload": { diff --git a/boards/adafruit_hallowing_m4.json b/boards/adafruit_hallowing_m4.json index ee502f2..5c0c768 100644 --- a/boards/adafruit_hallowing_m4.json +++ b/boards/adafruit_hallowing_m4.json @@ -42,7 +42,8 @@ "svd_path": "ATSAMD51J19A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Hallowing M4", "upload": { diff --git a/boards/adafruit_itsybitsy_m0.json b/boards/adafruit_itsybitsy_m0.json index ff09877..1e5fbac 100644 --- a/boards/adafruit_itsybitsy_m0.json +++ b/boards/adafruit_itsybitsy_m0.json @@ -27,7 +27,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit ItsyBitsy M0", "upload": { diff --git a/boards/adafruit_itsybitsy_m4.json b/boards/adafruit_itsybitsy_m4.json index a87304b..b7ed218 100644 --- a/boards/adafruit_itsybitsy_m4.json +++ b/boards/adafruit_itsybitsy_m4.json @@ -38,7 +38,8 @@ "svd_path": "ATSAMD51G19A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit ItsyBitsy M4", "upload": { diff --git a/boards/adafruit_metro_m0.json b/boards/adafruit_metro_m0.json index 03cc2cc..9378cd9 100644 --- a/boards/adafruit_metro_m0.json +++ b/boards/adafruit_metro_m0.json @@ -27,7 +27,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Metro M0 Expresss", "upload": { diff --git a/boards/adafruit_metro_m4.json b/boards/adafruit_metro_m4.json index 7e4727f..9e94616 100644 --- a/boards/adafruit_metro_m4.json +++ b/boards/adafruit_metro_m4.json @@ -37,7 +37,8 @@ "svd_path": "ATSAMD51J19A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Metro M4", "upload": { diff --git a/boards/adafruit_metro_m4_airliftlite.json b/boards/adafruit_metro_m4_airliftlite.json index 3eb9c49..580e140 100644 --- a/boards/adafruit_metro_m4_airliftlite.json +++ b/boards/adafruit_metro_m4_airliftlite.json @@ -37,7 +37,8 @@ "svd_path": "ATSAMD51J19A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Metro M4 AirLift Lite", "upload": { diff --git a/boards/adafruit_monster_m4sk.json b/boards/adafruit_monster_m4sk.json index 271f404..4fdb618 100644 --- a/boards/adafruit_monster_m4sk.json +++ b/boards/adafruit_monster_m4sk.json @@ -42,7 +42,8 @@ "svd_path": "ATSAMD51J19A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit MONSTER M4SK", "upload": { diff --git a/boards/adafruit_pirkey.json b/boards/adafruit_pirkey.json index add885d..31a6bad 100644 --- a/boards/adafruit_pirkey.json +++ b/boards/adafruit_pirkey.json @@ -27,7 +27,8 @@ "svd_path": "ATSAMD21E18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit pIRkey", "upload": { diff --git a/boards/adafruit_pybadge_airlift_m4.json b/boards/adafruit_pybadge_airlift_m4.json index 3c4de90..56a0351 100644 --- a/boards/adafruit_pybadge_airlift_m4.json +++ b/boards/adafruit_pybadge_airlift_m4.json @@ -38,7 +38,8 @@ "svd_path": "ATSAMD51J20A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit pyBadge AirLift M4", "upload": { diff --git a/boards/adafruit_pybadge_m4.json b/boards/adafruit_pybadge_m4.json index c966b90..e3629b2 100644 --- a/boards/adafruit_pybadge_m4.json +++ b/boards/adafruit_pybadge_m4.json @@ -38,7 +38,8 @@ "svd_path": "ATSAMD51J19A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit pyBadge M4 Express", "upload": { diff --git a/boards/adafruit_pygamer_advance_m4.json b/boards/adafruit_pygamer_advance_m4.json index d16ed9f..8092bdc 100644 --- a/boards/adafruit_pygamer_advance_m4.json +++ b/boards/adafruit_pygamer_advance_m4.json @@ -38,7 +38,8 @@ "svd_path": "ATSAMD51J20A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit PyGamer Advance M4", "upload": { diff --git a/boards/adafruit_pygamer_m4.json b/boards/adafruit_pygamer_m4.json index 63a3bd9..50c2e14 100644 --- a/boards/adafruit_pygamer_m4.json +++ b/boards/adafruit_pygamer_m4.json @@ -38,7 +38,8 @@ "svd_path": "ATSAMD51J19A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit PyGamer M4 Express", "upload": { diff --git a/boards/adafruit_pyportal_m4.json b/boards/adafruit_pyportal_m4.json index e32fa94..a0b8b02 100644 --- a/boards/adafruit_pyportal_m4.json +++ b/boards/adafruit_pyportal_m4.json @@ -38,7 +38,8 @@ "svd_path": "ATSAMD51J20A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit PyPortal M4", "upload": { diff --git a/boards/adafruit_trellis_m4.json b/boards/adafruit_trellis_m4.json index 4a63158..1ff20f3 100644 --- a/boards/adafruit_trellis_m4.json +++ b/boards/adafruit_trellis_m4.json @@ -37,7 +37,8 @@ "svd_path": "ATSAMD51J19A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Trellis M4", "upload": { diff --git a/boards/adafruit_trinket_m0.json b/boards/adafruit_trinket_m0.json index 64187f8..949fcf4 100644 --- a/boards/adafruit_trinket_m0.json +++ b/boards/adafruit_trinket_m0.json @@ -27,7 +27,8 @@ "svd_path": "ATSAMD21E18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Adafruit Trinket M0", "upload": { diff --git a/boards/current_ranger.json b/boards/current_ranger.json index fb9fbcd..6106cc8 100644 --- a/boards/current_ranger.json +++ b/boards/current_ranger.json @@ -20,7 +20,8 @@ "variant": "current_ranger" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "LowPowerLab CurrentRanger", "upload": { diff --git a/boards/digix.json b/boards/digix.json index 32001a5..6540d76 100644 --- a/boards/digix.json +++ b/boards/digix.json @@ -25,7 +25,8 @@ "svd_path": "ATSAM3X8E.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Digistump DigiX", "upload": { diff --git a/boards/due.json b/boards/due.json index 21dfdce..4bc2609 100644 --- a/boards/due.json +++ b/boards/due.json @@ -34,6 +34,7 @@ }, "frameworks": [ "arduino", + "cmsis", "simba" ], "name": "Arduino Due (Programming Port)", diff --git a/boards/dueUSB.json b/boards/dueUSB.json index 4bc399e..890a4b6 100644 --- a/boards/dueUSB.json +++ b/boards/dueUSB.json @@ -30,6 +30,7 @@ }, "frameworks": [ "arduino", + "cmsis", "simba" ], "name": "Arduino Due (USB Native Port)", diff --git a/boards/macchina2.json b/boards/macchina2.json index e99c67e..049e665 100644 --- a/boards/macchina2.json +++ b/boards/macchina2.json @@ -29,7 +29,8 @@ "svd_path": "ATSAM3X8E.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Macchina M2", "upload": { diff --git a/boards/minitronics20.json b/boards/minitronics20.json index 0754181..94efd38 100644 --- a/boards/minitronics20.json +++ b/boards/minitronics20.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21J18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Minitronics v2.0", "upload": { diff --git a/boards/mkr1000USB.json b/boards/mkr1000USB.json index 4dfeeaf..cc832f9 100644 --- a/boards/mkr1000USB.json +++ b/boards/mkr1000USB.json @@ -37,7 +37,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino MKR1000", "upload": { diff --git a/boards/mkrfox1200.json b/boards/mkrfox1200.json index 865e355..097d56a 100644 --- a/boards/mkrfox1200.json +++ b/boards/mkrfox1200.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino MKR FOX 1200", "upload": { diff --git a/boards/mkrgsm1400.json b/boards/mkrgsm1400.json index 4d790c7..7aab453 100644 --- a/boards/mkrgsm1400.json +++ b/boards/mkrgsm1400.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino MKR GSM 1400", "upload": { diff --git a/boards/mkrnb1500.json b/boards/mkrnb1500.json index 3bc7885..9fb4cf8 100644 --- a/boards/mkrnb1500.json +++ b/boards/mkrnb1500.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino MKR NB 1500", "upload": { diff --git a/boards/mkrvidor4000.json b/boards/mkrvidor4000.json index 6263e1a..c19f450 100644 --- a/boards/mkrvidor4000.json +++ b/boards/mkrvidor4000.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "MKR Vidor 4000", "upload": { diff --git a/boards/mkrwan1300.json b/boards/mkrwan1300.json index 6cea487..4c1c77f 100644 --- a/boards/mkrwan1300.json +++ b/boards/mkrwan1300.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino MKR WAN 1300", "upload": { diff --git a/boards/mkrwifi1010.json b/boards/mkrwifi1010.json index 8ee4711..f71af36 100644 --- a/boards/mkrwifi1010.json +++ b/boards/mkrwifi1010.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino MKR WiFi 1010", "upload": { diff --git a/boards/mkrzero.json b/boards/mkrzero.json index 1558e85..14c0f1b 100644 --- a/boards/mkrzero.json +++ b/boards/mkrzero.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino MKRZERO", "upload": { diff --git a/boards/moteino_zero.json b/boards/moteino_zero.json index 46d6888..a0bfd9b 100644 --- a/boards/moteino_zero.json +++ b/boards/moteino_zero.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Moteino M0", "upload": { diff --git a/boards/mzeroUSB.json b/boards/mzeroUSB.json index b92efef..86f7a90 100644 --- a/boards/mzeroUSB.json +++ b/boards/mzeroUSB.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino M0", "upload": { diff --git a/boards/mzeropro.json b/boards/mzeropro.json index 99cac00..d888b5a 100644 --- a/boards/mzeropro.json +++ b/boards/mzeropro.json @@ -29,7 +29,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino M0 Pro (Programming/Debug Port)", "upload": { diff --git a/boards/mzeroproUSB.json b/boards/mzeroproUSB.json index 93841df..3066bc1 100644 --- a/boards/mzeroproUSB.json +++ b/boards/mzeroproUSB.json @@ -37,7 +37,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino M0 Pro (Native USB Port)", "upload": { diff --git a/boards/nano_33_iot.json b/boards/nano_33_iot.json index d43429c..a6c2ed9 100644 --- a/boards/nano_33_iot.json +++ b/boards/nano_33_iot.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "NANO 33 IoT", "upload": { diff --git a/boards/sainSmartDue.json b/boards/sainSmartDue.json index b309cfa..2f9b5f1 100644 --- a/boards/sainSmartDue.json +++ b/boards/sainSmartDue.json @@ -25,7 +25,8 @@ "svd_path": "ATSAM3X8E.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "SainSmart Due (Programming Port)", "upload": { diff --git a/boards/sainSmartDueUSB.json b/boards/sainSmartDueUSB.json index 61c6e8c..36a608d 100644 --- a/boards/sainSmartDueUSB.json +++ b/boards/sainSmartDueUSB.json @@ -25,7 +25,8 @@ "svd_path": "ATSAM3X8E.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "SainSmart Due (USB Native Port)", "upload": { diff --git a/boards/samd21_xpro.json b/boards/samd21_xpro.json index 5aa14a3..6c8508d 100644 --- a/boards/samd21_xpro.json +++ b/boards/samd21_xpro.json @@ -1,6 +1,7 @@ { "build": { "cpu": "cortex-m0plus", + "extra_flags": "-D__SAMD21J18A__", "f_cpu": "48000000L", "mcu": "samd21j18a" }, @@ -14,6 +15,7 @@ "svd_path": "ATSAMD21J18A.svd" }, "frameworks": [ + "cmsis", "mbed" ], "name": "Atmel SAMD21-XPRO", diff --git a/boards/samd21g18a.json b/boards/samd21g18a.json index 01541d2..2959d47 100644 --- a/boards/samd21g18a.json +++ b/boards/samd21g18a.json @@ -29,6 +29,7 @@ }, "frameworks": [ "arduino", + "cmsis", "mbed" ], "name": "Atmel ATSAMW25-XPRO", diff --git a/boards/saml21_xpro_b.json b/boards/saml21_xpro_b.json index 887e0e6..263f764 100644 --- a/boards/saml21_xpro_b.json +++ b/boards/saml21_xpro_b.json @@ -1,6 +1,7 @@ { "build": { "cpu": "cortex-m0plus", + "extra_flags": "-D__SAML21J18B__", "f_cpu": "48000000L", "mcu": "saml21j18b" }, @@ -14,6 +15,7 @@ "svd_path": "ATSAML21J18B.svd" }, "frameworks": [ + "cmsis", "mbed" ], "name": "Atmel SAML21-XPRO-B", diff --git a/boards/samr21_xpro.json b/boards/samr21_xpro.json index b6715b6..767220a 100644 --- a/boards/samr21_xpro.json +++ b/boards/samr21_xpro.json @@ -1,6 +1,7 @@ { "build": { "cpu": "cortex-m0plus", + "extra_flags": "-D__SAMR21G18A__", "f_cpu": "48000000L", "mcu": "samr21g18a" }, @@ -14,6 +15,7 @@ "svd_path": "ATSAMR21G18A.svd" }, "frameworks": [ + "cmsis", "mbed" ], "name": "Atmel ATSAMR21-XPRO", diff --git a/boards/seeeduino_lorawan.json b/boards/seeeduino_lorawan.json index d8ccd9e..14bbf77 100644 --- a/boards/seeeduino_lorawan.json +++ b/boards/seeeduino_lorawan.json @@ -30,7 +30,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Seeeduino LoRaWAN", "upload": { diff --git a/boards/sodaq_autonomo.json b/boards/sodaq_autonomo.json index dfc8cda..9e64a39 100644 --- a/boards/sodaq_autonomo.json +++ b/boards/sodaq_autonomo.json @@ -27,7 +27,8 @@ "svd_path": "ATSAMD21J18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "SODAQ Autonomo", "upload": { diff --git a/boards/sodaq_explorer.json b/boards/sodaq_explorer.json index 1e73927..c048a84 100644 --- a/boards/sodaq_explorer.json +++ b/boards/sodaq_explorer.json @@ -31,7 +31,8 @@ "svd_path": "ATSAMD21J18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "SODAQ ExpLoRer", "upload": { diff --git a/boards/sodaq_one.json b/boards/sodaq_one.json index 8678dce..acad7d3 100644 --- a/boards/sodaq_one.json +++ b/boards/sodaq_one.json @@ -31,7 +31,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "SODAQ ONE", "upload": { diff --git a/boards/sodaq_sara.json b/boards/sodaq_sara.json index 8fb739b..cbf3690 100644 --- a/boards/sodaq_sara.json +++ b/boards/sodaq_sara.json @@ -31,7 +31,8 @@ "svd_path": "ATSAMD21J18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "SODAQ SARA", "upload": { diff --git a/boards/sodaq_sff.json b/boards/sodaq_sff.json index c7d405d..ce46e85 100644 --- a/boards/sodaq_sff.json +++ b/boards/sodaq_sff.json @@ -31,7 +31,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "SODAQ SFF", "upload": { diff --git a/boards/sparkfun_samd21_dev_usb.json b/boards/sparkfun_samd21_dev_usb.json index a921732..2807570 100644 --- a/boards/sparkfun_samd21_dev_usb.json +++ b/boards/sparkfun_samd21_dev_usb.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "SparkFun SAMD21 Dev Breakout", "upload": { diff --git a/boards/sparkfun_samd21_mini_usb.json b/boards/sparkfun_samd21_mini_usb.json index ad88154..e8aa3db 100644 --- a/boards/sparkfun_samd21_mini_usb.json +++ b/boards/sparkfun_samd21_mini_usb.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "SparkFun SAMD21 Mini Breakout", "upload": { diff --git a/boards/tian.json b/boards/tian.json index 7b62748..f360664 100644 --- a/boards/tian.json +++ b/boards/tian.json @@ -29,7 +29,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino Tian", "upload": { diff --git a/boards/tuinozero96.json b/boards/tuinozero96.json index c1668c2..a628462 100644 --- a/boards/tuinozero96.json +++ b/boards/tuinozero96.json @@ -26,7 +26,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Tuino 096", "upload": { diff --git a/boards/zero.json b/boards/zero.json index 1ea9d2e..51054f7 100644 --- a/boards/zero.json +++ b/boards/zero.json @@ -29,7 +29,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino Zero (Programming/Debug Port)", "upload": { diff --git a/boards/zeroUSB.json b/boards/zeroUSB.json index 560f34b..ca29134 100644 --- a/boards/zeroUSB.json +++ b/boards/zeroUSB.json @@ -33,7 +33,8 @@ "svd_path": "ATSAMD21G18A.svd" }, "frameworks": [ - "arduino" + "arduino", + "cmsis" ], "name": "Arduino Zero (USB Native Port)", "upload": { diff --git a/builder/frameworks/cmsis.py b/builder/frameworks/cmsis.py new file mode 100644 index 0000000..4fb6ee2 --- /dev/null +++ b/builder/frameworks/cmsis.py @@ -0,0 +1,188 @@ +# Copyright 2014-present PlatformIO +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +CMSIS + +The ARM Cortex Microcontroller Software Interface Standard (CMSIS) is a +vendor-independent hardware abstraction layer for the Cortex-M processor +series and specifies debugger interfaces. The CMSIS enables consistent and +simple software interfaces to the processor for interface peripherals, +real-time operating systems, and middleware. It simplifies software +re-use, reducing the learning curve for new microcontroller developers +and cutting the time-to-market for devices. + +http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php +""" + +import sys +import re +from glob import glob +from string import Template +from os.path import isdir, isfile, join, basename + +from SCons.Script import DefaultEnvironment + +env = DefaultEnvironment() +platform = env.PioPlatform() + +env.SConscript("_bare.py") + +PLATFORM_NAME = env.get("PIOPLATFORM") +FRAMEWORK_DIR = platform.get_package_dir("framework-cmsis") +assert isdir(FRAMEWORK_DIR) + +MCU_FAMILY_SELECTORS = { + 'sam3a': r'^sam3a.*$', + 'sam3n': r'^sam3n.*$', + 'sam3s': r'^sam3s[^8]*$', + 'sam3sd8': r'^sam3sd?[8].?$', + 'sam3x': r'^sam3x.*$', + 'sam3u': r'^sam3u.*$', + 'sam3x': r'^(at91)?sam3x.*$', + 'sam4c32': r'^sam4c32.*$', + 'sam4cm32': r'^sam4cm.*32.*$', + 'sam4cm': r'^sam4cm[^3]*$', + 'sam4cp': r'^sam4cp.*$', + 'sam4c': r'^sam4c[^mp3]*$', + 'sam4e': r'^sam4e(.*[ce])?$', + 'sam4ecb': r'^sam4e\d+cb$', + 'sam4l4': r'^sam4l[cs][24][abc]$', + 'sam4l8': r'^sam4l[cs]8[abc]$', + 'sam4n': r'^sam4n.*$', + 'sam4sp': r'^sam4sp.*$', + 'sam4s': r'^sam4s[^p]*$', + 'samb11': r'^samb11$', + 'samc20': r'^samc20[^n]*$', + 'samc20n': r'^samc20n.*$', + 'samc21': r'^samc21[^n]*$', + 'samc21n': r'^samc21n.*$', + 'samd09': r'^samd09.*$', + 'samd10': r'^samd10.*$', + 'samd11': r'^samd11.*$', + 'samd20': r'^samd20[^b]*$', + 'samd21a': r'^samd21.1[5678].*au?$', + 'samd20b': r'^samd20.*b$', + 'samd21b': r'^samd21.*bu$', + 'samd21c': r'^samd21.1[56].*$', + 'samd21d': r'^samd21.17.*$', + 'samd51a': r'^samd51.*$', + 'samda1': r'^samda1.*a$', + 'samda1b': r'^samda1.*b$', + 'same51': r'^same51.*$', + 'same53': r'^same53.*$', + 'same54': r'^same54.*$', + 'same70a': r'^same70[^b]*$', + 'same70b': r'^same70.*b$', + 'samg51': r'^samg51.*$', + 'samg53': r'^samg53.*$', + 'samg54': r'^samg54.*$', + 'samg55': r'^samg55.*$', + 'samha1a': r'^samha1.*a$', + 'samha1ab': r'^samha1.*b$', + 'saml10': r'^saml10.*$', + 'saml11': r'^saml11.*$', + 'saml21a1': r'^saml21.*a$', + 'saml21b': r'^saml21.*bu?$', + 'saml22': r'^saml22.*$', + 'samr21': r'^samr21.*$', + 'samr30': r'^samr30.*$', + 'samr34': r'^samr34.*$', + 'samr35': r'^samr35.*$', + 'sams70a': r'^sams70[^b]+$', + 'sams70b': r'^sams70.*b$', + 'samv70': r'^samv70[^b]+$', + 'samv70b': r'^samv70.*b$', + 'samv71': r'^samv71[^b]+$', + 'samv71b': r'^samv71.*b$', +} + +def get_mcu_family(mcu): + mcu = mcu.lower() + for variant_family, match in MCU_FAMILY_SELECTORS.items(): + if re.match(match, mcu): + return variant_family + + return None + +def get_variant_dir(mcu): + family = get_mcu_family(mcu) + if family: + return join(FRAMEWORK_DIR, "variants", PLATFORM_NAME, family) + + sys.stderr.write( + """Error: There is no variant dir for %s MCU! + Please add initialization code to your project manually!""" % mcu) + env.Exit(1) + +def adjust_linker_offset(script_name, ldscript): + offset_address = env.BoardConfig().get("upload.offset_address", "0") + if int(offset_address, 0)==0: + return ldscript + + content = "" + with open(ldscript) as fp: + content = fp.read() + # original: rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 + # transformed: rom (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00040000-0x2000 + content = re.sub( + r"^(\s*rom.*ORIGIN[^,]+)(,\s*LENGTH.*)$", + r"\1+%s\2-%s" % (offset_address, offset_address), + content, flags=re.MULTILINE) + + offset_script = join(FRAMEWORK_DIR, "platformio", "ldscripts", PLATFORM_NAME, + "%s_flash_%s.ld" % (script_name, offset_address)) + + with open(offset_script, "w") as fp: + fp.write(content) + + return offset_script + +def remove_prefix(s, prefix): + return s[len(prefix):] if s.startswith(prefix) else s + +def get_linker_script(mcu): + script_name = remove_prefix(mcu.lower(), 'at91') + ldscript = join(FRAMEWORK_DIR, "platformio", "ldscripts", PLATFORM_NAME, + script_name + "_flash.ld") + + if isfile(ldscript): + return adjust_linker_offset(script_name, ldscript) + + sys.stderr.write( + """Error: There is no linker script for %s MCU! + Please add custom linker script to your project manually!""" % mcu) + env.Exit(1) + +env.Append(CPPPATH=[ + join(FRAMEWORK_DIR, "CMSIS", "Core", "Include"), + join(get_variant_dir(env.BoardConfig().get("build.mcu")), "include") +]) + +env.Append(LIBPATH=[ + join(FRAMEWORK_DIR, "platformio", "ldscripts", "atmelsam") +]) + +env.Replace( + LDSCRIPT_PATH=get_linker_script(env.BoardConfig().get("build.mcu"))) + +# +# Target: Build Core Library +# + +# `BuildSources` because with `BuildLibrary` the vector table doesn't get linked in. +env.BuildSources( + join("$BUILD_DIR", "FrameworkCMSISVariant"), + join(get_variant_dir(env.BoardConfig().get("build.mcu")), "gcc") +) diff --git a/examples/cmsis-blink/include/README b/examples/cmsis-blink/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/examples/cmsis-blink/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/cmsis-blink/lib/README b/examples/cmsis-blink/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/examples/cmsis-blink/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/cmsis-blink/platformio.ini b/examples/cmsis-blink/platformio.ini new file mode 100644 index 0000000..f3dba2d --- /dev/null +++ b/examples/cmsis-blink/platformio.ini @@ -0,0 +1,300 @@ +[env:adafruit_circuitplayground_m0] +platform = atmelsam +framework = cmsis +board = adafruit_circuitplayground_m0 + +[env:adafruit_crickit_m0] +platform = atmelsam +framework = cmsis +board = adafruit_crickit_m0 + +[env:adafruit_feather_m0] +platform = atmelsam +framework = cmsis +board = adafruit_feather_m0 + +[env:adafruit_feather_m0_express] +platform = atmelsam +framework = cmsis +board = adafruit_feather_m0_express + +[env:adafruit_feather_m4] +platform = atmelsam +framework = cmsis +board = adafruit_feather_m4 + +[env:adafruit_gemma_m0] +platform = atmelsam +framework = cmsis +board = adafruit_gemma_m0 + +[env:adafruit_grandcentral_m4] +platform = atmelsam +framework = cmsis +board = adafruit_grandcentral_m4 + +[env:adafruit_hallowing] +platform = atmelsam +framework = cmsis +board = adafruit_hallowing + +[env:adafruit_hallowing_m4] +platform = atmelsam +framework = cmsis +board = adafruit_hallowing_m4 + +[env:adafruit_itsybitsy_m0] +platform = atmelsam +framework = cmsis +board = adafruit_itsybitsy_m0 + +[env:adafruit_itsybitsy_m4] +platform = atmelsam +framework = cmsis +board = adafruit_itsybitsy_m4 + +[env:adafruit_metro_m0] +platform = atmelsam +framework = cmsis +board = adafruit_metro_m0 + +[env:adafruit_metro_m4] +platform = atmelsam +framework = cmsis +board = adafruit_metro_m4 + +[env:adafruit_metro_m4_airliftlite] +platform = atmelsam +framework = cmsis +board = adafruit_metro_m4_airliftlite + +[env:adafruit_monster_m4sk] +platform = atmelsam +framework = cmsis +board = adafruit_monster_m4sk + +[env:adafruit_pirkey] +platform = atmelsam +framework = cmsis +board = adafruit_pirkey + +[env:adafruit_pybadge_airlift_m4] +platform = atmelsam +framework = cmsis +board = adafruit_pybadge_airlift_m4 + +[env:adafruit_pybadge_m4] +platform = atmelsam +framework = cmsis +board = adafruit_pybadge_m4 + +[env:adafruit_pygamer_advance_m4] +platform = atmelsam +framework = cmsis +board = adafruit_pygamer_advance_m4 + +[env:adafruit_pygamer_m4] +platform = atmelsam +framework = cmsis +board = adafruit_pygamer_m4 + +[env:adafruit_pyportal_m4] +platform = atmelsam +framework = cmsis +board = adafruit_pyportal_m4 + +[env:adafruit_trellis_m4] +platform = atmelsam +framework = cmsis +board = adafruit_trellis_m4 + +[env:adafruit_trinket_m0] +platform = atmelsam +framework = cmsis +board = adafruit_trinket_m0 + +[env:current_ranger] +platform = atmelsam +framework = cmsis +board = current_ranger + +[env:digix] +platform = atmelsam +framework = cmsis +board = digix + +[env:due] +platform = atmelsam +framework = cmsis +board = due + +[env:dueUSB] +platform = atmelsam +framework = cmsis +board = dueUSB + +[env:macchina2] +platform = atmelsam +framework = cmsis +board = macchina2 + +[env:minitronics20] +platform = atmelsam +framework = cmsis +board = minitronics20 + +[env:mkr1000USB] +platform = atmelsam +framework = cmsis +board = mkr1000USB + +[env:mkrfox1200] +platform = atmelsam +framework = cmsis +board = mkrfox1200 + +[env:mkrgsm1400] +platform = atmelsam +framework = cmsis +board = mkrgsm1400 + +[env:mkrnb1500] +platform = atmelsam +framework = cmsis +board = mkrnb1500 + +[env:mkrvidor4000] +platform = atmelsam +framework = cmsis +board = mkrvidor4000 + +[env:mkrwan1300] +platform = atmelsam +framework = cmsis +board = mkrwan1300 + +[env:mkrwifi1010] +platform = atmelsam +framework = cmsis +board = mkrwifi1010 + +[env:mkrzero] +platform = atmelsam +framework = cmsis +board = mkrzero + +[env:moteino_zero] +platform = atmelsam +framework = cmsis +board = moteino_zero + +[env:mzeroUSB] +platform = atmelsam +framework = cmsis +board = mzeroUSB + +[env:mzeropro] +platform = atmelsam +framework = cmsis +board = mzeropro + +[env:mzeroproUSB] +platform = atmelsam +framework = cmsis +board = mzeroproUSB + +[env:nano_33_iot] +platform = atmelsam +framework = cmsis +board = nano_33_iot + +[env:sainSmartDue] +platform = atmelsam +framework = cmsis +board = sainSmartDue + +[env:sainSmartDueUSB] +platform = atmelsam +framework = cmsis +board = sainSmartDueUSB + +[env:samd21_xpro] +platform = atmelsam +framework = cmsis +board = samd21_xpro + +[env:samd21g18a] +platform = atmelsam +framework = cmsis +board = samd21g18a + +[env:saml21_xpro_b] +platform = atmelsam +framework = cmsis +board = saml21_xpro_b + +[env:samr21_xpro] +platform = atmelsam +framework = cmsis +board = samr21_xpro + +[env:seeeduino_lorawan] +platform = atmelsam +framework = cmsis +board = seeeduino_lorawan + +[env:sodaq_autonomo] +platform = atmelsam +framework = cmsis +board = sodaq_autonomo + +[env:sodaq_explorer] +platform = atmelsam +framework = cmsis +board = sodaq_explorer + +[env:sodaq_one] +platform = atmelsam +framework = cmsis +board = sodaq_one + +[env:sodaq_sara] +platform = atmelsam +framework = cmsis +board = sodaq_sara + +[env:sodaq_sff] +platform = atmelsam +framework = cmsis +board = sodaq_sff + +[env:sparkfun_samd21_dev_usb] +platform = atmelsam +framework = cmsis +board = sparkfun_samd21_dev_usb + +[env:sparkfun_samd21_mini_usb] +platform = atmelsam +framework = cmsis +board = sparkfun_samd21_mini_usb + +[env:tian] +platform = atmelsam +framework = cmsis +board = tian + +[env:tuinozero96] +platform = atmelsam +framework = cmsis +board = tuinozero96 + +[env:zero] +platform = atmelsam +framework = cmsis +board = zero + +[env:zeroUSB] +platform = atmelsam +framework = cmsis +board = zeroUSB + diff --git a/examples/cmsis-blink/src/main.cpp b/examples/cmsis-blink/src/main.cpp new file mode 100644 index 0000000..d1ba145 --- /dev/null +++ b/examples/cmsis-blink/src/main.cpp @@ -0,0 +1,63 @@ +#include +#include + +#if defined(ADAFRUIT_METRO_M4_EXPRESS) || defined(ADAFRUIT_GRAND_CENTRAL_M4) +#define LED_PAD PORT_PA16 +const uint32_t CYCLES_PER_SEC = 48000000; // Initial speed of SAMD51 post reset +#elif defined(ARDUINO_SAMD_FEATHER_M0) +#define LED_PAD PORT_PA17 +const uint32_t CYCLES_PER_SEC = 1000000; // Initial speed of SAMD21 post reset +#else +#warning Blink execution untested with this device. Please set LED_PAD, initial MCU clock speed, and control ports correctly. +#define LED_PAD PORT_PA17 +const uint32_t CYCLES_PER_SEC = 1000000; // Initial speed of SAMD21 post reset +#endif + +void toggleLED() { + static bool led = false; + led = !led; + +#if defined(REG_PORT_OUT0) + if (led) { + REG_PORT_OUT0 &= ~LED_PAD; + } + else { + REG_PORT_OUT0 |= LED_PAD; + } +#endif +} + +void init() { + SystemInit(); + + // Direct register manipulation, because CMSIS does not provide a GPIO abstraction. +#if defined(REG_PORT_OUT0) + REG_PORT_DIR0 |= LED_PAD; +#endif +} + +const uint32_t CYCLES_PER_MS = CYCLES_PER_SEC / 1000; +const uint32_t CYCLES_PER_LOOP = 6; +const uint32_t LOOPS_PER_MS = CYCLES_PER_MS / CYCLES_PER_LOOP; +void spinDelay(uint16_t ms) { + for (uint16_t d = 0; d