Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Holger Lembke
@holgerlembke
let me sum it up: use as program space: no. use as storage from my sketch: yes. right?
Me No Dev
@me-no-dev
right
Holger Lembke
@holgerlembke
so SPIFFS does not work why?
Me No Dev
@me-no-dev
ESP understands flash up to 4MB and assumes 512K is magic does not match to 4M
the ESP will put at the end of whatever it thinks the size is the config secttors
it's kinda hard for me to formulate and explain it all
Holger Lembke
@holgerlembke
me not understand that
SPIFFS is entirely sketch driven. right?
Me No Dev
@me-no-dev
|--sketch--|--ota--|--spiffs--|--eeprom--|--config--|
not entirely ;) address and size are defined in linker
Holger Lembke
@holgerlembke
so as the current flash sizes are... I had to change flashchip->chip_size
so why not create a config with 2mb |--sketch--|--ota--|--eeprom--|--config--| and put SPIFFS at the end?
Me No Dev
@me-no-dev
config is written by the SDK, eeprom is defined as 4K after SPIFFS
you can maybe make a config for 1M and have EEPROM and SPIFFS after
though OTA will not work because it takes spiffs start as it's possible end
Holger Lembke
@holgerlembke
i dont get it. why does the SDK care about SPIFFS?
Me No Dev
@me-no-dev
SDK does not care about spiffs
SDK cares about WIFI config
and always puts that config in the last 4 sectors (or maybe it was 3) before what it thinkls is the end of the flash
which is determined by the magic byte of the image
Holger Lembke
@holgerlembke
so if flashchip->chip_size is changed, it wont find its config any more, because it cant access beyond the 4mb?
Me No Dev
@me-no-dev
flashchip->chip_size has not come into play when flash size is determined
flashchip->chip_size is set based on that (and we overwrite it if needed)
Holger Lembke
@holgerlembke
it is all I need to get write/read access...
Me No Dev
@me-no-dev
from within the firmware yes
but not from the bootloader
Holger Lembke
@holgerlembke
sooooooo. where is the problem? boot 2mb |--sketch--|--ota--|--eeprom--|--config--| , change chip_size, init SPIFFS.
Me No Dev
@me-no-dev
even if you manage some crazy config, it will break OTA, SPIFFS upload tool and maybe more
Holger Lembke
@holgerlembke
oh. i see
so every time a spiffs-call is made, chipsize must be changed and restored....
Me No Dev
@me-no-dev
what you can do also is set chip_size and attach second SPIFFS partition above 4M
|--sketch--|--ota--|--spiffs--|--eeprom--|--config--|--spiffs2--|
Holger Lembke
@holgerlembke
ok, to sum that up: all tools assume sketch/ota/spiffs/eeprom/config for calculations. if it is changed, it is unclear, what happens.
Me No Dev
@me-no-dev
yes
Holger Lembke
@holgerlembke
so two spiffs would be the workable solution. just add the first for compatibility sake and ignore it and use the second instead.
Me No Dev
@me-no-dev
or use both...
Holger Lembke
@holgerlembke
squezze every drop out of it...
as I dont know much about the "internal thoughts of core developers", is SPIFFS really that good? Any other solutions? I mean, a file system with no folders...
Me No Dev
@me-no-dev
our flash chips are small in size and most (modern) file systems are made for much larger memory
SPIFFS is optimized for what it does: save space, save the flash from wear and provide file system for MCUs
adding even a simple thing as folders will require more space to be used for storing a catalog of the folders and contents
maybe some old FAT can be made to work, but then there will be complains about file name length ;)
Holger Lembke
@holgerlembke
this is something I totally know. :-) my question was more about the internal views, whether there is something in the development pipeline and some other flash file solutions... but as far as google goes, I didnt find any replacement candidate, too.
Me No Dev
@me-no-dev
I doubt something better can be made ;) at least with the constrains that we have
Holger Lembke
@holgerlembke
emfile is fat32 with about 15k/2k.. but closed source.
Holger Lembke
@holgerlembke
and "Petit FAT File System Module" works on a ATtiny85 but has no flash support. on the other hand a very clear interface, so a wear leveling...
Ivan Grokhotkov
@igrr
Hmm, there are lots of options for embedded FS out there
Even with free and permissive license.
Take the one from Apache Mynewt, for example.
Me No Dev
@me-no-dev
what is OpenWRT's file system?