-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
SPIFFS filesystem is not using SPIFFS_USE_MAGIC #428
Comments
Checking history. |
Yes, it's a new thing. I don't know how useful it is (I didn't investigate), but if you think it's a good thing then we can easily enable it. The nice thing about having spiffs in Sming is that we can make changes like this (that would be backwards incompatible) and all news spiffs created with a new version of Sming will automatically be correct for roms created with the same new version of Sming. |
When using SPIFFS_USE_MAGIC the spiffs_mount returns OK or ERROR when mounting.
For now I see the following updates to Sming needed :
Will continue working on this change BTW : I found the 0x4020000 needed for mounting |
This is an oddity, probably based around ported code. We don't use memory mapped flash so the flash read routines just subtract this value to get to the real flash address. Seems silly, wants fixing really. |
Yes, the flashmem.h file says :
This implements an access to flash which hides the physical characteristics of flash. We should reconsider the usage/access to flash in combination with the rboot options. Question :
Any idea why this done/needed ? |
Google suggests it has something to do with the watchdog. Probably feeding it, becasue nodemcu used to do this (probably where this got copied from) but now calls a proper api: https://github.com/nodemcu/nodemcu-firmware/pull/703/files. |
@raburton : Strange in the implementation is that it not used when actually calculating this but "changes every read/write". It is easy to revert -> Then we can remove the adding of "0x420..." when doing a spiffs_mount_manual. Because we do need the value I was wondering whether it really need to be hardcoded or can be calculated -> When LD files changes, automatic using the right value.
The Other question. |
I don't see a problem with the hard coded flash start address, it is a fixed value specific to esp. I'd do the flashmem changes as a separate PR to the spiffs/y feature as they are unrelated changes. Are you making the flash read/write functions work with real flash address then, instead of user having to add 0x40200000, then the function subtracting it again? That would be much nicer, and something I intended to look into a while back but never got chance. |
Ok, I'll keep the hardcoded start address in. Yes, flash read/write will use real addresses then. Much clearer when using. |
Yes, backwards compatibility would be nice, and easy to do, but not essential if we document in the release notes. Although as we learned when we stopped shipping a pre-compiled libsming.a nobody bothers to read the release notes. |
I've made the required changes to spiffy for you, it now uses |
Thanks, works correctly with my work in progress on Magic Status is that the "basic functionality" works but need (some) additional effort to get format also correctly implemented. Currently that also uses the "sming format" which now should go to SPIFFS_format. I noticed that you also created a spiff_format_manual. Will probably create only spiffs_format() which then handles both "non-manual/automatic" and "manual" filesystems. |
Checking flash_mem_read/write. Because of that f.e. the api_spiffs_write always returns OK.
Will not include this in the update for start_flash_update but I think needs rework |
How will you know where to format? |
You only can format after first having called SPIFFS_mount . |
You can't call SPIFFS_format without first calling SPIFFS_mount, but you |
Will be solved in Sming_RTOS by using new MAGIC_LENGTH from Spiffs. |
@anakod : @raburton : @alonewolfx2 :
I noticed that in the spiffs config the the parameter SPIFFS_USE_MAGIC is not set.
That results in a Spiffs filesystem in which when mounting there a absolutely no check on validity of the "disk" -> It is only discovered when later using filesystem.
Now, with the rBoot system in place there is also the possibility to "load" filesystems.
Because of the magic setting there is no possibility to verify whether an uploaded FS is correct.
I am planning that verification in the rBoot Generic implementation I am currently working on.
I did some investigation and it looks like it doesn't take too much effort to include the magic setting into Sming. The spiffy included in Sming is already taking the spiffs config used Sming config parameters and will create correct filesystems when setting magic. Needs only a small update to verify internal mount result.
It will be a "backward breaking update" when implementing this as filesystems created without "magic" are not compatible with filesystems using "magic"
The text was updated successfully, but these errors were encountered: