We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi guys,
I'm having a problem with extern keyword and a variable defined in a specific memory area (section attribute).
I've defined and used in my main file the following variable:
static osThreadId_t LEDTaskID __attribute__((section("ram_shared"))) = NULL;
When I try to "include" this variable in another C file (svc_user.c) using the extern keyword, I get the following error:
.\Objects\SafetyNucleoG4.axf: Error: L6218E: Undefined symbol LEDTaskID (referred from svc_user.o). Not enough information to list image symbols. Not enough information to list load addresses in the image map.
I've tried to use the following code to include the variable:
extern osThreadId_t LEDTaskID; or extern osThreadId_t LEDTaskID __attribute__((section("ram_shared")));
But I get the same error (as reported above).
Thanks for your help,
Flavio
Ps: If I comment the code in the svc_user.c file (where the variable is used as extern), the code is compiled successfully.
Hi Flavio,
I believe it is because you have declared the variable as static.