Placing data at a specific memory location
Does anyone know how to place data(variable) at a specific memory location?
I tried:
#pragma dataseg("DATA")
BYTE var;
#pragma dataseg(default)
and then I added a program section in the linker placement file:
<ProgramSection load="Yes" start="0x2400" name="DATA"/>
But my "var" is not placed in memory location 0x2400.
Anyone knows what I am missing?
Thanks
-
I'm in the process of upgrading my project from Cross Studio v1.3 to v2.0.9 (for MSP430). I'm trying to place a specific code section at a specific address, but the ProgramSection "start" arguement is being ignored and simply placing the code section after the end of the previous section. Here's an example of what I am doing:
<MemorySegment name="FLASH">
<ProgramSection load="Yes" name="CODE" />
<ProgramSection load="Yes" name="CONST" />
<ProgramSection load="Yes" start="0xec00" name="MyCode" />
</MemorySegment>
I would expect to see MyCode section at 0xEC00, but it falls immediately after CONST.
Any ideas?
Please sign in to leave a comment.
Comments
5 comments