2

To clarify, I'm working on a project on an esp8266 (specifically an esp-12s using NodeMCU 1.0).

I have a bunch of html files and images that I bundle into a LittleFS binary that gets written to the flash using esptool (or the arduino ide, which uses esptool internally anyway).

To store the user's settings, I also create a file with the intention of serialising that data to the file.

Unfortunately it crashes and resets as soon as I call LittleFS.open(path, "w");.

So I just need to know, if I compile and upload a filesystem, is that filesystem "Read only"?

(If the answer is yes, then I know I need to use a different method to save user data, if it's no, then there's a bug in my code somewhere)

Dan Forever
  • 381
  • 2
  • 12
  • Strip down the code to the bare minimum such that the bug is still reproducible and share it in a new Q here. – Marcel Stör Aug 02 '22 at 06:31
  • If you're curious I found the bug, it was a buffer overrun, I was using far too small a statically allocated buffer for something. It just happened to be crashing when I tried to open a file for writing, and everything else appeared to be working completely fine. So @romkey's answer was able to get my head out of the trees and see the forest for what it was. – Dan Forever Aug 05 '22 at 19:55

1 Answers1

1

No, a filesystem image written to flash is not read-only. It's usable exactly as if it had been created by the firmware. There is no discernible difference to the software running on the ESP8266.

romkey
  • 6,218
  • 3
  • 16
  • 12