can't fread files created using mkspiffs

gongli
Posts: 10
Joined: Fri Dec 21, 2018 2:56 am

can't fread files created using mkspiffs

Postby gongli » Fri Dec 21, 2018 9:15 am

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.

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: can't fread files created using mkspiffs

Postby ESP_igrr » Fri Dec 21, 2018 11:20 am

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.

gongli
Posts: 10
Joined: Fri Dec 21, 2018 2:56 am

Re: can't fread files created using mkspiffs

Postby gongli » Mon Dec 24, 2018 3:17 am

Thanks. It works now.

Who is online

Users browsing this forum: Google [Bot] and 70 guests