Off-topic: Combining LittleFS and Firmware binary for OTA?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Wookbert
Normal user
Posts: 132
Joined: 06 Nov 2020, 03:17

Off-topic: Combining LittleFS and Firmware binary for OTA?

#1 Post by Wookbert » 31 May 2022, 01:57

@TD-er

I'm sorry for asking this here, but you are probably familiar with this question: Is there a way LittleFS and Firmware binary so it suits the 4 MB ESP8266 Over-the-air (OTA) update? I'm talking Arduino in general. I saw that the ESPressif Download tool has a Combine feature, but that creates files which take up the entire 4 MB.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Off-topic: Combining LittleFS and Firmware binary for OTA?

#2 Post by TD-er » 31 May 2022, 09:29

Not that I know of.
I have added a long time ago the option to upload a binary file containing the filesystem.
Sending a 4M file containing an entire image of the flash, is not possible via OTA as far as I know.
You can only use those to flash via serial.
The reason is that in order to program the entire flash via OTA, you need to have everything (!!!) in memory as you cannot read anything anymore from flash.
I have no idea how to program something like that as the smallest binary for flashing and having a full IP stack is larger than all RAM in the ESP.
Implementing Gzip decompression to run entirely in RAM was already quite an achievement of the devs that wrote it.

Dexamenos
New user
Posts: 7
Joined: 19 Jul 2021, 13:51

Re: Off-topic: Combining LittleFS and Firmware binary for OTA?

#3 Post by Dexamenos » 31 May 2022, 10:22

Thanks TD-er. I guess question is more like:

is there a way to avoid flashing twice (filesystem + firmware) by combining separate binaries into one big binary (latter not beeing 4 MB but actual sizes of firmware + filesystem images).

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Off-topic: Combining LittleFS and Firmware binary for OTA?

#4 Post by TD-er » 31 May 2022, 11:44

When using serial flash, sure there is.
You can read the entire flash from a working unit using esptool.py.
This bin file is then a literal copy of what is stored on the flash of that unit.

Just flash it to a new unit and you have it duplicated.

For 16M units there is a catch however as I have never been able to read the whole flash in 1 run. I always have to do it in multiple takes with some offset (e.g. per 8M) and then concatenate them to a single file.
Flashing the entire 16M image in one go works fine though.

Wookbert
Normal user
Posts: 132
Joined: 06 Nov 2020, 03:17

Re: Off-topic: Combining LittleFS and Firmware binary for OTA?

#5 Post by Wookbert » 31 May 2022, 18:13

@TD-er: Just to avoid confusion: @dexamenos is my partner in crime, coconspirator and the one who’s actually coding. I'm just the one who comes up with the nutty ideas.

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests