-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Incorrect use of __attribute__((weak)) in flash_hal #8883
Comments
Patch to solve the issue:
|
I wonder why But I agree on the missing |
Without |
Multiple compilation units using flash_hal.h? Not using either SPIFFS of LittleFS won't trigger the issue.
I think the question is why we have to write extern when it is already a public symbol. |
Agreed, I can indeed reproduce when effectively using a FS. |
Basic Infos
Platform
Settings in IDE
Problem Description
When adding the line:
FLASH_MAP_SETUP_CONFIG(FLASH_MAP_MAX_FS)
in my sketch, I get a "multiple definition of `__flashdesc';"
The problem is that the assignment of __flashdesc on line 46 in flash_hal.h does not contain the 'attr' argument passed to the macro. So when the line 75 in flash_hal.cpp:
FLASH_MAP_SETUP_CONFIG_ATTR(__attribute__((weak)), FLASH_MAP_OTA_FS)
assigns __flashdesc to FLASH_MAP_OTA_FS, there is no weak assignment which makes it impossible override in user application.
Work-around until it is solved
Remove line 75 in flash_hal.cpp
Links to similar topics
https://forum.arduino.cc/t/multiple-definition-of-flashdesc-when-using-flash-map-setup-config/1098083/1
The text was updated successfully, but these errors were encountered: