SystemUpdate.Load() Method . . . does a reset exist?

Let’s say I’ve got this pseudocode (horrible syntax, but you should get the idea):


SystemUpdate.Load(Firmware)
SystemUpdate.Load(Firmware2)
SystemUpdate.Load(Config)
SystemUpdate.Load(Deployment) // ----> Something bad happens here (exception, timeout, etc.)

If I’m loading my IFU files but get to the last one and something bad happens, is there a way to reload just that one file where the error occurred, or do I have to restart the process from scratch and load ALL files once again?

If I am required to again start from scratch, is this the correct sequence?

1.) Using SystemUpdate.Load() to load the last file.
2.) ----- Error occurs -----
3.) Call SystemUpdate.Abort()
4.) Call SystemUpdate.Initialize()
5.) Use SystemUpdate.Load() to again load all files from the beginning

The load method writes nothing to flash. You can safely abort

Can I reset the SystemUpdate.Load() for a specific file, if for example, the bytes I’ve already loaded into it are corrupted and I need to restart just that one file?

Or is it all-or-nothing? Which means I have to call Abort and start the entire process over again and load all files?

If I understand IFU in 4.2 right you can do next without problem:


SystemUpdate.Load(Firmware)
SystemUpdate.Load(Firmware2)
SystemUpdate.Load(Config)
SystemUpdate.Load(Deployment)
SystemUpdate.Load(Deployment)

Because in Load() you must select which type you would like upgrade(SystemUpdate.SystemUpdateType.Deployment) and updating one Type twice will overwrite previous one… But this is only my understanding of new IFU… You can try and you will see what happen :slight_smile: If flashing will go bad then just reflash unit with offical fw flash application…

All or nothing :slight_smile:

Thanks!

Gus if he don’t call Abort() must he also load all files again(If they are sucessfully loaded) and only app is not loaded?

Load does one thing only, copy the firmware to a temporarily buffer. You can load some, load more, load again, reset, do something else then load more…the system will simply not be effected.

Abort will release the buffers previously allocated.

Thanks for the explanation. When you said “load some, load more, load again, reset, do something else then load more,” the part where you said “reset” --> does that mean you can reset (reboot) the board, and the previously loaded contents will remain persisted even after the reboot? Will the contents remain after a soft reboot only, or even after the board has been completely power-cycled?

What does SystemUpdate.Initialize() do under the hood? Do I need to call it after calling Abort() if I need to restart the file upload process?

The only call that actually does anything is the last one (can’t currently remember it’s Name, is it Reset?).
Initialize, Load, Abort are only in Memory operations.
So: Abort is something like an undo, as long as the last call was not called.
After that there is no way back. Only a new IFU cycle can undoo this.

After calling Abort you have to call Initialize again.
Initialize is always the first call, then one ar many Load in the middle and an Abort or Reset at the end.

@ Reinhard - Thanks, that makes sense. The last step is called FlashAndReset, I believe.