igrr / mkspiffs

Tool to build and unpack SPIFFS images
MIT License
186 stars 91 forks source link

mkspiffs not working with the last espressif/esp-idf version #38

Closed mmvwk01 closed 6 years ago

mmvwk01 commented 6 years ago

hi,

i use the last espressif/esp-idf with the spiffs (spiffs @ f5e26c4). I try to make spiffs image with the tools (i tested all versions)

I (51) boot: ## Label Usage Type ST Offset Length I (95) boot: 5 storage Unknown data 01 82 002f0000 000f8000

./mkspiffs -c ./data -b 8192 -p 256 -s 0xFB000 ./spiffs.bin esptool.py --port /dev/ttyUSB0 -b 921600 write_flash 0x002f0000 ./spiffs.bin

result: I (353) spiffs: Initializing SPIFFS W (383) SPIFFS: mount failed, -10025. formatting...

lszlfrng commented 6 years ago

Hi, yesterday I had a similar problem. I remembered that it works well with the arduino-esp32. In the arduino-esp32 the SPIFFS_META_LENGTH is 0. I changed the default setting in my application for the SPIFFS_META_LENGTH parameter to 0. Please check it yourself too:

mmvwk01 commented 6 years ago

Hi, thanks for answer,

i set the SPIFFS_META_LENGTH to 0 in my App, but the result is the same: W (407) SPIFFS: mount failed, -10025. formatting...

mmvwk01 commented 6 years ago

hi

  1. git clone https://github.com/espressif/esp-idf

  2. cd esp-idf/examples/storage/spiffs

  3. edit partitions_example.csv

  4. storage, data, spiffs, 0x291000, 0xF0000,

  5. make erase_flash

  6. make flash

  7. git clone https://github.com/igrr/mkspiffs

  8. git submodule init

  9. git submodule update

  10. make

  11. create dir "data"

  12. create file "test.txt" in dir "data"

  13. ./mkspiffs -c ./data -b 8192 -p 256 -s 0x000f0000 ./spiffs.bin

  14. esptool.py --port /dev/ttyUSB0 -b 921600 write_flash 0x00291000 ./spiffs.bin

Result: W (407) SPIFFS: mount failed, -10025. formatting...

igrr commented 6 years ago

@mmvwk01 ESP-IDF sets block size to the size of flash erase sector (4096 bytes), whereas you are setting it to 8192.

Please try the latest release of mkspiffs from https://github.com/igrr/mkspiffs/releases/tag/0.2.2, download the version for your OS which has 'esp-idf' in its name.

For the partition table in the unmodified ESP-IDF example, you should use the following command:

./mkspiffs -c /path/to/source/dir -b 0x1000 -p 0x100 -s 0xF0000 spiffs_image.bin

Before doing this, make sure that you use default configuration of mkspiffs example in ESP-IDF. That is,

rm sdkconfig
make defconfig