Sming - Open Source framework for high efficiency native ESP8266 development

User avatar
By piperpilot
#26567 So spiffs_mount() is called from the user_init function in "Sming/appinit/user_main.cpp". I guess the first order of business is to allow a user to NOT run spiffs_mount in that code and run it from within the user init instead. What is the "proper" way to do that.

I would probably wrap that in an if statement and check for a define in user_config.h...something like.

#define MOUNT_SPIFFS_ON_STARTUP true // or false

That would allow the mount to be controlled from the user code instead of the startup init.

spiffs_mount could then be modified to pass in an optional parameter of "mount_offset" which would be added to the location returned by spiffs_get_storage_config if present.

thoughts?
User avatar
By rab
#26588 I've had a look at the code and I think that sounds reasonable, as long as nothing in System.initialize() needs the spiffs. The addition of an offset is the simplest and easiest way for you, provided by a manual call to mount. Ideally there would be three options - calculated (current method), calculated with offset & absolute. If you want the change to be included in sming itself rather than just making it in your own copy covering that third option would be more attractive.

Also, the absolute method could be automatic if the absolute position is defined at compile time, or manual with a runtime supplied offset.
User avatar
By piperpilot
#26591 Richard, do you know if the _flash_code_end variable can be accessed in the makefile? One of the biggest problems I had was figuring out what that value is. Currently Sming does a file size check on the generated bin to try to figure out the location...but obviously that doesn't take into account where the file was placed...ie. with rboot we are putting it at 0x2000 so the calculations will be off. It would be more efficient to use the value generated in _flash_code_end.