Skip to content
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 - Detect rBoot integration and replace default mount and format functions... #1269

Closed
wants to merge 1 commit into from
Closed

spiffs - Detect rBoot integration and replace default mount and format functions... #1269

wants to merge 1 commit into from

Conversation

jochenjagers
Copy link
Contributor

by the manual ones with correct spiffs position and size from Makefile-rboot.mk

There is still an issue with the FTPServer as it can call spiffs_format. This call is compiled on libary compile time without any knowlege about rBoot rather than on appilication compile time.
So the use of "FSFORMAT" via the FTP-Server is impossible as long as the application is compiled with rBoot support.

…ns by the manual ones with correct spiffs position and size from Makefile-rboot.mk
@anakod
Copy link
Member

anakod commented Oct 24, 2017

@jochenjagers I think it will be more "right C\C++ way" solution to check RBOOT defines directly inside spiffs_mount() function code and set related addresses for spiffs_mount_internal, instead of replacing function defination with external macros (and same for format function). Also it will be more simple to read and debug.

@jochenjagers
Copy link
Contributor Author

@anakod I don't like this macros either. My first idea was to integrate the rboot information in the function code of spiffs_get_storage_config.
But the RBOOT defines are project specific. There is no infotmation about it when compiling the sming library.
I would also prefer a more "right C/C++ way" but the only idea i have for this, is moving the implementaion of spiffs_get_storage_config function from the library to the project code or add some kind of callback function to overwrite the values defined in the library. This would also solve the problem of using spiffs functions in other parts of the library e. g. the FTPServer.
I will think about it and try to find a better solution.

@slaff slaff mentioned this pull request Nov 7, 2017
11 tasks
@slaff slaff added this to the 3.5.0 milestone Nov 7, 2017
@slaff
Copy link
Contributor

slaff commented Nov 30, 2017

@jochenjagers My 2 cents - mark all functions in the library, that should behave differently when rBoot is used as weak.

Example: void __attribute__((weak)) spiffs_mount()

This way they will be in the final sming*.a library.

Now during compilation and linking of an rBoot app compile the same functions with the new code (adjusted during compile time), DON'T mark the new function as weak and leave the linker to select the right function version during linking time. (Ex: if we have a weak spiffs_mount and a non-weak one the linker will choose the latter)

This way they correct spiffs_mount will be used in the final application.

@slaff
Copy link
Contributor

slaff commented Dec 1, 2017

The implementation of the hints above are in that PR #1292. The new PR lacks thorough testing so help is welcomed :)

@slaff slaff removed this from the 3.5.0 milestone Dec 1, 2017
@slaff slaff closed this in #1292 Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants