JAndrassy / ArduinoOTA

Arduino library to upload sketch over network to Arduino board with WiFi or Ethernet libraries
GNU Lesser General Public License v2.1
437 stars 89 forks source link

Nano IOT 33 - WifiOTA Sketch Download #145

Closed JEG8 closed 2 years ago

JEG8 commented 2 years ago

Hello,

I am using OTA sketch download using the example code provided (OTASketchDownloadWifi).

The example sketch uses 38724 bytes (14%) of program storage space. I am trying to download a sketch that uses 148164 bytes (56%) of program storage space. Maximum storage on my device is 262144 bytes. I am receiving the following error.

Update status code: 200 Server returned update file of size 147676 bytes There is not enough space to store the update. Can't continue with update.

Is there any way that I can make this work besides reducing the size of my update?

Thanks for any help you can provide and thank you for this library.

JAndrassy commented 2 years ago

you can use SD card to store the update binary (or to store the data which are now in the sketch and make it big)

JEG8 commented 2 years ago

Thank you. I had the same thought but when I try to use OTASketchDownload_SD for the Arduino Nano 33 IOT, it says the board is unsupported. I think this is due to the SDU library not supporting the board.

**\Arduino15\packages\arduino\hardware\samd\1.8.13\libraries\SDU\src\SDU.cpp:44:4: error: #error "Unsupported board!"

error "Unsupported board!"

^~~~~**

What do you recommend I use for storing the binary to the SD?

The SDU Library has the following in SDU.cpp

include

include "SDU.h"

attribute ((section(".sketch_boot"))) unsigned char sduBoot[0x4000] = {

if defined(ARDUINO_SAMD_ZERO)

include "boot/zero.h"

elif defined(ARDUINO_SAMD_MKR1000)

include "boot/mkr1000.h"

elif defined(ARDUINO_SAMD_MKRZERO)

include "boot/mkrzero.h"

elif defined(ARDUINO_SAMD_MKRFox1200)

include "boot/mkrfox1200.h"

elif defined(ARDUINO_SAMD_MKRGSM1400)

include "boot/mkrgsm1400.h"

elif defined(ARDUINO_SAMD_MKRWAN1300)

include "boot/mkrwan1300.h"

elif defined(ARDUINO_SAMD_MKRWIFI1010)

include "boot/mkrwifi1010.h"

elif defined(ARDUINO_SAMD_MKRNB1500)

include "boot/mkrnb1500.h"

elif defined(ARDUINO_SAM_ZERO)

include "boot/mzero.h"

else

error "Unsupported board!"

endif

};

JAndrassy commented 2 years ago

https://github.com/arduino/ArduinoCore-samd/pull/645

JEG8 commented 2 years ago

arduino/ArduinoCore-samd#645

Thank you. I followed the steps and it worked.