Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Calculate the fsEnd for ESP32 properly #63

Merged
merged 1 commit into from
Nov 3, 2024
Merged

Calculate the fsEnd for ESP32 properly #63

merged 1 commit into from
Nov 3, 2024

Conversation

earlephilhower
Copy link
Owner

No description provided.

@stef-ladefense
Copy link

escuse for my bad english, french here

lastend = offset + length; <- not use
var parttype = partitionEntry[2].toUpperCase().trim();
if ((parttype == "SPIFFS") || (parttype == "LITTLEFS")) {
fsStart = offset;
fsEnd = fsStart + length; <- fsEnd = offset+ length;
}

@earlephilhower
Copy link
Owner Author

Merci, mais on m'a dit que tout le monde parle, pense, et e'crive en Anglais, no?! 😆

Anyway, lastend is only used if there is no offset. For example:

nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 3M,
app1, app, ota_1, ,3M,
spiffs, data, spiffs, ,0x9E0000,
coredump, data, coredump, ,0x10000,

app1 offset is empty, so it needs to be set to the end of the last line per the document. It should be 0x10000 +3M .

And spiffs should be end of app1, so 0x10000 + 3M + 3M (6M+0x10000) with a length of 9E00000.

The update shows

LittleFS Filesystem Uploader v1.3.0 -- https://github.com/earlephilhower/arduino-littlefs-upload

 Sketch Path: /home/earle/Arduino/data1
   Data Path: /home/earle/Arduino/data1/data
      Device: ESP32 series, model esp32
Using partition: partitions.csv in sketch folder
  Partitions: /home/earle/Arduino/data1/partitions.csv
       Start: 0x610000
         End: 0xff0000

Building LittleFS filesystem
Command Line: /home/earle/.arduino15/packages/esp32/tools/mklittlefs/3.0.0-gnu12-dc7f933/mklittlefs -c /home/earle/Arduino/data1/data -p 256 -b 4096 -s 10354688 /tmp/tmp-410643-dBnHOOuCksvl-.littlefs.bin
/test.txt

10354688 == 0x9e0000

The start is 6M+0x10000 = 0x610000 = 6356992

Uploading LittleFS filesystem
Command Line: python3 /home/earle/.arduino15/packages/esp32/tools/esptool_py/4.6/esptool.py --chip esp32 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 6356992 /tmp/tmp-410643-dBnHOOuCksvl-.littlefs.bin

@stef-ladefense
Copy link

Here too I was told that everyone speaks, thinks, and writes in French 😆

as long as it works, if it's just a display issue, that's fine with me too.
the goal is to transfer the data to the right place without overwriting anything else.
glad to have moved your project forward.

a question, when I retrieve the binary (moreover it would be good to create it in the project folder, in a subfolder, like when we export the compiled binary, but it's just to avoid looking for it in TEMP).
so, this binary, can't be flashed OTA with the internal service of HTTPUpdateServer, I'll have to dig into the source.

@earlephilhower earlephilhower merged commit 5edc749 into main Nov 3, 2024
@earlephilhower earlephilhower deleted the e32 branch November 3, 2024 17:58
@earlephilhower
Copy link
Owner Author

Just to be clear: the compiled VSIX you had from #62 is broken and will not generate the right size filesystem. You will want to install the 1.3.0 from the releases folder.

@stef-ladefense
Copy link

yes sure.
thank you 🥇

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants