SSLClient & ArduinoOTA

I got Blink_sfu.bin (in Binary.h),in sketch SFU_LoadBinary.ino. So in external flash, I got Blink_sfu.bin.

Its not update the Zero flash.

Then, I upload SFUBoot.ino into Zero, it flash Blink_sfu.h into Zero but IDE doesnt recognize board anymore.

Its same if i try use this sketch. Its download the firmware, but not apply into Zero flash, its update after I upload SFUBoot.ino into it and IDE can recognize.

Edit : I try again a few times, sometimes IDE doesnt recognize Zero.
Edit : Need to restart IDE to make it recognize Zero

Edit : So, I believe SFUBoot.ino is working with Zero

so now the build.sh. do you have a way to run it?

I m not sure about it. What does this script do? Is it convert from bin file to C header file?

it converts bin to hex array. it uses a tool available in Linux

cat SKETCH.bin | xxd --include > Binary.h

So it similar to this command in Linux.

https://www.tutorialspoint.com/unix_commands/xxd.htm

xxd creates a hex dump of a given file or standard input.

If that so, I can use linux to convert bin to hex array.

My question is, how to make Zero flash update, after download new firmware? Right now, I only can download firmware into external flash, and need to flash SFUBoot.ino to apply new firmware.

you can use ArduinoOTA library's SerialFlashStorage

#include <SerialFlashStorage.h>

SerialFlashStorageClass SerialFlashStorage;

void setup()
{
    //after download new firmware into external flash
    SerialFlashStorage.apply();
}

Is this correct? I m not sure.

the SFU library preppends the compiled SFUBoot to the current sketch. including SFU adds SFUBoot to the sketch.
so after a reset SFUBoot runs and loads the update from the external flash into the internal flash

I include SFU into Blink sketch, it doesnt update. Is it possible because I use mkrzero.h in SFU? But I can use SFUBoot.ino on zero.

so I thought you made your version of the SFU with Zero support.
the build.sh created a file which you should integrate into your version of the SFU library

I am not sure how to make zero version for SFU, I though I can use mkrzero.h for zero. Do you have guide how to do it?

did you add a new line in build.sh? or create zero.h with some other way?
add a new #if for Zero in SFU.cpp

from my understanding, SFUBoot.ino compile binary, then convert into hex array. Then add to SFU.h? Is this correct?

Edit: Ok Done. Update Blink work. I got it. Thank you for your help and time. I m really appreciate.

Next, I will try with Ethernet and I will update here, it should be fine.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.