Incremental OTA

s.allasia
Posts: 27
Joined: Tue Jan 09, 2018 3:12 pm

Incremental OTA

Postby s.allasia » Thu Sep 26, 2024 2:56 pm

Hi all.
I tried to develop OTA on ESP32 with a remote server and it works.
Is it possible to have an incremental OTA?
Is it possible to upgrade only a part of my firmware?

Thanks in advance.

RandomInternetGuy
Posts: 52
Joined: Fri Aug 11, 2023 4:56 am

Re: Incremental OTA

Postby RandomInternetGuy » Sun Oct 20, 2024 12:03 pm

It can be done, but it's tricky. Of course, if the decode isn't quite right and the firmware image running isn't what you actually shipped, your customer's device is now a brick, and that's usually considered to be bad.

The problems you have to deal with include the compression that's commonly used, blocking off what's actually "different." You can disable compression, but that's often a net loss.

The other thing you have to be aware of is that the storage you're writing to is flash memory, which wants to deal in sectors and not bytes. If you change "ab" to "cd", you'll have to read the entire current sector, mask out those bytes, store the new values in, and write the new secotors. Oh, there happened to be a page boundary between those two bytes? Now you have to read two pages and do the same. Your update was actually an insertion, but there's code all over the place that contains relative links to the code after this? Now you have to be prepared to update and replace THOSE affected bytes.

At one level, this is all well understood, computer-science-y stuff that we (the industry) have known how to deal with for decades.

At another level, the cost of RMA'ing devices or dispatching field service to unbrick devices by re-flashing them when they're atop poles or inside submarines or something generally rewards doing the simplest, most deterministic thing possible, which isn't an incremental flash update.

It's not that the idea doesn't have merit. It's that it's Really Hard to get right...and really expensive if it's not.

s.allasia
Posts: 27
Joined: Tue Jan 09, 2018 3:12 pm

Re: Incremental OTA

Postby s.allasia » Mon Oct 21, 2024 7:18 am

Hi RandomInternetGuy,
thanks for your reply.

ESP_Sprite
Posts: 9668
Joined: Thu Nov 26, 2015 4:08 am

Re: Incremental OTA

Postby ESP_Sprite » Tue Oct 22, 2024 6:06 am


s.allasia
Posts: 27
Joined: Tue Jan 09, 2018 3:12 pm

Re: Incremental OTA

Postby s.allasia » Tue Oct 22, 2024 7:02 am

Hi ESP_Sprite,
thanks a lot!

Who is online

Users browsing this forum: Baidu [Spider] and 68 guests