pellepl / spiffs

Wear-leveled SPI flash file system for embedded devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SPIFFS read after write is not correct

saperlot opened this issue · comments

Hi,
If i take the example from the wiki (create file / write "hello world" / close / open / read) it works.
if i remove the steps close and open, basically create / write / read, data which i read is wrong.
Is there an issue with my cache or is this not what i should do?

My cache buffers are these:
static u8_t spiffs_work_buf[QSPI_PAGE_SIZE*2]; static u8_t spiffs_fds[sizeof(spiffs_fd) * SPIFFS_MAX_OPEN_FILES]; static u8_t spiffs_cache_buf[(QSPI_PAGE_SIZE+32)*4];

Wouldn't you need to seek back to the beginning of the data before the read?