-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File size / file name limitation? #12
Comments
File name is limited to 32 chars, IIRC. |
Thank you for your reply, @raz123
|
The default config for filename size is 32 chars, true. I do not think it is changed on the nodemcu project. File sizes - well, the max length depends on pretty many things. The length field is 32 bits, so that's not it. Then, I think the span field config on nodemcu is 16 bits with pages of 256 bytes, giving roughly 250*65536 bytes max, so that's cool also. And then I think, filesystem has roughly 40k of spi flash to play with. The spiff_rom.bin of 196608 bytes seems large in this sense. I'll have to check what spiffy actually does. Edit: Edit2: |
Ping? |
Pong? :) |
Sorry for undirected ping, raz :) It was intended to @kireevco |
we are using spiffs on sming. not nodemcu. spiffy using "cfg.log_block_size = SPI_FLASH_SEC_SIZE" main problem is this. if we change "cfg.log_block_size = SPI_FLASH_SEC_SIZE*2" finally we can use ~142kb on filesystem. also spiffs failing if total files bigger than ~142kb. (we have free 192kb on filesystem) |
Ah I see. What errorcodes do you get? I'll see if I can browse your code 2015-04-17 9:04 GMT+02:00 alonewolfx2 [email protected]:
|
"write errno -10001" its appearing after ~141kb. if you can take a look, we will be happy |
Take this opportunity to say thank you for the excellent work, pellepl! |
blush Thanks for the kind words! Perhaps you should de-emphasize the praise until I've found the problem ;) It occurs to me that this might not be a bug, but what you see is a replica of nodemcu/nodemcu-firmware#309 (see lengthy comment by me somewhere in the middle) Anyhow, in SmingFramework/Services/SpifFS/spiffs.c you have a spiffs_mount() function. I need to know exactly what is in you cfg struct before you send it to SPIFFS_mount(). Also, are you running the latest and greatest spiffs version? Seems to be some parts missing in the config for the new stuff. My hopes are that spiffs could be tuned a wee bit better for the ESP8266 altogether, for both nodemcu and sming by simply configuring it differently. |
@pellepl I have a question: |
Hmm, it should definitely not crash. Did you get a dump or a trace? If there is a bug you've found, any info would help. In my testbench it works filling the FS with what I presume are the same params - I still need to know the exact contents of the config struct Sming sends into SPIFFS_mount(). Other than that, it is fully legal to have a logical block size that is two times the size of a physical sector. It's all in the https://github.com/pellepl/spiffs/blob/master/docs/TECH_SPEC. In short, it works like this: The SPI flash has sector boundaries - say 4096 bytes as in the ESP8266 case. Spiffs groups the SPI flash into logical blocks, which must be on sector size boundary, in our case e.g. 4096, 8192, etc. Each block is then divided into pages, in your config 256 bytes. So, having a sector size of 4096, a block size of 8192, a page size of 256 gives 4096*2/256 = 32 pages. Also, each logical block contains a meta data look up table, stealing at least one page per block. In the case of having a block size of 4096 and a page size of 256, 1/16th or 6.25% of the SPI flash is used for LUTs. Having a block size of 8192 instead, 1/32th or 3.125% if the SPI flash is used for LUTs. The former case is not a very optimal configuration, because only 25% of the LUT will be used as there are only 15 actual file data pages per block to index. The latter case is a better solution. Still it must not crash. It is confusing, because the nodemcu project uses this configuration (4096 bytes block, 256 bytes pages) without problems (?). Is sming using the latest version? Any details you could provide would be great. |
Yes, the static config I've found. The runtime I need from someone with a board. |
@pellepl if you preffer any change i can compile and test on the board |
Ok great, before SPIFFS_mount at https://github.com/anakod/Sming/blob/master/Sming/Services/SpifFS/spiffs.c#L108, insert and attach the output here I can start digging for real. |
here we go
|
Thanks! But what happened to the log_pg output? |
it seems module trying to connect network before that line. i will disable network and try again. wait a minute please |
here is it.
|
Cheers! Will dig into it asap. |
I don't know if it independent problem or same, therefore I can add this into this thread. After "make test" I see to message about failed "long_run_config_many_medium" and result: What I doing wrong? |
@dobryj In the first case with 8k blocks, the test fail since the fs runs out of space. The testcase is one of the most complicated ones, and was written to totally fill the system using 64k blocks. Having 8k blocks will add more metadata which steals more actual data, and presumably I was too lazy to cover all possible configs in the test case when writing it. As for the 128k block size with 4k sectors, that must be a bug in the test setup. I'll have to check it. It works with 128k block size with 64k sectors, which makes no sense, as the sector size should not affect in this way. Edit: as suspected, a bug in the testbench. Fixed and done with: #13 - thanks for finding this |
Segmentation fault problem, from my comment can be solved by change one line in test_spiffs.c to Problem was fixed size of array to 256. I it was enought only for default test configuration. |
@anakod Regarding the max file size of 141kB when using 192kB of space: this is not a bug. Parts of the "lost" space is eaten by metadata. Other parts are reserved as free buffer in order to do garbage collecting. And the remaining data that cannot be written is due to the same reason as is mentioned in nodemcu/nodemcu-firmware#309. I was fooled a bit there, I thought the free size of the spiffs system was 192kB, not the physical free space. |
@anakod Regarding the crash you mentioned: was this in the testbench (same as @dobryj found) or was it on target? If in testbench, then it is fixed and pushed to master. If it is on target, things are worse. I've been testing it quite hard here, both on another target and in the testbench - but I cannot reproduce it. Without more info it's hard to straighten out what could be wrong. I would at least need a stack trace or something to begin with. In any case, that is another issue - if there was a target crash, please open another issue and provide all info you can give me. I get the feeling the ESP8266 is not very transparent, can anyone jtag it or are you guys bound to printf-debugging only? |
Is there any known file size or file name limitation that would prevent loading certain files?
Thank you
Cross-issue xlfe/spiffy#7
The text was updated successfully, but these errors were encountered: