diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index fc61f06b3..0331c0302 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -60,6 +60,8 @@ jobs: type: esp32 - fqbn: arduino:mbed_nano:nanorp2040connect type: nina + - fqbn: arduino:mbed_nicla:nicla_vision + type: mbed_nicla # make board type-specific customizations to the matrix jobs include: @@ -141,6 +143,15 @@ jobs: - name: Arduino_Portenta_OTA sketch-paths: | - examples/utility/Provisioning + - board: + type: mbed_nicla + platforms: | + # Install Arduino mbed-Enabled Boards via Boards Manager for the toolchain + - name: arduino:mbed_nicla + libraries: | + - name: Arduino_Portenta_OTA + sketch-paths: | + - examples/utility/Provisioning # ESP8266 boards - board: type: esp8266 diff --git a/library.properties b/library.properties index 5c57a7b07..494c2d234 100644 --- a/library.properties +++ b/library.properties @@ -6,6 +6,6 @@ sentence=This library allows to connect to the Arduino IoT Cloud service. paragraph=It provides a ConnectionManager to handle connection/disconnection, property-change updates and events callbacks. The supported boards are MKRGSM, MKR1000 and WiFi101. category=Communication url=https://github.com/arduino-libraries/ArduinoIoTCloud -architectures=mbed,samd,esp8266,mbed_nano,mbed_portenta +architectures=mbed,samd,esp8266,mbed_nano,mbed_portenta,mbed_nicla includes=ArduinoIoTCloud.h depends=Arduino_ConnectionHandler,Arduino_DebugUtils,ArduinoMqttClient,ArduinoECCX08,RTCZero,Adafruit SleepyDog Library diff --git a/src/AIoTC_Config.h b/src/AIoTC_Config.h index eed12f5fc..6c4080434 100644 --- a/src/AIoTC_Config.h +++ b/src/AIoTC_Config.h @@ -102,7 +102,7 @@ #define OTA_STORAGE_SSU (0) #endif -#if defined(ARDUINO_PORTENTA_H7_M7) +#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) #define OTA_STORAGE_PORTENTA_QSPI (1) #else #define OTA_STORAGE_PORTENTA_QSPI (0) @@ -121,6 +121,11 @@ #define HAS_TCP #endif +#if defined(ARDUINO_NICLA_VISION) + #define BOARD_HAS_SE050 + #define HAS_TCP +#endif + #if defined(ARDUINO_AVR_UNO_WIFI_REV2) || \ defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_HAS_OFFLOADED_ECCX08 diff --git a/src/ArduinoIoTCloudTCP.cpp b/src/ArduinoIoTCloudTCP.cpp index 79cfcc341..95c05d62c 100644 --- a/src/ArduinoIoTCloudTCP.cpp +++ b/src/ArduinoIoTCloudTCP.cpp @@ -38,7 +38,7 @@ #include "tls/utility/CryptoUtil.h" #endif -#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) +#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_NICLA_VISION) # include "tls/utility/SHA256.h" # include # include @@ -56,7 +56,7 @@ * EXTERN ******************************************************************************/ -#if defined(ARDUINO_PORTENTA_H7_M7) +#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) extern RTC_HandleTypeDef RTCHandle; #endif @@ -151,7 +151,7 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress, #endif /* AVR */ #if OTA_ENABLED && !defined(__AVR__) -#if defined(ARDUINO_PORTENTA_H7_M7) +#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) /* The length of the application can be retrieved the same way it was * communicated to the bootloader, that is by writing to the non-volatile * storage registers of the RTC. @@ -288,7 +288,7 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress, } #endif /* OTA_STORAGE_SNU */ -#if defined(ARDUINO_NANO_RP2040_CONNECT) +#if defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_NICLA_VISION) _ota_cap = true; #endif @@ -826,7 +826,7 @@ void ArduinoIoTCloudTCP::onOTARequest() _ota_error = rp2040_connect_onOTARequest(_ota_url.c_str()); #endif -#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) +#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_NICLA_VISION) _ota_error = portenta_h7_onOTARequest(_ota_url.c_str()); #endif } diff --git a/src/utility/ota/OTA-portenta-h7.cpp b/src/utility/ota/OTA-portenta-h7.cpp index 52faf73f8..664043ae5 100644 --- a/src/utility/ota/OTA-portenta-h7.cpp +++ b/src/utility/ota/OTA-portenta-h7.cpp @@ -15,7 +15,7 @@ a commercial license, send an email to license@arduino.cc. */ -#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) +#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_NICLA_VISION) /****************************************************************************** * INCLUDE @@ -87,4 +87,4 @@ int portenta_h7_onOTARequest(char const * ota_url) NVIC_SystemReset(); } -#endif /* defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) */ +#endif /* defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_NICLA_VISION) */ diff --git a/src/utility/ota/OTA.h b/src/utility/ota/OTA.h index bc92dede1..405f18430 100644 --- a/src/utility/ota/OTA.h +++ b/src/utility/ota/OTA.h @@ -62,7 +62,7 @@ int samd_onOTARequest(char const * ota_url); int rp2040_connect_onOTARequest(char const * ota_url); #endif -#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) +#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_NICLA_VISION) int portenta_h7_onOTARequest(char const * ota_url); #endif diff --git a/src/utility/watchdog/Watchdog.cpp b/src/utility/watchdog/Watchdog.cpp index ea0324dde..21d93a395 100644 --- a/src/utility/watchdog/Watchdog.cpp +++ b/src/utility/watchdog/Watchdog.cpp @@ -90,7 +90,7 @@ void mkr_nb_feed_watchdog() static void mbed_watchdog_enable() { watchdog_config_t cfg; -#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) +#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_NICLA_VISION) cfg.timeout_ms = PORTENTA_H7_WATCHDOG_MAX_TIMEOUT_ms; #elif defined(ARDUINO_NANO_RP2040_CONNECT) cfg.timeout_ms = NANO_RP2040_WATCHDOG_MAX_TIMEOUT_ms; @@ -116,7 +116,7 @@ static void mbed_watchdog_reset() void mbed_watchdog_trigger_reset() { watchdog_config_t cfg; -#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) +#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_NICLA_VISION) cfg.timeout_ms = 1; #elif defined(ARDUINO_NANO_RP2040_CONNECT) cfg.timeout_ms = 1;