Page 1 of 1

can't fread files created using mkspiffs

Posted: Fri Dec 21, 2018 9:15 am
by gongli
Hi, I was reading zero byte for files created using mkspiffs (https://github.com/igrr/mkspiffs.git)

How I make the file system image

Code: Select all

mkspiffs -d 5 -c res/ -b 4096 -p 256 -s 0xF0000 spiffs.bin
How I flash it

Code: Select all

python esptool.py --chip esp32 --baud 912600 write_flash -z 0x210000 spiffs.bin
How are the partitions

Code: Select all

nvs,      data, nvs,     0x9000,  0x6000,
phy_init, data, phy,     0xf000,  0x1000,
factory,  app,  factory, 0x10000, 2M,
storage,  data, spiffs,  ,        0xF0000,
The size of flash is 4MB. Besides the problem above, I was able to list the file system. And ftell() correctly tells the file's size, which is great than zero. Also, I was able to create new file on the file system using fopen(), and reading the newly created file was no problem. Thanks if someone can point me out what was going wrong.

Re: can't fread files created using mkspiffs

Posted: Fri Dec 21, 2018 11:20 am
by ESP_igrr
Please check this topic: https://www.esp32.com/viewtopic.php?t=6336

https://github.com/igrr/mkspiffs/issues/48

https://github.com/igrr/mkspiffs/blob/m ... figuration

Also please compare the output of mkspiffs --version with your spiffs settings in sdkconfig.

Re: can't fread files created using mkspiffs

Posted: Mon Dec 24, 2018 3:17 am
by gongli
Thanks. It works now.