I am working on an embedded C project using GCC for ARM V4.8.3. What I am trying to achieve is to place a structure into the FLASH (ROM) memory of the MCU. Since my previous post I was thinking that each object identifier qualified as a constant (const
) is to be placed into the .rodata
section, which in my case (according to the liker script) is nested by .text
which in other hand resides within the FLASH memory region.
I tend to think so because I checked one of my object definitions, which was a constant pointer:
const char * const project_stringInvalidCharacter = "Invalid Character! \n";
The pointer was situated within FLASH if qualified as a constant.
But, when I defined a constant object of type int (const uint_8 myObj;
), I saw that its address represented a number that belong to the RAM or .bss
region.
In other words const
works for the pointer, but didn't for integer type. By works I mean it does what I expect, reasoning from my previous post, namely to "place" the identifier into the FLASH (ROM).
Format String Vulnerabilities
andReturn with parenthesis
. I don't see warning that has something to do with unassigned read-only data objects. Or something like that. If you are familiar with Eclipse IDE 3.8.1, could you please help me to enable them? - Hairirodata
anyway). Only solution is to always initialise staticconst
variables. - too honest for this site