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,
I'm trying to have a certain variable lets say "const uint8_t Version[4] = {0x01,0x02,0x03,0x04}" at a specific place memory region.For doing so i've used the section attribute of "__attribute__((section("name"))) variable attribute".Here is the definition:const uint8_t Version[4] __attribute__((section("VER_SECTION"))) = {0x01,0x02,0x03,0x04};
I've also added another execution region in the corresponding scatter file like below:ER_VER __VER_BASE __VER_SIZE { opcodes.o (VER_SECTION) }
However during link stage i got the below error:" Warning: L6329W: Pattern opcodes.o(VER_SECTION) only matches removed unused sections"
I though that using the "--keep" linker flag will help to solve the problem so i tried:--keep="opcodes.o (VER_SECTION)"but it didn't help.Your help will be appreciated.
BTW, regarding "section attribute" usage i understood that "The section attribute specifies that a variable must be placed in a particular data section". While my variable is of const uint8_t which means it goes into RO/CODE area - maybe this is the problem root cause?
Thanks,Ronen
Hi Ronan,Here is the correct definition sequence:
As we can see, the ''--keep" points on the variable name ("VER_NUM") and not the section name ("VER_NUM_SEC").