Hey Tom,
> >The only time I can ever think of needed to force a
> >particular code at a specific address is;
> >
> Just because you know a couple of things doesn't mean that you
> know it all.
>
Sorry, wasn't trying to sound like I knew it all, on
the contrary, I'm learning too, so wanted to know why,
given that I knew of two possible options.
So, thanks for responding :)
> If you recognized the "AT" directive then you would have
> understood that the question was regard to locating a section
> to a hard address. Typically this is done to describe where
> something such as a binary image produced by something other
> than the compiler. Or, it is done to physically locate entire
> Sections of code into external memory devices.
>
> Ok?
Yep, I understand now that Michel responded with a more detailed
response and showed that he wanted to locate a function at a
specific address. His original email was vague on the 'why',
which was why I wrote my response.
Since you are familiar with linker scripts, perhaps you can answer
a question for me :)
In the LPC2138 manual (lpc213x_um.pdf p227) there are comments
regarding the assumed use of RAM by the on-chip functions;
RAM used by ISP command handler
ISP commands use on-chip RAM from 0x4000 0120 to 0x4000 01FF.
The user could use this area, but the contents may be lost
upon reset. Flash programming commands use the top 32 bytes of
on-chip RAM. The stack is located at RAM top - 32. The
maximum stack usage is 256 bytes and it grows downwards.
RAM used by IAP command handler
Flash programming commands use the top 32 bytes of on-chip RAM.
The maximum stack usage in the user allocated stack space is
128 bytes and it grows downwards.
RAM used by RealMonitor
The RealMonitor uses on-chip RAM from 0x4000 0040 to 0x4000 011F.
The user could use this area if RealMonitor based debug is not
required. The Flash boot loader does not initialize the stack
for RealMonitor.
If you wanted to enable each of these features, what would be your
recommeded way of dealing with the preassigned blocks of RAM;
a) define multiple memory sections
i.e., instead of the normal
MEMORY
{
flash (rx) : org = 0x00000000, len = 0x00080000
sram (rw) : org = 0x40000000, len = 0x00008000
}
write
MEMORY
{
flash (rx) : org = 0x00000000, len = 0x00080000
/* reserve for real monitor */
sram_rm (rw) : org = 0x40000040, len = 0x000000E0
/* reserve for IAP stack */
sram_isp (rw) : org = 0x40000120, len = 0x000000E0
/* User SRAM */
sram (rw) : org = 0x40000200, len = 0x00008000
}
(actually, I don't think the reserved memory sections even need
to be defined, unless you use them in the SECTIONS area, simply
moving the start of SRAM to 0x40000200 would seem appropriate).
or
b) Keep the first MEMORY sections above, and create dummy sections
in the SECTIONS area and eject them into the sram at the right
spot?
Cheers,
DaveMessage
RE: [lpc2000] How to specify the location of an object in memory(GNU)
2005-11-02 by David Hawkins
Attachments
- No local attachments were found for this message.