These are chat archives for esp8266/Arduino

Oct 2015
Oct 23 2015 02:52

I am having two problems evaluating SPIFFS on a Huzzah board. The write performance is about 20K bytes/sec. Do all ESP8266 boards write so slowly? Read performance (470 Kbytes/s) is very good.

The test code is on github.

The other problem is the test fails after 2-3 cycles of writing then reading a 1 Mbyte file. The same file name is used on every cycle and the file is removed (SPIFFS.remove) between cycles so free space in Flash should not be exhausted.

The test is run with a build from git today. Sample serial output follows.

SPIFFS Performance
49585 msecs
1048576 bytes
21147 write bytes/sec
2216 msecs
1048576 bytes
473184 read bytes/sec
SPIFFS Performance
write failed
SPIFFS Performance
open for write failed
Me No Dev
Oct 23 2015 09:26
OK, i do not have definitive answer on some of the things but can give you clues
first, when you write, there are alot more things involved to get the data onto the flash
it needs consecutive clean blocks of flash in order to get max speed
else it has to look for free space, delete some old data if it does not have any and so on before it even writes a byte
second, when you delete a file from SPIFFS, you are actually not deleting the file, but rather you are marking the pages where it's data reside as "deleted"
so when the next file comes it has to see if there are any fre pages, use them and then start clearing the pages with "deleted" data
but then again we can only erase a block which has many pages, so SPIFFS needs to move the usable data rom the block, put it on another block that has free pages for it and clear this one
Me No Dev
Oct 23 2015 09:32
therefore once you have used up all of your fre blocks/pages, things start to get really complicated under the hood
Oct 23 2015 11:47
@me-no-dev good morning to all
@me-no-dev I have compiled succesfully Natice "C" Ccode OF esp8266 using xtensa tool chain availabe in arduino ide creating C LIBRARY externally with tensa tool chain putting generating lib .a in sdk lib path in ARDUINO IDE
Oct 23 2015 11:53
@me-no-dev YOUR reference to make file tutorial helped me to crate lib file.a
@me-no-dev I created libuart.a , liblcd.a and libhttpd.a
@me-no-dev Thanking you very much
@me-no-dev lib codes of arduino consumes more bytes compaer to native C code
Oct 23 2015 11:58
@me-no-dev For that purpose I prefered version 1.6.2
@me-no-dev Packages insteed through Board manger we cannot access the source code to modify
@me-no-dev Is there any method to acces source code for the installation done through board manager
Me No Dev
Oct 23 2015 12:09
yes, but that depends on the OS
people with windows can help you
i'm on a Mac :)
Oct 23 2015 12:25
@me-no-dev n I tried to build from source using ant dist But the building process hangs in the middle
Any one with window OS SUGGEST HOW ?