Skip to content

Add support for NICLA VISION #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion src/AIoTC_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stm32h7xx_hal_rtc_ex.h>
# include <WiFi.h>
Expand All @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions src/utility/ota/OTA-portenta-h7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
a commercial license, send an email to [email protected].
*/

#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
Expand Down Expand Up @@ -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) */
2 changes: 1 addition & 1 deletion src/utility/ota/OTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/utility/watchdog/Watchdog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down