Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Option for selecting "Partition scheme" missing - can create confusion or even bugs #194

Closed
joysfera opened this issue Jan 31, 2020 · 3 comments
Labels
conclusion: duplicate This issue or pull request already exists type: imperfection Something isn't working

Comments

@joysfera
Copy link

joysfera commented Jan 31, 2020

Describe the bug
A working project for ESP32, when compiled by this arduino-pro-ide alpha 4, introduces a serious/scary bug in SPIFFS. It reads content of different file than it opened succesfully.

To Reproduce
Steps to reproduce the behavior:

  1. Have an existing project flashed on a board with SPIFFS containing some files, say named "A" and "B", containing some data.
  2. Compile and run the following code: File f = SPIFFS.open("/A", "r"); if (f) { char x[10]; int b = f.readBytes(x, 10); x[b] = 0; Serial.println(x); }

Expected behavior
Shows content of the file "A". Unfortunately, it shows content of file "B" instead.
BTW, it seems to use the real length of file "A" even though it reads bytes of file "B".

Please note this will not be this easy to reproduce. The "A" and "B" are just made up - in fact my files are named "wifi.cfg" and "names.json". It apparently is not related to file names. It might be dependent on the order of files created on the SPIFFS, or something else.

When this very project is compiled using Arduino 1.8.10 + arduino-esp32 v1.0.4, it works correctly, i.e. reads the right bytes of the right file.

@joysfera joysfera added the type: imperfection Something isn't working label Jan 31, 2020
@joysfera
Copy link
Author

Resolved: what's really happening is that the Arduino Pro IDE is missing the option for selecting the appropriate Partition scheme. It seems that I have two different SPIFFS on the flash (by mistake) located at different addresses so if (in Arduino IDE) I select "Minimal SPIFFS" I get one filesystem while if I select "Default 4MB with spiffs" then I get a different filesystem with different files.

So please add the option for selecting Partition scheme to Arduino Pro IDE. Thanks!

@joysfera joysfera changed the title serious SPIFFS bug introduced when compiled by alpha4 Option for selecting "Partition scheme" missing - can create confusion or even bugs Feb 25, 2020
@Master811129
Copy link

#10

@per1234
Copy link
Contributor

per1234 commented Feb 29, 2020

Closing as duplicate of #10. Thanks @Master811129!

@per1234 per1234 closed this as completed Feb 29, 2020
@per1234 per1234 added the conclusion: duplicate This issue or pull request already exists label Feb 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
conclusion: duplicate This issue or pull request already exists type: imperfection Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants