This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

extern and __attribute__((section("xxx"))) [Arm Compiler v6]

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:

Fullscreen
1
static osThreadId_t LEDTaskID __attribute__((section("ram_shared"))) = NULL;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When I try to "include" this variable in another C file (svc_user.c) using the extern keyword, I get the following error:

Fullscreen
1
2
3
.\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.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I've tried to use the following code to include the variable:

Fullscreen
1
2
3
4
5
extern osThreadId_t LEDTaskID;
or
extern osThreadId_t LEDTaskID __attribute__((section("ram_shared")));
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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.

0