From 11dbf858a761f16dd74cb5b4b9a8931c5703b1a0 Mon Sep 17 00:00:00 2001 From: Ag Primatic Date: Wed, 30 Dec 2020 10:19:33 -0500 Subject: [PATCH 01/34] Update SERCOM.cpp Added check for ARBLOST in sendDataMasterWIRE so misbehaving I2C slaves don't cause the Zero to get stuck in an endless loop. --- cores/arduino/SERCOM.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/arduino/SERCOM.cpp b/cores/arduino/SERCOM.cpp index b9fbf05b9..03ecea7ea 100644 --- a/cores/arduino/SERCOM.cpp +++ b/cores/arduino/SERCOM.cpp @@ -568,8 +568,8 @@ bool SERCOM::sendDataMasterWIRE(uint8_t data) while(!sercom->I2CM.INTFLAG.bit.MB) { // If a bus error occurs, the MB bit may never be set. - // Check the bus error bit and bail if it's set. - if (sercom->I2CM.STATUS.bit.BUSERR) { + // Check the bus error bit and ARBLOST bit and bail if either is set. + if (sercom->I2CM.STATUS.bit.BUSERR || sercom->I2CM.STATUS.bit.ARBLOST) { return false; } } From 6f93f9bfeff454d2dd0f1c1247b52ff7df241f97 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 22 Feb 2021 15:20:09 -0800 Subject: [PATCH 02/34] Pin Ace* libraries at last compatible version in CI workflow Due to incompatibilities introduced during the initial ArduinoCore-API incorporation, the author of the AceTime and AceCommon libraries has added an #error directive that is triggered when the libraries are compiled by any version of arduino;samd that uses ArduinoCore-API: - https://github.com/bxparks/AceTime/blob/v1.6/src/AceTime.h#L25-L26 - https://github.com/bxparks/AceCommon/blob/v1.4.3/src/AceCommon.h#L44-L45 Ironically, compilation of the AceTime examples was added specifically to avoid any future breakage of compatibility with that library. Now the shoe is on the other foot. --- .github/workflows/compile-examples.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index e3e567ea9..8b4cdd433 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -248,7 +248,8 @@ jobs: - name: LoRa - name: MKRWAN - name: WiFiNINA - - name: AceTime + - name: AceTime@1.4.1 + - name: AceCommon@1.3.1 - source-url: https://github.com/vidor-libraries/VidorPeripherals.git platforms: | # Use Board Manager to install the latest release of Arduino SAMD Boards to get the toolchain From a3cc04d0ce851819e6619ebf6947826b5949a7c4 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 29 Mar 2021 11:58:04 +0200 Subject: [PATCH 03/34] Don't spill arduino namespace in headers Needs https://github.com/arduino/ArduinoCore-API/pull/144 to be merged --- cores/arduino/Arduino.h | 3 +++ cores/arduino/USB/CDC.cpp | 2 ++ cores/arduino/USB/SAMD21_USBDevice.h | 2 +- cores/arduino/USB/USBAPI.h | 16 ++++++---------- cores/arduino/USB/USBCore.cpp | 1 + cores/arduino/Uart.h | 6 +++--- cores/arduino/main.cpp | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h index 199e65e22..d78acd9b4 100644 --- a/cores/arduino/Arduino.h +++ b/cores/arduino/Arduino.h @@ -27,6 +27,9 @@ #define RAMEND (RAMSTART + RAMSIZE - 1) #ifdef __cplusplus + +using namespace arduino; + extern "C"{ #endif // __cplusplus diff --git a/cores/arduino/USB/CDC.cpp b/cores/arduino/USB/CDC.cpp index e1a133ca8..c8314c2bb 100644 --- a/cores/arduino/USB/CDC.cpp +++ b/cores/arduino/USB/CDC.cpp @@ -28,6 +28,8 @@ #ifdef CDC_ENABLED +using namespace arduino; + extern USBDevice_SAMD21G18x usbd; #define CDC_SERIAL_BUFFER_SIZE 256 diff --git a/cores/arduino/USB/SAMD21_USBDevice.h b/cores/arduino/USB/SAMD21_USBDevice.h index 3fff6e1b8..98a95ce95 100644 --- a/cores/arduino/USB/SAMD21_USBDevice.h +++ b/cores/arduino/USB/SAMD21_USBDevice.h @@ -396,7 +396,7 @@ class DoubleBufferedEPOutHandler : public EPHandler { private: USBDevice_SAMD21G18x &usbd; - RingBuffer _rx_buffer; + arduino::RingBuffer _rx_buffer; const uint32_t ep; volatile uint32_t current, incoming; diff --git a/cores/arduino/USB/USBAPI.h b/cores/arduino/USB/USBAPI.h index c5cec6257..07633825d 100644 --- a/cores/arduino/USB/USBAPI.h +++ b/cores/arduino/USB/USBAPI.h @@ -35,10 +35,6 @@ #include "api/USBAPI.h" #include "CDC.h" -#if ARDUINO_API_VERSION > 10000 -using namespace arduino; -#endif - //================================================================================ // USB @@ -59,9 +55,9 @@ class USBDeviceClass { void standby(); // Setup API - bool handleClassInterfaceSetup(USBSetup &setup); - bool handleStandardSetup(USBSetup &setup); - bool sendDescriptor(USBSetup &setup); + bool handleClassInterfaceSetup(arduino::USBSetup &setup); + bool handleStandardSetup(arduino::USBSetup &setup); + bool sendDescriptor(arduino::USBSetup &setup); // Control EndPoint API uint32_t sendControl(const void *data, uint32_t len); @@ -100,7 +96,7 @@ extern USBDeviceClass USBDevice; //================================================================================ // Serial over CDC (Serial1 is the physical port) -class Serial_ : public Stream, public arduino::PluggableUSBModule +class Serial_ : public arduino::Stream, public arduino::PluggableUSBModule { public: Serial_(USBDeviceClass &_usb); @@ -163,8 +159,8 @@ class Serial_ : public Stream, public arduino::PluggableUSBModule protected: // Implementation of the PUSBListNode int getInterface(uint8_t* interfaceNum); - int getDescriptor(USBSetup& setup); - bool setup(USBSetup& setup); + int getDescriptor(arduino::USBSetup& setup); + bool setup(arduino::USBSetup& setup); uint8_t getShortName(char* name); void handleEndpoint(int ep); void enableInterrupt(); diff --git a/cores/arduino/USB/USBCore.cpp b/cores/arduino/USB/USBCore.cpp index be0bb5612..f8322436f 100644 --- a/cores/arduino/USB/USBCore.cpp +++ b/cores/arduino/USB/USBCore.cpp @@ -31,6 +31,7 @@ #include #include +using namespace arduino; /* * USB Device instance diff --git a/cores/arduino/Uart.h b/cores/arduino/Uart.h index d02600b3f..6aa847839 100644 --- a/cores/arduino/Uart.h +++ b/cores/arduino/Uart.h @@ -24,7 +24,7 @@ #define SERIAL_BUFFER_SIZE 64 -class Uart : public HardwareSerial +class Uart : public arduino::HardwareSerial { public: Uart(SERCOM *_s, uint8_t _pinRX, uint8_t _pinTX, SercomRXPad _padRX, SercomUartTXPad _padTX); @@ -46,8 +46,8 @@ class Uart : public HardwareSerial private: SERCOM *sercom; - SafeRingBuffer rxBuffer; - SafeRingBuffer txBuffer; + arduino::SafeRingBuffer rxBuffer; + arduino::SafeRingBuffer txBuffer; uint8_t uc_pinRX; uint8_t uc_pinTX; diff --git a/cores/arduino/main.cpp b/cores/arduino/main.cpp index 5a59884f6..a6d2cb5f5 100644 --- a/cores/arduino/main.cpp +++ b/cores/arduino/main.cpp @@ -51,7 +51,7 @@ int main( void ) for (;;) { loop(); - if (serialEventRun) serialEventRun(); + if (arduino::serialEventRun) arduino::serialEventRun(); } return 0; From f99e4523a162a5f0c88be536d50d3332560453e8 Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski Date: Mon, 29 Mar 2021 16:43:32 -0700 Subject: [PATCH 04/34] Fix compiler warning from useless volatile "Cast to integral type ignores qualifier volatile" Attempting to cast to a `volatile uint32_t` does nothing different from cast to a `uint32_t`, with the exception of looking like it's doing something different. Just remove the `volatile` qualifier to fix. See also https://github.com/adafruit/ArduinoCore-samd/pull/288 --- cores/arduino/Reset.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/arduino/Reset.cpp b/cores/arduino/Reset.cpp index 21592d759..c53915e0f 100644 --- a/cores/arduino/Reset.cpp +++ b/cores/arduino/Reset.cpp @@ -28,7 +28,7 @@ extern "C" { #if (ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10610) extern const uint32_t __text_start__; -#define APP_START ((volatile uint32_t)(&__text_start__) + 4) +#define APP_START ((uint32_t)(&__text_start__) + 4) #else #define APP_START 0x00002004 From 34ead75cc4acbad47af0434db241812bd98a8116 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 31 Mar 2021 20:34:11 -0700 Subject: [PATCH 05/34] Disable verbose output in sketch compilation CI logs The arduino/compile-sketches action was previously configured for verbose output.. This option is primarily intended to be used for troubleshooting and doesn't contain any information that is useful for general usage. Due to the extensive coverage of this CI workflow, the logs are massive, which makes it inconvenient for anyone to read them to identify the cause of a failure. Removing the verbose output will improve that situation --- .github/workflows/compile-examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 8b4cdd433..e37a74d51 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -263,7 +263,7 @@ jobs: ${{ matrix.mkrgsm1400-sketch-paths }} ${{ matrix.wan-sketch-paths }} enable-deltas-report: 'true' - verbose: 'true' + verbose: 'false' github-token: ${{ secrets.GITHUB_TOKEN }} - name: Save memory usage change report as artifact From 9d557196eabd8576079e9add05db260fa18d8705 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Fri, 2 Apr 2021 12:24:11 -0700 Subject: [PATCH 06/34] SafeRingBuffer.h: Prevent compiler warning about reaching end of non-void function (see #580) --- cores/arduino/SafeRingBuffer.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cores/arduino/SafeRingBuffer.h b/cores/arduino/SafeRingBuffer.h index 7526ae54a..235406fac 100644 --- a/cores/arduino/SafeRingBuffer.h +++ b/cores/arduino/SafeRingBuffer.h @@ -41,6 +41,12 @@ int SafeRingBufferN::read_char() { synchronized { return RingBufferN::read_char(); } + + // We should never reached this line because the synchronized {} block gets + // executed at least once. However the compiler gets confused and prints a + // warning about control reaching the end of a non-void function. This + // silences that warning. + return -1; } template @@ -53,4 +59,4 @@ void SafeRingBufferN::store_char(uint8_t c) { } #endif /* _SAFE_RING_BUFFER_ */ -#endif /* __cplusplus */ \ No newline at end of file +#endif /* __cplusplus */ From d681383f09ae2e68cbf2dae84aeb487ae373a8e0 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 4 Apr 2021 02:16:54 -0700 Subject: [PATCH 07/34] Use established KEYWORD_TOKENTYPE for global instance keywords All the other platform bundled libraries use `KEYWORD1` for the library's global instance so this provides consistency. --- libraries/SAMD_BootloaderUpdater/keywords.txt | 8 ++------ libraries/Wire/keywords.txt | 10 +++------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/libraries/SAMD_BootloaderUpdater/keywords.txt b/libraries/SAMD_BootloaderUpdater/keywords.txt index 728a42ea7..07164e9b0 100644 --- a/libraries/SAMD_BootloaderUpdater/keywords.txt +++ b/libraries/SAMD_BootloaderUpdater/keywords.txt @@ -6,6 +6,8 @@ # Datatypes (KEYWORD1) ################################################ +SAMD_BootloaderUpdater KEYWORD2 + ################################################ # Methods and Functions (KEYWORD2) ################################################ @@ -13,12 +15,6 @@ needsUpdate KEYWORD2 update KEYWORD2 -####################################### -# Instances (KEYWORD2) -####################################### - -SAMD_BootloaderUpdater KEYWORD2 - ####################################### # Constants (LITERAL1) ####################################### diff --git a/libraries/Wire/keywords.txt b/libraries/Wire/keywords.txt index dd8366d8f..ba5a18daf 100644 --- a/libraries/Wire/keywords.txt +++ b/libraries/Wire/keywords.txt @@ -6,6 +6,9 @@ # Datatypes (KEYWORD1) ####################################### +Wire KEYWORD2 +Wire1 KEYWORD2 + ####################################### # Methods and Functions (KEYWORD2) ####################################### @@ -17,13 +20,6 @@ requestFrom KEYWORD2 onReceive KEYWORD2 onRequest KEYWORD2 -####################################### -# Instances (KEYWORD2) -####################################### - -Wire KEYWORD2 -Wire1 KEYWORD2 - ####################################### # Constants (LITERAL1) ####################################### From 7f726194ba8c3922b328d843692a3e5db2b0ba3a Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 4 Apr 2021 22:51:34 -0700 Subject: [PATCH 08/34] Document SAMD_AnalogCorrection library's 12 bit resolution requirement The platform bundled SAMD_AnalogCorrection library is only compatible with 12 bit ADC resolution. This can be confusing to the user because: - The definition of ADC_RESOLUTION_BITS in the CorrectADCResponse sketch gives the impression this value can be modified by the user. - The default analogRead() resolution is 10 bits. The first is resolved by the addition of a comment prohibiting changing the value of ADC_RESOLUTION_BITS. The second is resolved by the addition of an `analogReadResolution(12)` call to the code generated by the CorrectADCResponse sketch. --- .../examples/CorrectADCResponse/CorrectADCResponse.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/SAMD_AnalogCorrection/examples/CorrectADCResponse/CorrectADCResponse.ino b/libraries/SAMD_AnalogCorrection/examples/CorrectADCResponse/CorrectADCResponse.ino index 2b74538e1..d4a4a6476 100644 --- a/libraries/SAMD_AnalogCorrection/examples/CorrectADCResponse/CorrectADCResponse.ino +++ b/libraries/SAMD_AnalogCorrection/examples/CorrectADCResponse/CorrectADCResponse.ino @@ -18,7 +18,7 @@ 6) Open the Serial Monitor and press the reset button on the Arduino ZERO 7) At the and of the procedure you can find logged - the offset and gain values for the board where the sketch has been just executed - - the instruction line to copy/paste in the final sketch + - the code to copy/paste in sketches using this library */ #include "SAMD_AnalogCorrection.h" @@ -32,7 +32,7 @@ #define ADC_MIN_GAIN 0x0400 #define ADC_UNITY_GAIN 0x0800 #define ADC_MAX_GAIN (0x1000 - 1) -#define ADC_RESOLUTION_BITS 12 +#define ADC_RESOLUTION_BITS 12 // do not change. This library only supports 12 bit resolution. #define ADC_RANGE (1 << ADC_RESOLUTION_BITS) #define ADC_TOP_VALUE (ADC_RANGE - 1) @@ -162,7 +162,8 @@ void setup() Serial.println(offsetCorrectionValue); Serial.print(" Gain = "); Serial.println(gainCorrectionValue); - Serial.println("\r\nAdd the next line to your sketch:"); + Serial.println("\r\nAdd the next lines to your sketch:"); + Serial.println(" analogReadResolution(12);"); Serial.print(" analogReadCorrection("); Serial.print(offsetCorrectionValue); Serial.print(", "); From aa21f4fe1f0fc96410cf9277f4071e28ffc4d756 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 7 Apr 2021 17:12:33 +0200 Subject: [PATCH 09/34] SPI: restore 12MHz as maximum frequency Fixes https://github.com/arduino/ArduinoCore-samd/issues/593 --- libraries/SPI/SPI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/SPI/SPI.cpp b/libraries/SPI/SPI.cpp index f355e2378..111ce13b3 100644 --- a/libraries/SPI/SPI.cpp +++ b/libraries/SPI/SPI.cpp @@ -94,8 +94,8 @@ void SPIClass::config(SPISettings settings) _p_sercom->disableSPI(); uint32_t clock_freq = settings.getClockFreq(); - if (clock_freq > F_CPU/2) { - clock_freq = F_CPU/2; + if (clock_freq > SERCOM_FREQ_REF/SPI_MIN_CLOCK_DIVIDER) { + clock_freq = SERCOM_FREQ_REF/SPI_MIN_CLOCK_DIVIDER; } _p_sercom->initSPI(_padTx, _padRx, SPI_CHAR_SIZE_8_BITS, getBitOrder(settings)); From b73c5828294d118bc10e528109936f4fc67fc8b8 Mon Sep 17 00:00:00 2001 From: Jakub Duchniewicz Date: Fri, 21 May 2021 15:08:29 +0200 Subject: [PATCH 10/34] Fix naming in comments. --- variants/nano_33_iot/variant.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/variants/nano_33_iot/variant.cpp b/variants/nano_33_iot/variant.cpp index 82c5b9e52..2dc467685 100644 --- a/variants/nano_33_iot/variant.cpp +++ b/variants/nano_33_iot/variant.cpp @@ -73,7 +73,7 @@ const PinDescription g_APinDescription[] = { { PORTA, 17, PIO_SERCOM, (PIN_ATTR_DIGITAL ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 }, // SCK: SERCOM1/PAD[1] /* +------------+------------------+--------+-----------------+--------+-----------------------+---------+---------+--------+--------+----------+----------+ - | Pin number | MKR Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H | + | Pin number | NANO Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H | | | | | | EIC | ADC | AC | PTC | DAC | SERCOMx | SERCOMx | TCCx | TCCx | COM | AC/GLCK | | | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ @@ -102,7 +102,7 @@ const PinDescription g_APinDescription[] = { { PORTB, 3, PIO_ANALOG, (PIN_ATTR_DIGITAL ), ADC_Channel11, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 }, /* +------------+------------------+--------+-----------------+--------+-----------------------+---------+---------+--------+--------+----------+----------+ - | Pin number | MKR Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H | + | Pin number | NANO Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H | | | | | | EIC | ADC | AC | PTC | DAC | SERCOMx | SERCOMx | TCCx | TCCx | COM | AC/GLCK | | | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ @@ -127,7 +127,7 @@ const PinDescription g_APinDescription[] = { /* +------------+------------------+--------+-----------------+--------+-----------------------+---------+---------+--------+--------+----------+----------+ - | Pin number | MKR Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H | + | Pin number | NANO Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H | | | | | | EIC | ADC | AC | PTC | DAC | SERCOMx | SERCOMx | TCCx | TCCx | COM | AC/GLCK | | | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ @@ -147,7 +147,7 @@ const PinDescription g_APinDescription[] = { { PORTA, 25, PIO_COM, PIN_ATTR_NONE , No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP /* +------------+------------------+--------+-----------------+--------+-----------------------+---------+---------+--------+--------+----------+----------+ - | Pin number | MKR Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H | + | Pin number | NANO Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H | | | | | | EIC | ADC | AC | PTC | DAC | SERCOMx | SERCOMx | TCCx | TCCx | COM | AC/GLCK | | | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ From 52b4a2dd087eff631481635f1ecdd4a837cfebf4 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 23 Jun 2021 16:58:38 +0200 Subject: [PATCH 11/34] Restructure programmers by removing hardcoded build.openocdscript This allows selecting multiple programmers; J-Link added as an example. --- platform.txt | 6 +++--- programmers.txt | 21 ++++++++++++--------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/platform.txt b/platform.txt index 7c6c46c54..3df9b1ab1 100644 --- a/platform.txt +++ b/platform.txt @@ -198,14 +198,14 @@ tools.openocd.cmd.windows=bin/openocd.exe tools.openocd.upload.params.verbose=-d2 tools.openocd.upload.params.quiet=-d0 -tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown" +tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "interface/{protocol}" -c "set telnet_port 0" {extra_params} -f "target/at91samdXX.cfg" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown" tools.openocd.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA tools.openocd.upload.network_pattern={network_cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b tools.openocd.program.params.verbose=-d2 tools.openocd.program.params.quiet=-d0 -tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.hex} verify reset; shutdown" +tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "interface/{protocol}" -c "set telnet_port 0" {extra_params} -f "target/at91samdXX.cfg" -c "telnet_port disabled; program {{build.path}/{build.project_name}.hex} verify reset; shutdown" tools.openocd.erase.params.verbose=-d3 tools.openocd.erase.params.quiet=-d0 @@ -213,7 +213,7 @@ tools.openocd.erase.pattern= tools.openocd.bootloader.params.verbose=-d2 tools.openocd.bootloader.params.quiet=-d0 -tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown" +tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "interface/{protocol}" -c "set telnet_port 0" {extra_params} -f "target/at91samdXX.cfg" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown" # # OpenOCD sketch upload - version with configurable bootloader size diff --git a/programmers.txt b/programmers.txt index fd7471b7d..abd65f81a 100644 --- a/programmers.txt +++ b/programmers.txt @@ -16,21 +16,24 @@ edbg.name=Atmel EDBG edbg.communication=USB -edbg.protocol= -edbg.program.protocol= +edbg.protocol=cmsis-dap.cfg edbg.program.tool=openocd -edbg.program.extra_params= +edbg.extra_params= atmel_ice.name=Atmel-ICE atmel_ice.communication=USB -atmel_ice.protocol= -atmel_ice.program.protocol= +atmel_ice.protocol=cmsis-dap.cfg atmel_ice.program.tool=openocd -atmel_ice.program.extra_params= +atmel_ice.extra_params= sam_ice.name=Atmel SAM-ICE sam_ice.communication=USB -sam_ice.protocol= -sam_ice.program.protocol= +sam_ice.protocol=cmsis-dap.cfg sam_ice.program.tool=openocd -sam_ice.program.extra_params= +sam_ice.extra_params= + +jlink.name=Segger J-Link +jlink.communication=USB +jlink.protocol=jlink.cfg +jlink.program.tool=openocd +jlink.extra_params=-c "transport select swd" \ No newline at end of file From b49b07f7edd6a2bf025dfc78f03492cfc40aca4d Mon Sep 17 00:00:00 2001 From: neo Date: Sat, 31 Jul 2021 21:03:58 +0800 Subject: [PATCH 12/34] add architecture specific flag to compiler.S.flags --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index 7c6c46c54..1d8405ddd 100644 --- a/platform.txt +++ b/platform.txt @@ -43,7 +43,7 @@ compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.optimization_flags} { compiler.c.elf.cmd=arm-none-eabi-g++ compiler.c.elf.flags={compiler.optimization_flags} -Wl,--gc-sections -save-temps compiler.S.cmd=arm-none-eabi-gcc -compiler.S.flags=-c -g -x assembler-with-cpp -MMD +compiler.S.flags=-mcpu={build.mcu} -mthumb -c -g -x assembler-with-cpp -MMD compiler.cpp.cmd=arm-none-eabi-g++ compiler.cpp.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.optimization_flags} {compiler.warning_flags} -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD compiler.ar.cmd=arm-none-eabi-ar From 678e3ff6467b88b64c418e1e37633e88afa95612 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 18 Oct 2021 09:49:37 +0200 Subject: [PATCH 13/34] UART: restore default buffer size to 256 bytes Fixes #650 --- cores/arduino/Uart.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cores/arduino/Uart.h b/cores/arduino/Uart.h index 6aa847839..8f2e812bb 100644 --- a/cores/arduino/Uart.h +++ b/cores/arduino/Uart.h @@ -22,7 +22,11 @@ #include "SERCOM.h" #include "SafeRingBuffer.h" -#define SERIAL_BUFFER_SIZE 64 +#ifdef SERIAL_BUFFER_SIZE +#undef SERIAL_BUFFER_SIZE +#endif + +#define SERIAL_BUFFER_SIZE 256 class Uart : public arduino::HardwareSerial { @@ -46,8 +50,9 @@ class Uart : public arduino::HardwareSerial private: SERCOM *sercom; - arduino::SafeRingBuffer rxBuffer; - arduino::SafeRingBuffer txBuffer; + + arduino::SafeRingBufferN rxBuffer; + arduino::SafeRingBufferN txBuffer; uint8_t uc_pinRX; uint8_t uc_pinTX; From b0ba1ee8bb8f89d765c6d0016728603ae4c95530 Mon Sep 17 00:00:00 2001 From: Andrew Cunningham Date: Mon, 18 Oct 2021 10:12:48 +0200 Subject: [PATCH 14/34] fix Serial.flush() blocks forever #597 * The aynchronous nature of the DRE and TXC interrupt flags causes issues (lockups) when the TX DATA register is empty on start and a flush is issued. Simply looking at the DRE prior to waiting for TXC is insufficient because the data register may well be empty but the shift register could still contain data, in this case SERCOM::flushUART() would return before TXC has been raised thus before flushing is complete. * bool added to SERCOM.h to indicate when it is ok for SERCOM::flushUART() to wait for the TXC flag. This flag is set when any data is written to the data register via SERCOM::writeDataUART(). It is cleared when a flush is done. --- cores/arduino/SERCOM.cpp | 11 +++++++---- cores/arduino/SERCOM.h | 5 +++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cores/arduino/SERCOM.cpp b/cores/arduino/SERCOM.cpp index b9fbf05b9..ab86aabab 100644 --- a/cores/arduino/SERCOM.cpp +++ b/cores/arduino/SERCOM.cpp @@ -112,11 +112,10 @@ void SERCOM::enableUART() void SERCOM::flushUART() { // Skip checking transmission completion if data register is empty -// if(isDataRegisterEmptyUART()) -// return; + // Wait for transmission to complete, if ok to do so. + while(!sercom->USART.INTFLAG.bit.TXC && onFlushWaitUartTXC); - // Wait for transmission to complete - while(!sercom->USART.INTFLAG.bit.TXC); + onFlushWaitUartTXC = false; } void SERCOM::clearStatusUART() @@ -183,6 +182,10 @@ int SERCOM::writeDataUART(uint8_t data) //Put data into DATA register sercom->USART.DATA.reg = (uint16_t)data; + + // indicate it's ok to wait for TXC flag when flushing + onFlushWaitUartTXC = true; + return 1; } diff --git a/cores/arduino/SERCOM.h b/cores/arduino/SERCOM.h index cbc3a05de..80b54de5b 100644 --- a/cores/arduino/SERCOM.h +++ b/cores/arduino/SERCOM.h @@ -218,6 +218,11 @@ class SERCOM uint8_t calculateBaudrateSynchronous(uint32_t baudrate) ; uint32_t division(uint32_t dividend, uint32_t divisor) ; void initClockNVIC( void ) ; + + // Flag set when data is loaded into sercom->USART.DATA.reg. + // Helps with preventing UART lockups when flushing on startup + // and the asyncronous nature of the DRE and TXC interrupt flags. + bool onFlushWaitUartTXC = false; }; #endif From 96ce5f960191a20aeaca1858115111a9ecb9b4e1 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 18 Oct 2021 10:47:03 +0200 Subject: [PATCH 15/34] Remove AceTime from CI compile-examples --- .github/workflows/compile-examples.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index e37a74d51..b2d769725 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -53,7 +53,6 @@ jobs: - ~/Arduino/libraries/MFRC522/examples/rfid_read_personal_data - ~/Arduino/libraries/MFRC522/examples/rfid_write_personal_data - ~/Arduino/libraries/WiFi101/examples - - ~/Arduino/libraries/AceTime/examples/HelloDateTime strategy: fail-fast: false @@ -248,8 +247,6 @@ jobs: - name: LoRa - name: MKRWAN - name: WiFiNINA - - name: AceTime@1.4.1 - - name: AceCommon@1.3.1 - source-url: https://github.com/vidor-libraries/VidorPeripherals.git platforms: | # Use Board Manager to install the latest release of Arduino SAMD Boards to get the toolchain From 39f483e901a6c7c10cbacc67df2048502913cf8b Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 20 Oct 2021 16:07:38 +0200 Subject: [PATCH 16/34] Added rules for pluggable discoveries and monitor (#648) --- boards.txt | 146 ++++++++++++++++++++++++++++++++++++++++++++++++ platform.txt | 30 +++++++--- programmers.txt | 9 ++- 3 files changed, 175 insertions(+), 10 deletions(-) diff --git a/boards.txt b/boards.txt index 91adede0d..20ad6b63b 100644 --- a/boards.txt +++ b/boards.txt @@ -19,8 +19,13 @@ arduino_zero_edbg.name=Arduino Zero (Programming Port) arduino_zero_edbg.vid.0=0x03eb arduino_zero_edbg.pid.0=0x2157 +arduino_zero_edbg.upload_port.0.vid=0x03eb +arduino_zero_edbg.upload_port.0.pid=0x2157 +arduino_zero_edbg.upload_port.1.board=arduino_zero_edbg arduino_zero_edbg.upload.tool=openocd +arduino_zero_edbg.upload.tool.default=openocd +arduino_zero_edbg.upload.tool.network=arduino_ota arduino_zero_edbg.upload.protocol=sam-ba arduino_zero_edbg.upload.maximum_size=262144 arduino_zero_edbg.upload.maximum_data_size=32768 @@ -41,6 +46,7 @@ arduino_zero_edbg.build.variant_system_lib= arduino_zero_edbg.build.vid=0x2341 arduino_zero_edbg.build.pid=0x804d arduino_zero_edbg.bootloader.tool=openocd +arduino_zero_edbg.bootloader.tool.default=openocd arduino_zero_edbg.bootloader.file=zero/samd21_sam_ba.bin # Arduino Zero (Native USB Port) @@ -54,8 +60,19 @@ arduino_zero_native.vid.2=0x2341 arduino_zero_native.pid.2=0x824d arduino_zero_native.vid.3=0x2341 arduino_zero_native.pid.3=0x024d +arduino_zero_native.upload_port.0.vid=0x2341 +arduino_zero_native.upload_port.0.pid=0x804d +arduino_zero_native.upload_port.1.vid=0x2341 +arduino_zero_native.upload_port.1.pid=0x004d +arduino_zero_native.upload_port.2.vid=0x2341 +arduino_zero_native.upload_port.2.pid=0x824d +arduino_zero_native.upload_port.3.vid=0x2341 +arduino_zero_native.upload_port.3.pid=0x024d +arduino_zero_native.upload_port.4.board=arduino_zero_native arduino_zero_native.upload.tool=bossac +arduino_zero_native.upload.tool.default=bossac +arduino_zero_native.upload.tool.network=arduino_ota arduino_zero_native.upload.protocol=sam-ba arduino_zero_native.upload.maximum_size=262144 arduino_zero_native.upload.maximum_data_size=32768 @@ -76,6 +93,7 @@ arduino_zero_native.build.variant_system_lib= arduino_zero_native.build.vid=0x2341 arduino_zero_native.build.pid=0x804d arduino_zero_native.bootloader.tool=openocd +arduino_zero_native.bootloader.tool.default=openocd arduino_zero_native.bootloader.file=zero/samd21_sam_ba.bin # Arduino MKR1000 @@ -89,8 +107,19 @@ mkr1000.vid.2=0x2341 mkr1000.pid.2=0x824e mkr1000.vid.3=0x2341 mkr1000.pid.3=0x024e +mkr1000.upload_port.0.vid=0x2341 +mkr1000.upload_port.0.pid=0x804e +mkr1000.upload_port.1.vid=0x2341 +mkr1000.upload_port.1.pid=0x004e +mkr1000.upload_port.2.vid=0x2341 +mkr1000.upload_port.2.pid=0x824e +mkr1000.upload_port.3.vid=0x2341 +mkr1000.upload_port.3.pid=0x024e +mkr1000.upload_port.4.board=mkr1000 mkr1000.upload.tool=bossac +mkr1000.upload.tool.default=bossac +mkr1000.upload.tool.network=arduino_ota mkr1000.upload.protocol=sam-ba mkr1000.upload.maximum_size=262144 mkr1000.upload.maximum_data_size=32768 @@ -110,6 +139,7 @@ mkr1000.build.variant=mkr1000 mkr1000.build.vid=0x2341 mkr1000.build.pid=0x804e mkr1000.bootloader.tool=openocd +mkr1000.bootloader.tool.default=openocd mkr1000.bootloader.file=mkr1000/samd21_sam_ba_arduino_mkr1000.bin # Arduino MKRZero @@ -119,8 +149,15 @@ mkrzero.vid.0=0x2341 mkrzero.pid.0=0x804f mkrzero.vid.1=0x2341 mkrzero.pid.1=0x004f +mkrzero.upload_port.0.vid=0x2341 +mkrzero.upload_port.0.pid=0x804f +mkrzero.upload_port.1.vid=0x2341 +mkrzero.upload_port.1.pid=0x004f +mkrzero.upload_port.2.board=mkrzero mkrzero.upload.tool=bossac +mkrzero.upload.tool.default=bossac +mkrzero.upload.tool.network=arduino_ota mkrzero.upload.protocol=sam-ba mkrzero.upload.maximum_size=262144 mkrzero.upload.maximum_data_size=32768 @@ -140,6 +177,7 @@ mkrzero.build.variant=mkrzero mkrzero.build.vid=0x2341 mkrzero.build.pid=0x804f mkrzero.bootloader.tool=openocd +mkrzero.bootloader.tool.default=openocd mkrzero.bootloader.file=mkrzero/samd21_sam_ba_arduino_mkrzero.bin # Arduino MKR WiFi 1010 @@ -149,8 +187,15 @@ mkrwifi1010.vid.0=0x2341 mkrwifi1010.pid.0=0x8054 mkrwifi1010.vid.1=0x2341 mkrwifi1010.pid.1=0x0054 +mkrwifi1010.upload_port.0.vid=0x2341 +mkrwifi1010.upload_port.0.pid=0x8054 +mkrwifi1010.upload_port.1.vid=0x2341 +mkrwifi1010.upload_port.1.pid=0x0054 +mkrwifi1010.upload_port.2.board=mkrwifi1010 mkrwifi1010.upload.tool=bossac +mkrwifi1010.upload.tool.default=bossac +mkrwifi1010.upload.tool.network=arduino_ota mkrwifi1010.upload.protocol=sam-ba mkrwifi1010.upload.maximum_size=262144 mkrwifi1010.upload.maximum_data_size=32768 @@ -170,6 +215,7 @@ mkrwifi1010.build.variant=mkrwifi1010 mkrwifi1010.build.vid=0x2341 mkrwifi1010.build.pid=0x8054 mkrwifi1010.bootloader.tool=openocd +mkrwifi1010.bootloader.tool.default=openocd mkrwifi1010.bootloader.file=mkrwifi1010/samd21_sam_ba_arduino_mkrwifi1010.bin #mkrwifi1010.arduinoota.extraflags=-d @@ -180,8 +226,15 @@ nano_33_iot.vid.0=0x2341 nano_33_iot.pid.0=0x8057 nano_33_iot.vid.1=0x2341 nano_33_iot.pid.1=0x0057 +nano_33_iot.upload_port.0.vid=0x2341 +nano_33_iot.upload_port.0.pid=0x8057 +nano_33_iot.upload_port.1.vid=0x2341 +nano_33_iot.upload_port.1.pid=0x0057 +nano_33_iot.upload_port.2.board=nano_33_iot nano_33_iot.upload.tool=bossac +nano_33_iot.upload.tool.default=bossac +nano_33_iot.upload.tool.network=arduino_ota nano_33_iot.upload.protocol=sam-ba nano_33_iot.upload.maximum_size=262144 nano_33_iot.upload.maximum_data_size=32768 @@ -201,6 +254,7 @@ nano_33_iot.build.variant=nano_33_iot nano_33_iot.build.vid=0x2341 nano_33_iot.build.pid=0x8057 nano_33_iot.bootloader.tool=openocd +nano_33_iot.bootloader.tool.default=openocd nano_33_iot.bootloader.file=nano_33_iot/samd21_sam_ba_arduino_nano_33_iot.bin # Arduino MKR FOX 1200 @@ -210,8 +264,15 @@ mkrfox1200.vid.0=0x2341 mkrfox1200.pid.0=0x8050 mkrfox1200.vid.1=0x2341 mkrfox1200.pid.1=0x0050 +mkrfox1200.upload_port.0.vid=0x2341 +mkrfox1200.upload_port.0.pid=0x8050 +mkrfox1200.upload_port.1.vid=0x2341 +mkrfox1200.upload_port.1.pid=0x0050 +mkrfox1200.upload_port.2.board=mkrfox1200 mkrfox1200.upload.tool=bossac +mkrfox1200.upload.tool.default=bossac +mkrfox1200.upload.tool.network=arduino_ota mkrfox1200.upload.protocol=sam-ba mkrfox1200.upload.maximum_size=262144 mkrfox1200.upload.maximum_data_size=32768 @@ -231,6 +292,7 @@ mkrfox1200.build.variant=mkrfox1200 mkrfox1200.build.vid=0x2341 mkrfox1200.build.pid=0x8050 mkrfox1200.bootloader.tool=openocd +mkrfox1200.bootloader.tool.default=openocd mkrfox1200.bootloader.file=mkrfox1200/samd21_sam_ba_arduino_mkrfox1200.bin # Arduino MKR WAN 1300 @@ -240,8 +302,15 @@ mkrwan1300.vid.0=0x2341 mkrwan1300.pid.0=0x8053 mkrwan1300.vid.1=0x2341 mkrwan1300.pid.1=0x0053 +mkrwan1300.upload_port.0.vid=0x2341 +mkrwan1300.upload_port.0.pid=0x8053 +mkrwan1300.upload_port.1.vid=0x2341 +mkrwan1300.upload_port.1.pid=0x0053 +mkrwan1300.upload_port.2.board=mkrwan1300 mkrwan1300.upload.tool=bossac +mkrwan1300.upload.tool.default=bossac +mkrwan1300.upload.tool.network=arduino_ota mkrwan1300.upload.protocol=sam-ba mkrwan1300.upload.maximum_size=262144 mkrwan1300.upload.maximum_data_size=32768 @@ -261,6 +330,7 @@ mkrwan1300.build.variant=mkrwan1300 mkrwan1300.build.vid=0x2341 mkrwan1300.build.pid=0x8053 mkrwan1300.bootloader.tool=openocd +mkrwan1300.bootloader.tool.default=openocd mkrwan1300.bootloader.file=mkrwan1300/samd21_sam_ba_arduino_mkrwan1300.bin # Arduino MKR WAN 1310 @@ -270,8 +340,15 @@ mkrwan1310.vid.0=0x2341 mkrwan1310.pid.0=0x8059 mkrwan1310.vid.1=0x2341 mkrwan1310.pid.1=0x0059 +mkrwan1310.upload_port.0.vid=0x2341 +mkrwan1310.upload_port.0.pid=0x8059 +mkrwan1310.upload_port.1.vid=0x2341 +mkrwan1310.upload_port.1.pid=0x0059 +mkrwan1310.upload_port.2.board=mkrwan1310 mkrwan1310.upload.tool=bossac +mkrwan1310.upload.tool.default=bossac +mkrwan1310.upload.tool.network=arduino_ota mkrwan1310.upload.protocol=sam-ba mkrwan1310.upload.maximum_size=262144 mkrwan1310.upload.maximum_data_size=32768 @@ -291,6 +368,7 @@ mkrwan1310.build.variant=mkrwan1300 mkrwan1310.build.vid=0x2341 mkrwan1310.build.pid=0x8059 mkrwan1310.bootloader.tool=openocd +mkrwan1310.bootloader.tool.default=openocd mkrwan1310.bootloader.file=mkrwan1300/samd21_sam_ba_arduino_mkrwan1310.bin # Arduino MKR GSM 1400 @@ -300,8 +378,15 @@ mkrgsm1400.vid.0=0x2341 mkrgsm1400.pid.0=0x8052 mkrgsm1400.vid.1=0x2341 mkrgsm1400.pid.1=0x0052 +mkrgsm1400.upload_port.0.vid=0x2341 +mkrgsm1400.upload_port.0.pid=0x8052 +mkrgsm1400.upload_port.1.vid=0x2341 +mkrgsm1400.upload_port.1.pid=0x0052 +mkrgsm1400.upload_port.2.board=mkrgsm1400 mkrgsm1400.upload.tool=bossac +mkrgsm1400.upload.tool.default=bossac +mkrgsm1400.upload.tool.network=arduino_ota mkrgsm1400.upload.protocol=sam-ba mkrgsm1400.upload.maximum_size=262144 mkrgsm1400.upload.maximum_data_size=32768 @@ -321,6 +406,7 @@ mkrgsm1400.build.variant=mkrgsm1400 mkrgsm1400.build.vid=0x2341 mkrgsm1400.build.pid=0x8052 mkrgsm1400.bootloader.tool=openocd +mkrgsm1400.bootloader.tool.default=openocd mkrgsm1400.bootloader.file=mkrgsm1400/samd21_sam_ba_arduino_mkrgsm1400.bin # Arduino MKR NB 1500 @@ -330,8 +416,15 @@ mkrnb1500.vid.0=0x2341 mkrnb1500.pid.0=0x8055 mkrnb1500.vid.1=0x2341 mkrnb1500.pid.1=0x0055 +mkrnb1500.upload_port.0.vid=0x2341 +mkrnb1500.upload_port.0.pid=0x8055 +mkrnb1500.upload_port.1.vid=0x2341 +mkrnb1500.upload_port.1.pid=0x0055 +mkrnb1500.upload_port.2.board=mkrnb1500 mkrnb1500.upload.tool=bossac +mkrnb1500.upload.tool.default=bossac +mkrnb1500.upload.tool.network=arduino_ota mkrnb1500.upload.protocol=sam-ba mkrnb1500.upload.maximum_size=262144 mkrnb1500.upload.maximum_data_size=32768 @@ -351,6 +444,7 @@ mkrnb1500.build.variant=mkrnb1500 mkrnb1500.build.vid=0x2341 mkrnb1500.build.pid=0x8055 mkrnb1500.bootloader.tool=openocd +mkrnb1500.bootloader.tool.default=openocd mkrnb1500.bootloader.file=mkrnb1500/samd21_sam_ba_arduino_mkrnb1500.bin # Arduino MKR Vidor 4000 @@ -360,8 +454,15 @@ mkrvidor4000.vid.0=0x2341 mkrvidor4000.pid.0=0x8056 mkrvidor4000.vid.1=0x2341 mkrvidor4000.pid.1=0x0056 +mkrvidor4000.upload_port.0.vid=0x2341 +mkrvidor4000.upload_port.0.pid=0x8056 +mkrvidor4000.upload_port.1.vid=0x2341 +mkrvidor4000.upload_port.1.pid=0x0056 +mkrvidor4000.upload_port.2.board=mkrvidor4000 mkrvidor4000.upload.tool=bossacI +mkrvidor4000.upload.tool.default=bossacI +mkrvidor4000.upload.tool.network=arduino_ota mkrvidor4000.upload.protocol=sam-ba mkrvidor4000.upload.maximum_size=262144 mkrvidor4000.upload.maximum_data_size=32768 @@ -381,6 +482,7 @@ mkrvidor4000.build.variant=mkrvidor4000 mkrvidor4000.build.vid=0x2341 mkrvidor4000.build.pid=0x8056 mkrvidor4000.bootloader.tool=openocd +mkrvidor4000.bootloader.tool.default=openocd mkrvidor4000.bootloader.file=mkrvidor4000/samd21_sam_ba_arduino_mkrvidor4000.bin # Adafruit Circuit Playground M0 @@ -390,7 +492,14 @@ adafruit_circuitplayground_m0.vid.0=0x239A adafruit_circuitplayground_m0.pid.0=0x8018 adafruit_circuitplayground_m0.vid.1=0x239A adafruit_circuitplayground_m0.pid.1=0x0018 +adafruit_circuitplayground_m0.upload_port.0.vid=0x239A +adafruit_circuitplayground_m0.upload_port.0.pid=0x8018 +adafruit_circuitplayground_m0.upload_port.1.vid=0x239A +adafruit_circuitplayground_m0.upload_port.1.pid=0x0018 +adafruit_circuitplayground_m0.upload_port.2.board=adafruit_circuitplayground_m0 adafruit_circuitplayground_m0.upload.tool=bossac +adafruit_circuitplayground_m0.upload.tool.default=bossac +adafruit_circuitplayground_m0.upload.tool.network=arduino_ota adafruit_circuitplayground_m0.upload.protocol=sam-ba adafruit_circuitplayground_m0.upload.maximum_size=262144 adafruit_circuitplayground_m0.upload.maximum_data_size=32768 @@ -411,6 +520,7 @@ adafruit_circuitplayground_m0.build.variant_system_lib= adafruit_circuitplayground_m0.build.vid=0x239A adafruit_circuitplayground_m0.build.pid=0x8018 adafruit_circuitplayground_m0.bootloader.tool=openocd +adafruit_circuitplayground_m0.bootloader.tool.default=openocd adafruit_circuitplayground_m0.bootloader.file=circuitplay/circuitplay_m0_samd21g18_sam_ba.bin # Arduino M0 PRO (with) bootloader - Programming port @@ -418,7 +528,10 @@ adafruit_circuitplayground_m0.bootloader.file=circuitplay/circuitplay_m0_samd21g mzero_pro_bl_dbg.name=Arduino M0 Pro (Programming Port) mzero_pro_bl_dbg.vid.0=0x03eb mzero_pro_bl_dbg.pid.0=0x2111 +mzero_pro_bl_dbg.upload_port.0.vid=0x03eb +mzero_pro_bl_dbg.upload_port.0.pid=0x2111 mzero_pro_bl_dbg.upload.tool=openocd-withbootsize +mzero_pro_bl_dbg.upload.tool.default=openocd-withbootsize mzero_pro_bl_dbg.upload.protocol=sam-ba mzero_pro_bl_dbg.upload.maximum_size=262144 mzero_pro_bl_dbg.upload.maximum_data_size=32768 @@ -441,6 +554,7 @@ mzero_pro_bl_dbg.build.preferred_out_format=hex mzero_pro_bl_dbg.bootloader.size=0x4000 mzero_pro_bl_dbg.bootloader.tool=openocd-withbootsize +mzero_pro_bl_dbg.bootloader.tool.default=openocd-withbootsize mzero_pro_bl_dbg.bootloader.cmd_unprotect=at91samd bootloader 0 mzero_pro_bl_dbg.bootloader.cmd_protect=at91samd bootloader 16384 mzero_pro_bl_dbg.bootloader.cmd_protect_verify=at91samd bootloader @@ -457,7 +571,18 @@ mzero_pro_bl.vid.2=0x2a03 mzero_pro_bl.pid.2=0x004f mzero_pro_bl.vid.3=0x2a03 mzero_pro_bl.pid.3=0x804f +mzero_pro_bl.upload_port.0.vid=0x2a03 +mzero_pro_bl.upload_port.0.pid=0x004d +mzero_pro_bl.upload_port.1.vid=0x2a03 +mzero_pro_bl.upload_port.1.pid=0x804d +mzero_pro_bl.upload_port.2.vid=0x2a03 +mzero_pro_bl.upload_port.2.pid=0x004f +mzero_pro_bl.upload_port.3.vid=0x2a03 +mzero_pro_bl.upload_port.3.pid=0x804f +mzero_pro_bl.upload_port.4.board=mzero_pro_bl mzero_pro_bl.upload.tool=avrdude +mzero_pro_bl.upload.tool.default=avrdude +mzero_pro_bl.upload.tool.network=arduino_ota mzero_pro_bl.upload.protocol=stk500v2 mzero_pro_bl.upload.maximum_size=262144 mzero_pro_bl.upload.maximum_data_size=32768 @@ -481,6 +606,7 @@ mzero_pro_bl.build.preferred_out_format=hex mzero_pro_bl.bootloader.size=0x4000 mzero_pro_bl.build.emu.mcu=atmega2560 mzero_pro_bl.bootloader.tool=openocd-withbootsize +mzero_pro_bl.bootloader.tool.default=openocd-withbootsize mzero_pro_bl.bootloader.file=mzero/Bootloader_D21_M0_Pro_150427.hex mzero_pro_bl.bootloader.low_fuses=0xff @@ -495,7 +621,18 @@ mzero_bl.vid.2=0x2a03 mzero_bl.pid.2=0x004e mzero_bl.vid.3=0x2a03 mzero_bl.pid.3=0x804e +mzero_bl.upload_port.0.vid=0x2a03 +mzero_bl.upload_port.0.pid=0x004d +mzero_bl.upload_port.1.vid=0x2a03 +mzero_bl.upload_port.1.pid=0x804d +mzero_bl.upload_port.2.vid=0x2a03 +mzero_bl.upload_port.2.pid=0x004e +mzero_bl.upload_port.3.vid=0x2a03 +mzero_bl.upload_port.3.pid=0x804e +mzero_bl.upload_port.4.board=mzero_bl mzero_bl.upload.tool=avrdude +mzero_bl.upload.tool.default=avrdude +mzero_bl.upload.tool.network=arduino_ota mzero_bl.upload.protocol=stk500v2 mzero_bl.upload.maximum_size=262144 mzero_bl.upload.maximum_data_size=32768 @@ -519,6 +656,7 @@ mzero_bl.build.preferred_out_format=hex mzero_bl.bootloader.size=0x4000 mzero_bl.build.emu.mcu=atmega2560 mzero_bl.bootloader.tool=openocd-withbootsize +mzero_bl.bootloader.tool.default=openocd-withbootsize mzero_bl.bootloader.low_fuses=0xff mzero_bl.bootloader.file=mzero/Bootloader_D21_M0_150515.hex @@ -529,8 +667,13 @@ tian.upload.via_ssh=true tian.vid.0=0x10C4 tian.pid.0=0xEA70 tian.descriptor.0=Enhanced Com Port +tian.upload_port.0.vid=0x10C4 +tian.upload_port.0.pid=0xEA70 +tian.upload_port.1.board=tian tian.upload.tool=avrdude +tian.upload.tool.default=avrdude +tian.upload.tool.network=arduino_ota #tian.upload.protocol=stk500v2 tian.upload.protocol=wiring tian.upload.maximum_size=262144 @@ -555,6 +698,7 @@ tian.build.preferred_out_format=hex tian.bootloader.size=0x4000 tian.build.emu.mcu=atmega2560 tian.bootloader.tool=openocd-withbootsize +tian.bootloader.tool.default=openocd-withbootsize tian.bootloader.low_fuses=0xff tian.bootloader.file=sofia/Sofia_Tian_151118.hex tian.drivers=SiliconLabs-CP2105/Silicon Labs VCP Driver.pkg @@ -564,6 +708,8 @@ tian.drivers=SiliconLabs-CP2105/Silicon Labs VCP Driver.pkg tian_cons.name=Arduino Tian (MIPS Console port) tian_cons.vid.0=0x10C4 tian_cons.pid.0=0xEA70 +tian_cons.upload_port.0.vid=0x10C4 +tian_cons.upload_port.0.pid=0xEA70 tian_cons.descriptor.0=Standard Com Port tian_cons.hide=true tian_cons.build.board=SAMD_TIAN diff --git a/platform.txt b/platform.txt index a74bf0c56..631ca86dd 100644 --- a/platform.txt +++ b/platform.txt @@ -120,6 +120,11 @@ recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build recipe.size.regex=^(?:\.text|\.data|)\s+([0-9]+).* recipe.size.regex.data=^(?:\.data|\.bss)\s+([0-9]+).* +# Required discoveries and monitors +# --------------------------------- +pluggable_discovery.required.0=builtin:serial-discovery +pluggable_discovery.required.1=builtin:mdns-discovery +pluggable_monitor.required.serial=builtin:serial-monitor # Debugger configuration (general options) # ---------------------------------------- @@ -151,8 +156,8 @@ tools.avrdude.upload.pattern="{cmd}" "-C{config.path}" {upload.verbose} -p{build tools.avrdude_remote.upload.pattern="openocd --version 2>&1 | grep 2016 && if opkg update; then opkg upgrade openocd; exit 1; else echo 'Please connect your board to the Internet in order to upgrade tools' >&2; exit 1; fi || /usr/bin/run-avrdude /tmp/sketch.hex" -tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA -tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b +# the following rule is deprecated by pluggable discovery +tools.avrdude.upload.network_pattern="{tools.arduino_ota.cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b # # BOSSA @@ -167,9 +172,8 @@ tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port. tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R -arduinoota.extraflags= -tools.bossac.network_cmd={runtime.tools.arduinoOTA-1.3.0.path}/bin/arduinoOTA -tools.bossac.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b {arduinoota.extraflags} +# the following rule is deprecated by pluggable discovery +tools.bossac.upload.network_pattern="{tools.arduino_ota.cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b {arduinoota.extraflags} # # BOSSA (ignore binary size) @@ -184,8 +188,8 @@ tools.bossacI.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port tools.bossacI_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R -tools.bossacI.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA -tools.bossacI.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b +# the following rule is deprecated by pluggable discovery +tools.bossacI.upload.network_pattern="{tools.arduino_ota.cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b # @@ -200,8 +204,8 @@ tools.openocd.upload.params.verbose=-d2 tools.openocd.upload.params.quiet=-d0 tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "interface/{protocol}" -c "set telnet_port 0" {extra_params} -f "target/at91samdXX.cfg" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown" -tools.openocd.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA -tools.openocd.upload.network_pattern={network_cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b +# the following rule is deprecated by pluggable discovery +tools.openocd.upload.network_pattern={tools.arduino_ota.cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b tools.openocd.program.params.verbose=-d2 tools.openocd.program.params.quiet=-d0 @@ -241,3 +245,11 @@ tools.openocd-withbootsize.bootloader.params.verbose=-d2 tools.openocd-withbootsize.bootloader.params.quiet=-d0 tools.openocd-withbootsize.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown" +# +# Arduino OTA +# +arduinoota.extraflags= +tools.arduino_ota.cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.arduino_ota.upload.field.password=Password +tools.arduino_ota.upload.field.password.secret=true +tools.arduino_ota.upload.pattern="{cmd}" -address "{upload.port.address}" -port 65280 -username arduino -password "{upload.field.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b {arduinoota.extraflags} diff --git a/programmers.txt b/programmers.txt index abd65f81a..20318a8b5 100644 --- a/programmers.txt +++ b/programmers.txt @@ -18,22 +18,29 @@ edbg.name=Atmel EDBG edbg.communication=USB edbg.protocol=cmsis-dap.cfg edbg.program.tool=openocd +edbg.program.tool.default=openocd +edbg.program.extra_params= edbg.extra_params= atmel_ice.name=Atmel-ICE atmel_ice.communication=USB atmel_ice.protocol=cmsis-dap.cfg atmel_ice.program.tool=openocd +atmel_ice.program.tool.default=openocd +atmel_ice.program.extra_params= atmel_ice.extra_params= sam_ice.name=Atmel SAM-ICE sam_ice.communication=USB sam_ice.protocol=cmsis-dap.cfg sam_ice.program.tool=openocd +sam_ice.program.tool.default=openocd +sam_ice.program.extra_params= sam_ice.extra_params= jlink.name=Segger J-Link jlink.communication=USB jlink.protocol=jlink.cfg jlink.program.tool=openocd -jlink.extra_params=-c "transport select swd" \ No newline at end of file +jlink.program.tool.default=openocd +jlink.extra_params=-c "transport select swd" From 000db0c4b8007c71ebe4f45aa09ad996c4feb0af Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 9 Nov 2021 09:54:57 +0100 Subject: [PATCH 17/34] SPI: allow inheritance from SPIClass --- libraries/SPI/SPI.cpp | 46 +++++++++++++++++++++---------------------- libraries/SPI/SPI.h | 14 ++++++------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/libraries/SPI/SPI.cpp b/libraries/SPI/SPI.cpp index 111ce13b3..43a14f91f 100644 --- a/libraries/SPI/SPI.cpp +++ b/libraries/SPI/SPI.cpp @@ -48,7 +48,7 @@ static inline SercomSpiClockMode getDataMode(SPISettings& settings) { } } -SPIClass::SPIClass(SERCOM *p_sercom, uint8_t uc_pinMISO, uint8_t uc_pinSCK, uint8_t uc_pinMOSI, SercomSpiTXPad PadTx, SercomRXPad PadRx) +SPIClassSAMD::SPIClassSAMD(SERCOM *p_sercom, uint8_t uc_pinMISO, uint8_t uc_pinSCK, uint8_t uc_pinMOSI, SercomSpiTXPad PadTx, SercomRXPad PadRx) : settings(0, MSBFIRST, SPI_MODE0) { initialized = false; @@ -65,7 +65,7 @@ SPIClass::SPIClass(SERCOM *p_sercom, uint8_t uc_pinMISO, uint8_t uc_pinSCK, uint _padRx=PadRx; } -void SPIClass::begin() +void SPIClassSAMD::begin() { init(); @@ -77,7 +77,7 @@ void SPIClass::begin() config(DEFAULT_SPI_SETTINGS); } -void SPIClass::init() +void SPIClassSAMD::init() { if (initialized) return; @@ -87,7 +87,7 @@ void SPIClass::init() initialized = true; } -void SPIClass::config(SPISettings settings) +void SPIClassSAMD::config(SPISettings settings) { if (this->settings != settings) { this->settings = settings; @@ -105,7 +105,7 @@ void SPIClass::config(SPISettings settings) } } -void SPIClass::end() +void SPIClassSAMD::end() { _p_sercom->resetSPI(); initialized = false; @@ -121,7 +121,7 @@ static inline unsigned char __interruptsStatus(void) } #endif -void SPIClass::usingInterrupt(int interruptNumber) +void SPIClassSAMD::usingInterrupt(int interruptNumber) { if ((interruptNumber == NOT_AN_INTERRUPT) || (interruptNumber == EXTERNAL_INT_NMI)) return; @@ -141,7 +141,7 @@ void SPIClass::usingInterrupt(int interruptNumber) interrupts(); } -void SPIClass::notUsingInterrupt(int interruptNumber) +void SPIClassSAMD::notUsingInterrupt(int interruptNumber) { if ((interruptNumber == NOT_AN_INTERRUPT) || (interruptNumber == EXTERNAL_INT_NMI)) return; @@ -161,7 +161,7 @@ void SPIClass::notUsingInterrupt(int interruptNumber) interrupts(); } -void SPIClass::beginTransaction(SPISettings settings) +void SPIClassSAMD::beginTransaction(SPISettings settings) { if (interruptMode != SPI_IMODE_NONE) { @@ -177,7 +177,7 @@ void SPIClass::beginTransaction(SPISettings settings) config(settings); } -void SPIClass::endTransaction(void) +void SPIClassSAMD::endTransaction(void) { if (interruptMode != SPI_IMODE_NONE) { @@ -191,7 +191,7 @@ void SPIClass::endTransaction(void) } } -void SPIClass::setBitOrder(BitOrder order) +void SPIClassSAMD::setBitOrder(BitOrder order) { if (order == LSBFIRST) { _p_sercom->setDataOrderSPI(LSB_FIRST); @@ -200,7 +200,7 @@ void SPIClass::setBitOrder(BitOrder order) } } -void SPIClass::setDataMode(uint8_t mode) +void SPIClassSAMD::setDataMode(uint8_t mode) { switch (mode) { @@ -225,7 +225,7 @@ void SPIClass::setDataMode(uint8_t mode) } } -void SPIClass::setClockDivider(uint8_t div) +void SPIClassSAMD::setClockDivider(uint8_t div) { if (div < SPI_MIN_CLOCK_DIVIDER) { _p_sercom->setBaudrateSPI(SPI_MIN_CLOCK_DIVIDER); @@ -234,12 +234,12 @@ void SPIClass::setClockDivider(uint8_t div) } } -byte SPIClass::transfer(uint8_t data) +byte SPIClassSAMD::transfer(uint8_t data) { return _p_sercom->transferDataSPI(data); } -uint16_t SPIClass::transfer16(uint16_t data) { +uint16_t SPIClassSAMD::transfer16(uint16_t data) { union { uint16_t val; struct { uint8_t lsb; uint8_t msb; }; } t; t.val = data; @@ -255,7 +255,7 @@ uint16_t SPIClass::transfer16(uint16_t data) { return t.val; } -void SPIClass::transfer(void *buf, size_t count) +void SPIClassSAMD::transfer(void *buf, size_t count) { uint8_t *buffer = reinterpret_cast(buf); for (size_t i=0; i 1 - SPIClass SPI1(&PERIPH_SPI1, PIN_SPI1_MISO, PIN_SPI1_SCK, PIN_SPI1_MOSI, PAD_SPI1_TX, PAD_SPI1_RX); + SPIClassSAMD SPI1(&PERIPH_SPI1, PIN_SPI1_MISO, PIN_SPI1_SCK, PIN_SPI1_MOSI, PAD_SPI1_TX, PAD_SPI1_RX); #endif #if SPI_INTERFACES_COUNT > 2 - SPIClass SPI2(&PERIPH_SPI2, PIN_SPI2_MISO, PIN_SPI2_SCK, PIN_SPI2_MOSI, PAD_SPI2_TX, PAD_SPI2_RX); + SPIClassSAMD SPI2(&PERIPH_SPI2, PIN_SPI2_MISO, PIN_SPI2_SCK, PIN_SPI2_MOSI, PAD_SPI2_TX, PAD_SPI2_RX); #endif #if SPI_INTERFACES_COUNT > 3 - SPIClass SPI3(&PERIPH_SPI3, PIN_SPI3_MISO, PIN_SPI3_SCK, PIN_SPI3_MOSI, PAD_SPI3_TX, PAD_SPI3_RX); + SPIClassSAMD SPI3(&PERIPH_SPI3, PIN_SPI3_MISO, PIN_SPI3_SCK, PIN_SPI3_MOSI, PAD_SPI3_TX, PAD_SPI3_RX); #endif #if SPI_INTERFACES_COUNT > 4 - SPIClass SPI4(&PERIPH_SPI4, PIN_SPI4_MISO, PIN_SPI4_SCK, PIN_SPI4_MOSI, PAD_SPI4_TX, PAD_SPI4_RX); + SPIClassSAMD SPI4(&PERIPH_SPI4, PIN_SPI4_MISO, PIN_SPI4_SCK, PIN_SPI4_MOSI, PAD_SPI4_TX, PAD_SPI4_RX); #endif #if SPI_INTERFACES_COUNT > 5 - SPIClass SPI5(&PERIPH_SPI5, PIN_SPI5_MISO, PIN_SPI5_SCK, PIN_SPI5_MOSI, PAD_SPI5_TX, PAD_SPI5_RX); + SPIClassSAMD SPI5(&PERIPH_SPI5, PIN_SPI5_MISO, PIN_SPI5_SCK, PIN_SPI5_MOSI, PAD_SPI5_TX, PAD_SPI5_RX); #endif diff --git a/libraries/SPI/SPI.h b/libraries/SPI/SPI.h index 5a266f70d..b1184e460 100644 --- a/libraries/SPI/SPI.h +++ b/libraries/SPI/SPI.h @@ -87,25 +87,25 @@ class SPIClassSAMD : public arduino::HardwareSPI { uint32_t interruptMask; }; -#define SPIClass SPIClassSAMD +//#define SPIClass SPIClassSAMD #if SPI_INTERFACES_COUNT > 0 - extern SPIClass SPI; + extern SPIClassSAMD SPI; #endif #if SPI_INTERFACES_COUNT > 1 - extern SPIClass SPI1; + extern SPIClassSAMD SPI1; #endif #if SPI_INTERFACES_COUNT > 2 - extern SPIClass SPI2; + extern SPIClassSAMD SPI2; #endif #if SPI_INTERFACES_COUNT > 3 - extern SPIClass SPI3; + extern SPIClassSAMD SPI3; #endif #if SPI_INTERFACES_COUNT > 4 - extern SPIClass SPI4; + extern SPIClassSAMD SPI4; #endif #if SPI_INTERFACES_COUNT > 5 - extern SPIClass SPI5; + extern SPIClassSAMD SPI5; #endif // For compatibility with sketches designed for AVR @ 16 MHz From beffd08837f8cd6f5dc7f4077c013ada4e28817a Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 9 Nov 2021 16:55:39 +0100 Subject: [PATCH 18/34] Release 1.8.12 --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index 631ca86dd..520c2eb08 100644 --- a/platform.txt +++ b/platform.txt @@ -20,7 +20,7 @@ # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification name=Arduino SAMD (32-bits ARM Cortex-M0+) Boards -version=1.8.11 +version=1.8.12 # Compile variables # ----------------- From 2d1fb4870c3c97d8f2724d8faef8c01a090dc6bb Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 9 Nov 2021 17:30:14 +0100 Subject: [PATCH 19/34] Add AWS_REGION env variable to fix deploy --- .github/workflows/release.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d7e23178f..84ff482c4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -60,6 +60,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: "us-east-1" # or https://github.com/aws/aws-cli/issues/5623 run: | aws s3 sync extras/staging/ s3://${{ secrets.ARDUINO_DOWNLOADS_BUCKET }}/packages/staging/ --exclude "*" --include *.json aws s3 sync extras/staging/ s3://${{ secrets.ARDUINO_DOWNLOADS_BUCKET }}/cores/staging/ --exclude "*" --include *.tar.bz2 @@ -104,4 +105,4 @@ jobs: SLACK_TITLE: Arduino core pre-release SLACK_MESSAGE: 'Version ${{ env.TAG_VERSION }} of core ${{ env.REPOSITORY_NAME }} is now available' SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - MSG_MINIMAL: true \ No newline at end of file + MSG_MINIMAL: true From 719d9c64725534709437e7a09577252e3d69532d Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 27 Nov 2021 22:20:09 -0800 Subject: [PATCH 20/34] Remove programmer properties from openocd upload pattern Platform properties may be associated with a specific programmer selection in the programmers.txt configuration file. These properties can be used in the platform.txt patterns for the actions that use the programmer: - `program` - `erase` - `bootloader` However, those properties are not expanded in the `upload` pattern, since it does not use the programmer: https://arduino.github.io/arduino-cli/dev/platform-specification/#programmerstxt > These properties can only be used in the recipes of the actions that use the programmer (erase, bootloader, and program). While enhancing the ability to make programmer-specific configuration of the patterns, programmer-associated properties were introduced into `tools.openocd.upload.pattern`, which caused uploads to fail for the "Arduino Zero (Programming Port)" board: ``` Unexpected command line argument: {extra_params} ``` The upload pattern is hereby reverted to the previous working configuration, leaving the beneficial changes to the other patterns. --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index 520c2eb08..927c1e826 100644 --- a/platform.txt +++ b/platform.txt @@ -202,7 +202,7 @@ tools.openocd.cmd.windows=bin/openocd.exe tools.openocd.upload.params.verbose=-d2 tools.openocd.upload.params.quiet=-d0 -tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "interface/{protocol}" -c "set telnet_port 0" {extra_params} -f "target/at91samdXX.cfg" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown" +tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown" # the following rule is deprecated by pluggable discovery tools.openocd.upload.network_pattern={tools.arduino_ota.cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b From e16354443899fe77ea724452fa5a9272689a5a99 Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Tue, 30 Nov 2021 12:04:46 +0100 Subject: [PATCH 21/34] Fix legacy upload.network_pattern rules --- platform.txt | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/platform.txt b/platform.txt index 927c1e826..99f1968a5 100644 --- a/platform.txt +++ b/platform.txt @@ -156,8 +156,10 @@ tools.avrdude.upload.pattern="{cmd}" "-C{config.path}" {upload.verbose} -p{build tools.avrdude_remote.upload.pattern="openocd --version 2>&1 | grep 2016 && if opkg update; then opkg upgrade openocd; exit 1; else echo 'Please connect your board to the Internet in order to upgrade tools' >&2; exit 1; fi || /usr/bin/run-avrdude /tmp/sketch.hex" -# the following rule is deprecated by pluggable discovery -tools.avrdude.upload.network_pattern="{tools.arduino_ota.cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b +# The following rule is deprecated by pluggable discovery. +# We keep it to avoid breaking compatibility with the Arduino Java IDE. +tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b # # BOSSA @@ -172,8 +174,10 @@ tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port. tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R -# the following rule is deprecated by pluggable discovery -tools.bossac.upload.network_pattern="{tools.arduino_ota.cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b {arduinoota.extraflags} +# The following rule is deprecated by pluggable discovery. +# We keep it to avoid breaking compatibility with the Arduino Java IDE. +tools.bossac.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.bossac.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b {arduinoota.extraflags} # # BOSSA (ignore binary size) @@ -188,8 +192,10 @@ tools.bossacI.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port tools.bossacI_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R -# the following rule is deprecated by pluggable discovery -tools.bossacI.upload.network_pattern="{tools.arduino_ota.cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b +# The following rule is deprecated by pluggable discovery. +# We keep it to avoid breaking compatibility with the Arduino Java IDE. +tools.bossacI.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.bossacI.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b # @@ -204,8 +210,10 @@ tools.openocd.upload.params.verbose=-d2 tools.openocd.upload.params.quiet=-d0 tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown" -# the following rule is deprecated by pluggable discovery -tools.openocd.upload.network_pattern={tools.arduino_ota.cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b +# The following rule is deprecated by pluggable discovery. +# We keep it to avoid breaking compatibility with the Arduino Java IDE. +tools.openocd.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.openocd.upload.network_pattern={network_cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b tools.openocd.program.params.verbose=-d2 tools.openocd.program.params.quiet=-d0 From 7e2d6273b5c057f066f3e52353e0a0b5c06a9e9e Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 3 Dec 2021 16:22:37 +0100 Subject: [PATCH 22/34] Make SerialCDC inherit from HardwareSerial As suggested by @thiagoralves --- cores/arduino/USB/CDC.cpp | 2 +- cores/arduino/USB/USBAPI.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cores/arduino/USB/CDC.cpp b/cores/arduino/USB/CDC.cpp index c8314c2bb..77aa6832a 100644 --- a/cores/arduino/USB/CDC.cpp +++ b/cores/arduino/USB/CDC.cpp @@ -201,7 +201,7 @@ void Serial_::begin(uint32_t /* baud_count */) // uart config is ignored in USB-CDC } -void Serial_::begin(uint32_t /* baud_count */, uint8_t /* config */) +void Serial_::begin(uint32_t /* baud_count */, uint16_t /* config */) { // uart config is ignored in USB-CDC } diff --git a/cores/arduino/USB/USBAPI.h b/cores/arduino/USB/USBAPI.h index 07633825d..d14944a32 100644 --- a/cores/arduino/USB/USBAPI.h +++ b/cores/arduino/USB/USBAPI.h @@ -32,6 +32,7 @@ #include "Arduino.h" #include "api/Stream.h" #include "api/RingBuffer.h" +#include "api/HardwareSerial.h" #include "api/USBAPI.h" #include "CDC.h" @@ -96,12 +97,12 @@ extern USBDeviceClass USBDevice; //================================================================================ // Serial over CDC (Serial1 is the physical port) -class Serial_ : public arduino::Stream, public arduino::PluggableUSBModule +class Serial_ : public arduino::HardwareSerial, arduino::PluggableUSBModule { public: Serial_(USBDeviceClass &_usb); void begin(uint32_t baud_count); - void begin(unsigned long, uint8_t); + void begin(unsigned long, uint16_t); void end(void); virtual int available(void); From ed21e120116845636abb51fc9a3a4abcbb391d22 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 8 Feb 2022 11:05:55 +0100 Subject: [PATCH 23/34] Create LICENSE --- LICENSE | 504 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 504 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..8000a6faa --- /dev/null +++ b/LICENSE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random + Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! From b2102c88154ac1f445da05e71517e8c086094daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Schneider?= Date: Sat, 19 Feb 2022 00:00:45 +0100 Subject: [PATCH 24/34] Fix USBDevice.connected() * Fix arduino/ArduinoCore-samd#661 * connected() did not return the USB connected state, but essentially a random value. --- cores/arduino/USB/USBCore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/arduino/USB/USBCore.cpp b/cores/arduino/USB/USBCore.cpp index f8322436f..5f22739fb 100644 --- a/cores/arduino/USB/USBCore.cpp +++ b/cores/arduino/USB/USBCore.cpp @@ -480,8 +480,8 @@ void USBDeviceClass::stall(uint32_t ep) bool USBDeviceClass::connected() { // Count frame numbers - uint8_t f = USB->DEVICE.FNUM.bit.FNUM; - //delay(3); + uint16_t f = USB->DEVICE.FNUM.bit.FNUM; + delay(1); // wait for next SOF return f != USB->DEVICE.FNUM.bit.FNUM; } From 3fd369e14e7508927f4b4c2c278e3d94356a4782 Mon Sep 17 00:00:00 2001 From: Spegs21 Date: Tue, 22 Feb 2022 05:18:08 -0500 Subject: [PATCH 25/34] Update HID.h with report types (#602) Add missing #define statements when compared to AVR library. Support for readbytes with a byte/uint8_t buffer --- cores/arduino/USB/USBAPI.h | 1 + libraries/HID/HID.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cores/arduino/USB/USBAPI.h b/cores/arduino/USB/USBAPI.h index d14944a32..cfd3eb856 100644 --- a/cores/arduino/USB/USBAPI.h +++ b/cores/arduino/USB/USBAPI.h @@ -117,6 +117,7 @@ class Serial_ : public arduino::HardwareSerial, arduino::PluggableUSBModule operator bool(); size_t readBytes(char *buffer, size_t length); + size_t readBytes( uint8_t *buffer, size_t length) { return readBytes((char *)buffer, length); } // This method allows processing "SEND_BREAK" requests sent by // the USB host. Those requests indicate that the host wants to diff --git a/libraries/HID/HID.h b/libraries/HID/HID.h index 0148daeaf..698c4a0a7 100644 --- a/libraries/HID/HID.h +++ b/libraries/HID/HID.h @@ -54,6 +54,11 @@ #define HID_BOOT_PROTOCOL 0 #define HID_REPORT_PROTOCOL 1 +// HID Request Type HID1.11 Page 51 7.2.1 Get_Report Request +#define HID_REPORT_TYPE_INPUT 1 +#define HID_REPORT_TYPE_OUTPUT 2 +#define HID_REPORT_TYPE_FEATURE 3 + typedef struct { uint8_t len; // 9 From 5ae2f68c0e1caeede4246c5c0052eb17d2b69698 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 23 Feb 2022 10:52:06 +0100 Subject: [PATCH 26/34] Release 1.8.13 --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index 99f1968a5..3071243ec 100644 --- a/platform.txt +++ b/platform.txt @@ -20,7 +20,7 @@ # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification name=Arduino SAMD (32-bits ARM Cortex-M0+) Boards -version=1.8.12 +version=1.8.13 # Compile variables # ----------------- From b52412e72801d63fd25865687fcc68ea79244a7e Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 8 Jun 2022 10:17:21 +0200 Subject: [PATCH 27/34] Fixed Serial_::begin(..) definition to match arduino::HardwareSerial This is usually not a problem becuase we use the arm-none-eabi-gcc compiler thas has type `uint32_t` aliased to `unsigned long`. Anyway this is not mandatory in general, and the compiler may choose to alias `uint32_t` with `unsigned int` as it happens with llvm/clang. Since we use clangd as language server on the Arduino IDE 2.0 the Serial_ object and all the derived instances (Serial, SerialUSB, ...) are not available in code-completion suggestions. --- cores/arduino/USB/CDC.cpp | 4 ++-- cores/arduino/USB/USBAPI.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cores/arduino/USB/CDC.cpp b/cores/arduino/USB/CDC.cpp index 77aa6832a..8d6c6f4b8 100644 --- a/cores/arduino/USB/CDC.cpp +++ b/cores/arduino/USB/CDC.cpp @@ -196,12 +196,12 @@ void Serial_::enableInterrupt() { usbd.epBank0EnableTransferComplete(CDC_ENDPOINT_OUT); } -void Serial_::begin(uint32_t /* baud_count */) +void Serial_::begin(unsigned long /* baudrate */) { // uart config is ignored in USB-CDC } -void Serial_::begin(uint32_t /* baud_count */, uint16_t /* config */) +void Serial_::begin(unsigned long /* baudrate */, uint16_t /* config */) { // uart config is ignored in USB-CDC } diff --git a/cores/arduino/USB/USBAPI.h b/cores/arduino/USB/USBAPI.h index cfd3eb856..b06b5e56e 100644 --- a/cores/arduino/USB/USBAPI.h +++ b/cores/arduino/USB/USBAPI.h @@ -101,8 +101,8 @@ class Serial_ : public arduino::HardwareSerial, arduino::PluggableUSBModule { public: Serial_(USBDeviceClass &_usb); - void begin(uint32_t baud_count); - void begin(unsigned long, uint16_t); + void begin(unsigned long baudrate); + void begin(unsigned long baudrate, uint16_t config); void end(void); virtual int available(void); From 89833081ef18aea430b8943ab653dbbd510d43ce Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 8 Aug 2022 09:47:04 +0200 Subject: [PATCH 28/34] Document how to add the required link to ArduinoCore-API. (#676) * Document how to add the required link to ArduinoCore-API. Related to https://github.com/arduino/ArduinoCore-API/issues/96. * Update README.md Co-authored-by: per1234 * Update README.md Co-authored-by: per1234 * Update README.md Co-authored-by: per1234 * Update README.md Co-authored-by: per1234 Co-authored-by: per1234 --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index b8bcac199..b37a11f0f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,33 @@ to avoid duplicates. Contributions are always welcome. The preferred way to receive code contribution is by submitting a Pull Request on github. +## Developing + +1. Clone the [ArduinoCore-API](https://github.com/arduino/ArduinoCore-API) repo to any convenient location: + ``` + git clone https://github.com/arduino/ArduinoCore-API.git + ``` +1. Create an `/hardware/arduino-git` folder, where `` is the location of your + Arduino sketchbook. +1. Change directories: + ``` + cd /hardware/arduino-git + ``` +1. Clone this repo: + ``` + git clone https://github.com/arduino/ArduinoCore-samd.git samd + ``` +1. Change directories: + ``` + cd samd/cores/arduino + ``` +1. Copy or symlink the `api` folder from the [ArduinoCore-API](https://github.com/arduino/ArduinoCore-API) repo: + ``` + ln -s /api . + ``` + where `` is the location where you've cloned the ArduinoCore-API repository to. +1. Restart the IDE. + ## Hourly builds This repository is under a Continuous Integration system that every hour checks if there are updates and From 84e222feb65cc72d11800f523410c632446e1441 Mon Sep 17 00:00:00 2001 From: Shahzada Khoso <34662908+Khosos@users.noreply.github.com> Date: Sat, 21 Jan 2023 17:07:00 -0500 Subject: [PATCH 29/34] Update I2S.cpp to work with RTCZero library I2S.cpp configures the clock without specifying what to GLCK->DIVSEL bit. This causes issues when the bit is set to 1 by other libraries such as RTCZero. Explicitly setting this value fixes the problem. --- libraries/I2S/src/I2S.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/I2S/src/I2S.cpp b/libraries/I2S/src/I2S.cpp index a62bc5114..8b0cc3979 100644 --- a/libraries/I2S/src/I2S.cpp +++ b/libraries/I2S/src/I2S.cpp @@ -422,6 +422,7 @@ void I2SClass::enableClock(int divider) GCLK->GENCTRL.bit.ID = _clockGenerator; GCLK->GENCTRL.bit.SRC = src; GCLK->GENCTRL.bit.IDC = 1; + GCLK->GENCTRL.bit.DIVSEL = 0; GCLK->GENCTRL.bit.GENEN = 1; // enable From afeba438adb97cf804c531158383dd74cc5b70be Mon Sep 17 00:00:00 2001 From: Josefine Hansson <66409231+jhansson-ard@users.noreply.github.com> Date: Mon, 20 Feb 2023 10:25:55 +0100 Subject: [PATCH 30/34] Updated naming of MKR boards Updated some names of MKR boards, see changes! @facchinm --- boards.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards.txt b/boards.txt index 20ad6b63b..343eda6db 100644 --- a/boards.txt +++ b/boards.txt @@ -98,7 +98,7 @@ arduino_zero_native.bootloader.file=zero/samd21_sam_ba.bin # Arduino MKR1000 # ----------------------- -mkr1000.name=Arduino MKR1000 +mkr1000.name=Arduino MKR 1000 WiFi mkr1000.vid.0=0x2341 mkr1000.pid.0=0x804e mkr1000.vid.1=0x2341 @@ -144,7 +144,7 @@ mkr1000.bootloader.file=mkr1000/samd21_sam_ba_arduino_mkr1000.bin # Arduino MKRZero # --------------- -mkrzero.name=Arduino MKRZERO +mkrzero.name=Arduino MKR Zero mkrzero.vid.0=0x2341 mkrzero.pid.0=0x804f mkrzero.vid.1=0x2341 From db94399db5309d645a89793a8e466fbce4596bc2 Mon Sep 17 00:00:00 2001 From: Josefine Hansson <66409231+jhansson-ard@users.noreply.github.com> Date: Mon, 20 Feb 2023 10:59:45 +0100 Subject: [PATCH 31/34] Updated naming of boards Updated some naming of the products @facchinm --- extras/package_index.json.NewTag.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/package_index.json.NewTag.template b/extras/package_index.json.NewTag.template index 2fda427c3..6758be754 100644 --- a/extras/package_index.json.NewTag.template +++ b/extras/package_index.json.NewTag.template @@ -24,8 +24,8 @@ "boards": [ { "name": "Arduino MKR WiFi 1010" }, { "name": "Arduino Zero" }, - { "name": "Arduino MKR1000" }, - { "name": "Arduino MKRZERO" }, + { "name": "Arduino MKR 1000" }, + { "name": "Arduino MKR Zero" }, { "name": "Arduino MKR FOX 1200" }, { "name": "Arduino MKR WAN 1300" }, { "name": "Arduino MKR WAN 1310" }, From d0ae34d293645c0c06fda4b80958924e0fa6f216 Mon Sep 17 00:00:00 2001 From: Pascal Romahn Date: Tue, 28 Nov 2023 12:05:36 +0100 Subject: [PATCH 32/34] Move lineinfo into class instead of static variable --- cores/arduino/USB/CDC.cpp | 16 ---------------- cores/arduino/USB/CDC.h | 8 ++++++++ cores/arduino/USB/USBAPI.h | 8 ++++++++ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cores/arduino/USB/CDC.cpp b/cores/arduino/USB/CDC.cpp index 8d6c6f4b8..7b5bd5643 100644 --- a/cores/arduino/USB/CDC.cpp +++ b/cores/arduino/USB/CDC.cpp @@ -42,22 +42,6 @@ extern USBDevice_SAMD21G18x usbd; extern USBDeviceClass USBDevice; -typedef struct { - uint32_t dwDTERate; - uint8_t bCharFormat; - uint8_t bParityType; - uint8_t bDataBits; - uint8_t lineState; -} LineInfo; - -static volatile LineInfo _usbLineInfo = { - 115200, // dWDTERate - 0x00, // bCharFormat - 0x00, // bParityType - 0x08, // bDataBits - 0x00 // lineState -}; - static volatile int32_t breakValue = -1; // CDC diff --git a/cores/arduino/USB/CDC.h b/cores/arduino/USB/CDC.h index 8e88db5b5..ee5aa07d9 100644 --- a/cores/arduino/USB/CDC.h +++ b/cores/arduino/USB/CDC.h @@ -73,6 +73,14 @@ typedef struct EndpointDescriptor out; } CDCDescriptor; +typedef struct { + uint32_t dwDTERate; + uint8_t bCharFormat; + uint8_t bParityType; + uint8_t bDataBits; + uint8_t lineState; +} LineInfo; + #endif #endif \ No newline at end of file diff --git a/cores/arduino/USB/USBAPI.h b/cores/arduino/USB/USBAPI.h index b06b5e56e..c1cee4ce0 100644 --- a/cores/arduino/USB/USBAPI.h +++ b/cores/arduino/USB/USBAPI.h @@ -176,6 +176,14 @@ friend USBDeviceClass; bool stalled; unsigned int epType[3]; + volatile LineInfo _usbLineInfo = { + 115200, // dWDTERate + 0x00, // bCharFormat + 0x00, // bParityType + 0x08, // bDataBits + 0x00 // lineState + }; + }; extern Serial_ SerialUSB; From f66c53653e8b0ddfee90264b58beb0fa033181ce Mon Sep 17 00:00:00 2001 From: Henk van der Laak Date: Fri, 22 Dec 2023 02:59:03 +0100 Subject: [PATCH 33/34] Fix variant docs Issue #507 --- variants/mkr1000/variant.cpp | 14 +++++++------- variants/mkrfox1200/variant.cpp | 10 +++++----- variants/mkrgsm1400/variant.cpp | 10 +++++----- variants/mkrnb1500/variant.cpp | 10 +++++----- variants/mkrwan1300/variant.cpp | 4 ++-- variants/mkrwifi1010/variant.cpp | 10 +++++----- variants/mkrzero/variant.cpp | 10 +++++----- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/variants/mkr1000/variant.cpp b/variants/mkr1000/variant.cpp index 79c2d8e0e..025d9540c 100644 --- a/variants/mkr1000/variant.cpp +++ b/variants/mkr1000/variant.cpp @@ -57,8 +57,8 @@ const PinDescription g_APinDescription[] = { | 10 | MISO | PA19 | | 03 | | | X07 | | *1/03 | 3/03 |* TC3/1 | TCC0/3 | I2S/SD0 | AC/CMP1 | +------------+------------------+--------+-----------------+--------------------+-----+-----+---------+---------+--------+--------+----------+----------+ | | Wire | | | | | | | | | | | | | | - | 11 | SDA | PA08 | | NMI | *16 | | X00 | | *0/00 | 2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | - | 12 | SCL | PA09 | | 09 | *17 | | X01 | | *0/01 | 2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | + | 11 | SDA | PA08 | | NMI | *16 | | X00 | | 0/00 | *2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | + | 12 | SCL | PA09 | | 09 | *17 | | X01 | | 0/01 | *2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | Serial1 | | | | | | | | | | | | | | | 13 | RX | PB23 | | 07 | | | | | | *5/03 | | | | GCLK_IO1 | @@ -71,8 +71,8 @@ const PinDescription g_APinDescription[] = { { PORTA, 19, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_NONE }, // MISO: SERCOM1/PAD[3] // PINOUT=0 - { PORTA, 8, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), ADC_Channel16, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // SDA: SERCOM4/PAD[0] - { PORTA, 9, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL ), ADC_Channel17, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCL: SERCOM4/PAD[1] + { PORTA, 8, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), ADC_Channel16, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // SDA: SERCOM2/PAD[0] + { PORTA, 9, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL ), ADC_Channel17, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCL: SERCOM2/PAD[1] // RXPO=3 TXPO=1 { PORTB, 23, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // RX: SERCOM5/PAD[3] @@ -129,10 +129,10 @@ const PinDescription g_APinDescription[] = { | | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | ATWINC1501B SPI | | | | | | | | | | | | | | - | 26 | | PA12 | WINC MOSI | 12 | | | | | *2/00 | 4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | - | 27 | | PA13 | WINC SCK | 13 | | | | | *2/01 | 4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | + | 26 | | PA12 | WINC MOSI | 12 | | | | | 2/00 | *4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | + | 27 | | PA13 | WINC SCK | 13 | | | | | 2/01 | *4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | | 28 | | PA14 | WINC SSN | 14 | | | | | 2/02 | 4/02 | TC3/0 | TCC0/4 | | GCLK_IO0 | - | 29 | | PA15 | WINC MISO | 15 | | | | | *2/03 | 4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | + | 29 | | PA15 | WINC MISO | 15 | | | | | 2/03 | *4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | ATWINC1501B PINS | | | | | | | | | | | | | | | 30 | | PA27 | WINC RESETN_WIFI| 15 | | | | | | | | | | GCLK_IO0 | diff --git a/variants/mkrfox1200/variant.cpp b/variants/mkrfox1200/variant.cpp index 2c55ed00c..daff78af2 100644 --- a/variants/mkrfox1200/variant.cpp +++ b/variants/mkrfox1200/variant.cpp @@ -57,8 +57,8 @@ const PinDescription g_APinDescription[] = { | 10 | MISO | PA19 | | 03 | | | X07 | | *1/03 | 3/03 |* TC3/1 | TCC0/3 | I2S/SD0 | AC/CMP1 | +------------+------------------+--------+-----------------+--------------------+-----+-----+---------+---------+--------+--------+----------+----------+ | | Wire | | | | | | | | | | | | | | - | 11 | SDA | PA08 | | NMI | *16 | | X00 | | *0/00 | 2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | - | 12 | SCL | PA09 | | 09 | *17 | | X01 | | *0/01 | 2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | + | 11 | SDA | PA08 | | NMI | *16 | | X00 | | 0/00 | *2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | + | 12 | SCL | PA09 | | 09 | *17 | | X01 | | 0/01 | *2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | Serial1 | | | | | | | | | | | | | | | 13 | RX | PB23 | | 07 | | | | | | *5/03 | | | | GCLK_IO1 | @@ -129,10 +129,10 @@ const PinDescription g_APinDescription[] = { | | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | SD SPI | | | | | | | | | | | | | | - | 26 | | PA12 | SIGFOX SCK | 12 | | | | | *2/00 | 4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | - | 27 | | PA13 | SIGFOX MOSI | 13 | | | | | *2/01 | 4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | + | 26 | | PA12 | SIGFOX SCK | 12 | | | | | 2/00 | *4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | + | 27 | | PA13 | SIGFOX MOSI | 13 | | | | | 2/01 | *4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | | 28 | | PA14 | SIGFOX SS | 14 | | | | | 2/02 | 4/02 | TC3/0 | TCC0/4 | | GCLK_IO0 | - | 29 | | PA15 | SIGFOX MISO | 15 | | | | | *2/03 | 4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | + | 29 | | PA15 | SIGFOX MISO | 15 | | | | | 2/03 | *4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | | 30 | | PA27 | SIGFOX RES | 15 | | | | | | | | | | GCLK_IO0 | | 31 | | PA28 | SIGFOX PWRON | 08 | | | | | | | | | | GCLK_IO0 | | 32 | | PB08 | ADC_BATTERY | 08 | 02 | | Y14 | | | 4/00 | TC4/0 | | | | diff --git a/variants/mkrgsm1400/variant.cpp b/variants/mkrgsm1400/variant.cpp index 2b25934b2..108475dce 100644 --- a/variants/mkrgsm1400/variant.cpp +++ b/variants/mkrgsm1400/variant.cpp @@ -58,8 +58,8 @@ const PinDescription g_APinDescription[] = { | 10 | MISO | PA19 | | 03 | | | X07 | | *1/03 | 3/03 |* TC3/1 | TCC0/3 | I2S/SD0 | AC/CMP1 | +------------+------------------+--------+-----------------+--------------------+-----+-----+---------+---------+--------+--------+----------+----------+ | | Wire | | | | | | | | | | | | | | - | 11 | SDA | PA08 | | NMI | *16 | | X00 | | *0/00 | 2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | - | 12 | SCL | PA09 | | 09 | *17 | | X01 | | *0/01 | 2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | + | 11 | SDA | PA08 | | NMI | *16 | | X00 | | 0/00 | *2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | + | 12 | SCL | PA09 | | 09 | *17 | | X01 | | 0/01 | *2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | Serial1 | | | | | | | | | | | | | | | 13 | RX | PB23 | | 07 | | | | | | *5/03 | | | | GCLK_IO1 | @@ -130,10 +130,10 @@ const PinDescription g_APinDescription[] = { | | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | SD SPI | | | | | | | | | | | | | | - | 26 | | PA12 | GSM_TX | 12 | | | | | *2/00 | 4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | - | 27 | | PA13 | GSM_RX | 13 | | | | | *2/01 | 4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | + | 26 | | PA12 | GSM_TX | 12 | | | | | 2/00 | *4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | + | 27 | | PA13 | GSM_RX | 13 | | | | | 2/01 | *4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | | 28 | | PA14 | GSM_RTS | 14 | | | | | 2/02 | 4/02 | TC3/0 | TCC0/4 | | GCLK_IO0 | - | 29 | | PA15 | GSM_CTS | 15 | | | | | *2/03 | 4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | + | 29 | | PA15 | GSM_CTS | 15 | | | | | 2/03 | *4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | | 30 | | PA27 | PMIC_IRQ | *15 | | | | | | | | | | GCLK_IO0 | | 31 | | PB08 | GSM_RESETN | 08 | 02 | | Y14 | | | 4/00 | TC4/0 | | | | | 32 | | PB09 | ADC_VBAT | *09 | 03 | | Y15 | | | 4/01 | TC4/1 | | | | diff --git a/variants/mkrnb1500/variant.cpp b/variants/mkrnb1500/variant.cpp index 5e61669e5..0b2206f74 100644 --- a/variants/mkrnb1500/variant.cpp +++ b/variants/mkrnb1500/variant.cpp @@ -58,8 +58,8 @@ const PinDescription g_APinDescription[] = { | 10 | MISO | PA19 | | 03 | | | X07 | | *1/03 | 3/03 |* TC3/1 | TCC0/3 | I2S/SD0 | AC/CMP1 | +------------+------------------+--------+-----------------+--------------------+-----+-----+---------+---------+--------+--------+----------+----------+ | | Wire | | | | | | | | | | | | | | - | 11 | SDA | PA08 | | NMI | *16 | | X00 | | *0/00 | 2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | - | 12 | SCL | PA09 | | 09 | *17 | | X01 | | *0/01 | 2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | + | 11 | SDA | PA08 | | NMI | *16 | | X00 | | 0/00 | *2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | + | 12 | SCL | PA09 | | 09 | *17 | | X01 | | 0/01 | *2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | Serial1 | | | | | | | | | | | | | | | 13 | RX | PB23 | | 07 | | | | | | *5/03 | | | | GCLK_IO1 | @@ -130,10 +130,10 @@ const PinDescription g_APinDescription[] = { | | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | SD SPI | | | | | | | | | | | | | | - | 26 | | PA12 | GSM_TX | 12 | | | | | *2/00 | 4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | - | 27 | | PA13 | GSM_RX | 13 | | | | | *2/01 | 4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | + | 26 | | PA12 | GSM_TX | 12 | | | | | 2/00 | *4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | + | 27 | | PA13 | GSM_RX | 13 | | | | | 2/01 | *4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | | 28 | | PA14 | GSM_RTS | 14 | | | | | 2/02 | 4/02 | TC3/0 | TCC0/4 | | GCLK_IO0 | - | 29 | | PA15 | GSM_CTS | 15 | | | | | *2/03 | 4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | + | 29 | | PA15 | GSM_CTS | 15 | | | | | 2/03 | *4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | | 30 | | PA27 | PMIC_IRQ | *15 | | | | | | | | | | GCLK_IO0 | | 31 | | PB08 | GSM_RESETN | 08 | 02 | | Y14 | | | 4/00 | TC4/0 | | | | | 32 | | PB09 | ADC_VBAT | *09 | 03 | | Y15 | | | 4/01 | TC4/1 | | | | diff --git a/variants/mkrwan1300/variant.cpp b/variants/mkrwan1300/variant.cpp index 8e07454fb..40e6b44c2 100644 --- a/variants/mkrwan1300/variant.cpp +++ b/variants/mkrwan1300/variant.cpp @@ -57,8 +57,8 @@ const PinDescription g_APinDescription[] = { | 10 | MISO | PA19 | | 03 | | | X07 | | *1/03 | 3/03 |* TC3/1 | TCC0/3 | I2S/SD0 | AC/CMP1 | +------------+------------------+--------+-----------------+--------------------+-----+-----+---------+---------+--------+--------+----------+----------+ | | Wire | | | | | | | | | | | | | | - | 11 | SDA | PA08 | | NMI | *16 | | X00 | | *0/00 | 2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | - | 12 | SCL | PA09 | | 09 | *17 | | X01 | | *0/01 | 2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | + | 11 | SDA | PA08 | | NMI | *16 | | X00 | | 0/00 | *2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | + | 12 | SCL | PA09 | | 09 | *17 | | X01 | | 0/01 | *2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | Serial1 | | | | | | | | | | | | | | | 13 | RX | PB23 | | 07 | | | | | | *5/03 | | | | GCLK_IO1 | diff --git a/variants/mkrwifi1010/variant.cpp b/variants/mkrwifi1010/variant.cpp index eb146fa59..194c02d5e 100644 --- a/variants/mkrwifi1010/variant.cpp +++ b/variants/mkrwifi1010/variant.cpp @@ -58,8 +58,8 @@ const PinDescription g_APinDescription[] = { | 10 | MISO | PA19 | | 03 | | | X07 | | *1/03 | 3/03 |* TC3/1 | TCC0/3 | I2S/SD0 | AC/CMP1 | +------------+------------------+--------+-----------------+--------------------+-----+-----+---------+---------+--------+--------+----------+----------+ | | Wire | | | | | | | | | | | | | | - | 11 | SDA | PA08 | | NMI | *16 | | X00 | | *0/00 | 2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | - | 12 | SCL | PA09 | | 09 | *17 | | X01 | | *0/01 | 2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | + | 11 | SDA | PA08 | | NMI | *16 | | X00 | | 0/00 | *2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | + | 12 | SCL | PA09 | | 09 | *17 | | X01 | | 0/01 | *2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | Serial1 | | | | | | | | | | | | | | | 13 | RX | PB23 | | 07 | | | | | | *5/03 | | | | GCLK_IO1 | @@ -130,10 +130,10 @@ const PinDescription g_APinDescription[] = { | | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | WiFi SPI | | | | | | | | | | | | | | - | 26 | | PA12 | NINA_MOSI | 12 | | | | | *2/00 | 4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | - | 27 | | PA13 | NINA_MISO | 13 | | | | | *2/01 | 4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | + | 26 | | PA12 | NINA_MOSI | 12 | | | | | 2/00 | *4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | + | 27 | | PA13 | NINA_MISO | 13 | | | | | 2/01 | *4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | | 28 | | PA14 | NINA_CS | 14 | | | | | 2/02 | 4/02 | TC3/0 | TCC0/4 | | GCLK_IO0 | - | 29 | | PA15 | NINA_SCK | 15 | | | | | *2/03 | 4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | + | 29 | | PA15 | NINA_SCK | 15 | | | | | 2/03 | *4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | | 30 | | PA27 | NINA_GPIO0 | *15 | | | | | | | | | | GCLK_IO0 | | 31 | | PB08 | NINA_RESETN | 08 | 02 | | Y14 | | | 4/00 | TC4/0 | | | | | 32 | | PB09 | ADC_VBAT | *09 | 03 | | Y15 | | | 4/01 | TC4/1 | | | | diff --git a/variants/mkrzero/variant.cpp b/variants/mkrzero/variant.cpp index 51b9f3d34..837efe2f1 100644 --- a/variants/mkrzero/variant.cpp +++ b/variants/mkrzero/variant.cpp @@ -57,8 +57,8 @@ const PinDescription g_APinDescription[] = { | 10 | MISO | PA19 | | 03 | | | X07 | | *1/03 | 3/03 |* TC3/1 | TCC0/3 | I2S/SD0 | AC/CMP1 | +------------+------------------+--------+-----------------+--------------------+-----+-----+---------+---------+--------+--------+----------+----------+ | | Wire | | | | | | | | | | | | | | - | 11 | SDA | PA08 | | NMI | *16 | | X00 | | *0/00 | 2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | - | 12 | SCL | PA09 | | 09 | *17 | | X01 | | *0/01 | 2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | + | 11 | SDA | PA08 | | NMI | *16 | | X00 | | 0/00 | *2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | | + | 12 | SCL | PA09 | | 09 | *17 | | X01 | | 0/01 | *2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | Serial1 | | | | | | | | | | | | | | | 13 | RX | PB23 | | 07 | | | | | | *5/03 | | | | GCLK_IO1 | @@ -129,10 +129,10 @@ const PinDescription g_APinDescription[] = { | | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | | SD SPI | | | | | | | | | | | | | | - | 26 | | PA12 | SD MOSI | 12 | | | | | *2/00 | 4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | - | 27 | | PA13 | SD SCK | 13 | | | | | *2/01 | 4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | + | 26 | | PA12 | SD MOSI | 12 | | | | | 2/00 | *4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 | + | 27 | | PA13 | SD SCK | 13 | | | | | 2/01 | *4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 | | 28 | | PA14 | SD SS | 14 | | | | | 2/02 | 4/02 | TC3/0 | TCC0/4 | | GCLK_IO0 | - | 29 | | PA15 | SD MISO | 15 | | | | | *2/03 | 4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | + | 29 | | PA15 | SD MISO | 15 | | | | | 2/03 | *4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 | | 30 | | PA27 | SD CD | 15 | | | | | | | | | | GCLK_IO0 | +------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+ | 31 | | PA28 | BOTTOM PAD | 08 | | | | | | | | | | GCLK_IO0 | From 993398cb7a23a4e0f821a73501ae98053773165b Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Tue, 23 Jan 2024 09:11:26 +0100 Subject: [PATCH 34/34] Release v1.8.14. --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index 3071243ec..107536f59 100644 --- a/platform.txt +++ b/platform.txt @@ -20,7 +20,7 @@ # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification name=Arduino SAMD (32-bits ARM Cortex-M0+) Boards -version=1.8.13 +version=1.8.14 # Compile variables # -----------------