cancel
Showing results for 
Search instead for 
Did you mean: 

Hi all, I am new to working on stm32cubeide, earlier i have working experience of Embedded IAR workbench & a very strange situation I am facing now Can anyone give me solution regarding this.

SGoel.2
Associate III

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;

3 REPLIES 3
S.Ma
Principal

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.

@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.

S.Ma
Principal

Your question is not STM32 specific, it is compiler's

Maybe have a look at post like this one.