M
moschops
In coding some embedded software, I frequently find that I need to read
from a specific memory location; it's a hard-wired location that always
contains the same information. A register, for example.
To do so, I tend to define a pointer along the lines of
int* pChipVersionNumber = 0x1000001
for example, where 0x10000001 is the permanent location of the data I'm
interested in.
The compiler I compile embedded code with (in the VDSP environment)
spits out a warning that I've created a pointer in this way, but
generates working code anyway.
Why would the compiler be warning me about this? Are there compilers
that would produce errors, rather than warnings? Is there some other way
I should be explicitly defining a location in memory to read?
To reiterate, these memory locations are not system variables with
nicely defined labels that I can fetch; they're raw locations.
It's common to use predefined values supplied with the chip support
software instead of stating the memory location myself, but in rooting
through the support code I find it usually ends up doing much the same
thing anyway.
'Chops
from a specific memory location; it's a hard-wired location that always
contains the same information. A register, for example.
To do so, I tend to define a pointer along the lines of
int* pChipVersionNumber = 0x1000001
for example, where 0x10000001 is the permanent location of the data I'm
interested in.
The compiler I compile embedded code with (in the VDSP environment)
spits out a warning that I've created a pointer in this way, but
generates working code anyway.
Why would the compiler be warning me about this? Are there compilers
that would produce errors, rather than warnings? Is there some other way
I should be explicitly defining a location in memory to read?
To reiterate, these memory locations are not system variables with
nicely defined labels that I can fetch; they're raw locations.
It's common to use predefined values supplied with the chip support
software instead of stating the memory location myself, but in rooting
through the support code I find it usually ends up doing much the same
thing anyway.
'Chops