Skip to main content
SGoel.2
Associate III
February 27, 2023
Question

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.

  • February 27, 2023
  • 2 replies
  • 1379 views

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;

This topic has been closed for replies.

2 replies

S.Ma
Principal
February 27, 2023

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.

SGoel.2
SGoel.2Author
Associate III
February 27, 2023

@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
February 28, 2023

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

Maybe have a look at post like this one.