Page 1 of 1

FAT/VFS write to SPI flash is about 200KB/s with fwrite using 4KB blocks

Posted: Thu Mar 28, 2019 12:44 pm
by jcsbanks
Is this about the expected speed? I'm basing it on the wear levelling example. It is about 20% of the speed of just reading the http post multipart content and not writing it. I realise that when erasing flash that everything in it cannot execute. The first and last fwrite are less than 4096 bytes, the rest are 4096 bytes. The FAT allocation unit is 4KB. It probably doesn't matter but the CPU speed is 240MHz and the flash speed is 80MHz, QIO. Would it go faster if the first block was 4096 bytes?

For larger files I'm wondering about using a partition instead, what sort of performance improvement would I expect? Larger files will not be written often, I'm moving though from embedding them in the application flash to separate executable from data.

Re: FAT/VFS write to SPI flash is about 200KB/s with fwrite using 4KB blocks

Posted: Thu Mar 28, 2019 3:33 pm
by jcsbanks
esp\esp-idf\examples\protocols\http_server\file_serving, which uses SPIFFS, along with changes to CPU and flash speed to max, manages about 22KB/s so I don't feel too bad. Is this just the reality of the overheads of the virtual file system or the need to flash the memory you are executing from? If I get a further improvement from using the partition API it will be interesting.