2023-02-26 09:10 PM
I have issue in the following line of code when i am compiling the code with this in IAR it is alright but in stm32cubeide it is showing "stray @ in program" error
Can anyone help me to resolve this.
Code line:- const char [gcpAP_fw_ver] @ FW_VER_STR_ADDR = FW_VER;
2023-02-26 09:15 PM
You want to force a memory location for your variable, this maybe custom notation or requires warning disabling. Need to look in GCC or compiler documentation. The other way around is define a memory region in the linker file (through CubeIDE/MX) and place the variable in the special segment using probably a #pragma.
2023-02-26 10:21 PM
@S.Ma I have tried many ways but still same problem is their. Can you suggest me lines which i need to edit in my .ld file to store this address into a paritcular location.
2023-02-27 08:03 PM
Your question is not STM32 specific, it is compiler's
Maybe have a look at post like this one.