-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spiffsgen.py output not supported on ESP8266 (IDFGH-4925) #6717
Comments
One thing to consider is that the settings passed to You should be able to cross-reference it with https://github.com/arduino/esp8266/blob/master/cores/esp8266/spiffs/spiffs_config.h. I'm not very familiar with the Arduino core codebase, but in ESP-IDF SPIFFS configuration is ultimately in |
@renzbagaporo thanks for this constructive feedback! As the image produced by running |
The default arguments in https://github.com/espressif/esp-idf/blob/master/components/spiffs/spiffsgen.py#L460-L510 also have the default values for the respective Kconfig options, i.e. --page-size == CONFIG_SPIFFS_PAGE_SIZE == 256 by default, which is why you experienced this.
Yup! |
Ahhh...my head is about to explode 😦 But I learned a lot in the meantime. So many indirections, sigh. In the Arduino IDE one uses @me-no-dev's ESP8266FS plugin to upload a SPIFFS image. It's a Java class that
If my analysis above is correct then only the meta length value is different from the Still, no dice so far. I continue debugging and looking at hex diffs 😭 |
The other difference is Edit: also SPIFFS_USE_MAGIC_LENGTH=0 in arduino-esp8266, can be adjusted using |
Thanks for the pointer to your build script; one more place to look 😉 I also stumbled upon
I was afraid I'd sooner or later hit a road block in my attempt to build something cross-platform for both ESP32/ESP8266 😞 Relying on Python is usually a good idea. |
On --use-magic-len not being possible to turn off — that's definitely something that can be fixed. I'm not sure how much more difficult would it be to add support for ALIGNED_OBJECT_INDEX_TABLES. From the name it sounds rather simple (something needs to either be aligned or not?), most work probably is to go through spiffs source code and understand what and how exactly needs to be aligned. |
We also run across this problem while trying to add the feature to flash user configuration (mainly the WiFi credentials). It does not support ESP8266 right now. If you are curious - this is our work in progress: |
Thanks for chiming in. I rely on |
I'm sorry, given that the esp8266/Arduino project is deprecating spiffs in favor of littlefs, I doubt that supporting esp8266 compatibility in spiffsgen.py will be considered very important. |
@marcelstoer please try the attached patch to spiffsgen.py and let me know if it solves your problem. You need to specify additional arguments to generate an ESP8266 compatible image. For example, given the values from 16M/15M config you have linked to:
|
I was able to write and read the file which was prepared with patched spiffsgen.py |
updated with the patch given here: espressif/esp-idf#6717
@igrr thank you so much! Finally got around to testing this for real. First test was a break-through 🎉 Looking good so far 👍 Will do some more testing over the weekend. |
-> all are reportedly |
Not sure if this is a bug or a feature request.
Environment
xtensa-esp32-elf-gcc --version
to find it): does not applyProblem Description
spiffsgen.py
generates SPIFFS images which are not compatible with (Arduino Core 2.7.4) ESP8266. It works fine on ESP32.Expected Behavior
I work on a cross-platform Python (GUI) app that amongst other stuff generates SPIFFS images to be used on both ESP32 and ESP8266. I was expecting the binary produced by
spiffsgen.py
to be platform-compatible between ESP8266/ESP32 even though it is hosted in the ESP-IDF project.Actual Behavior
Writing the generated SPIFFS binary to ESP8266 with esptool is fine (right, why wouldn't it). The ESP8266 app boots fine, opens SPIFFS fine, can write to it, but it does not find any of the content packaged into the
.bin
.I hex-diffed the output of the
spiffsgen.py
andmkspiffs
to see if I could make sense of the differences but I failed. There are some minor differences at that beginning and then repeatedly the same diff throughout the file.Steps to reproduce
python3 spiffsgen.py 0xFA000 ./app-props my-app.spiffs.bin
esptool.py --port /dev/cu.SLAB_USBtoUART --baud 921600 --before default_reset --after hard_reset write_flash --flash_size detect --flash_mode dio 0x300000 ~/my-app.spiffs.bin
Based on the Git history this may be one for @igrr (as the author of https://github.com/igrr/mkspiffs), @hanxifu or @renzbagaporo
The text was updated successfully, but these errors were encountered: