Skip to content

Commit 6cc464a

Browse files
facchinmaentinger
authored andcommitted
Enable OTA for Portenta H7 target
1 parent d8a3a98 commit 6cc464a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,12 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
123123
* The bootloader is excluded from the calculation and occupies flash address
124124
* range 0 to 0x2000, total flash size of 0x40000 bytes (256 kByte).
125125
*/
126+
#if defined(ARDUINO_PORTENTA_H7_M7)
127+
// TODO: check if we need to checksum the whole flash or just the first megabyte
128+
_ota_img_sha256 = FlashSHA256::calc(0x8040000, 0x200000 - 0x40000);
129+
#else
126130
_ota_img_sha256 = FlashSHA256::calc(0x2000, 0x40000 - 0x2000);
131+
#endif
127132
#endif /* OTA_ENABLED */
128133

129134
#ifdef BOARD_HAS_OFFLOADED_ECCX08
@@ -391,7 +396,7 @@ void ArduinoIoTCloudTCP::handleMessage(int length)
391396

392397
if ((_shadowTopicIn == topic) && (_state == State::RequestLastValues))
393398
{
394-
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s [%d] last values received", __FUNCTION__, millis());
399+
DBG_VERBOSE(F("ArduinoIoTCloudTCP::%s [%d] last values received"), __FUNCTION__, millis());
395400
CBORDecoder::decode(_property_container, (uint8_t*)bytes, length, true);
396401
sendPropertiesToCloud();
397402
execCloudEventCallback(ArduinoIoTCloudEvent::SYNC);
@@ -438,6 +443,10 @@ int ArduinoIoTCloudTCP::write(String const topic, byte const data[], int const l
438443
return 0;
439444
}
440445

446+
#if OTA_STORAGE_PORTENTA_QSPI
447+
#include "ArduinoOTAPortenta.h"
448+
#endif
449+
441450
#if OTA_ENABLED
442451
void ArduinoIoTCloudTCP::onOTARequest()
443452
{

0 commit comments

Comments
 (0)