| |||
| Home > Memory Mapping > Generating linker command files for non-ARM targets | |||
The memory map, shown in the Process Control Map tab,
can be used to generate or modify a MEMORY section
of a linker command file used when you build your program. This MEMORY directive
information can then be used to position various sections of an application
correctly. For details of how to set up such command options see
the chapter describing customizing projects in the RealView
Developer Kit v2.1 Project Management User Guide.
To generate or modify a linker command file:
Right-click on the start address at the top of the entries and select Save Map to Linker Command File... from the context menu.
Specify the location of the file in the Select Linker Command File to Create or Modify dialog box. Remember that:
If the file already exists, RealView Debugger looks for
a MEMORY directive block created previously and,
if found, replaces that block.
If the file already exists, but no MEMORY directive
block exists, RealView Debugger locates the first MEMORY section
and inserts the MEMORY directive block before
it.
If the file already exists, RealView Debugger makes a backup copy before updating the contents.
If there is no existing file, RealView Debugger creates
the specified file ready to accept the MEMORY directive
block.
The RealView Debugger linker command file generation process uses the built-in automatic memory mapping to generate data based on the connected target settings, for example the registers that control mapping.
The data recorded in the generated MEMORY block
includes each internal RAM, ROM, and Flash section as appropriate.
Each section is allocated a predefined name. All external memory
added using the Map tab, or defined automatically
from a loaded image, is allocated a name based on the characteristics
of the memory.
The linker file format is processor-specific. If none is known, RealView Debugger uses a default format based on TI tools.
Example 6.1 shows an example of a generated linker command file. The generated command file for your evaluation board might be different to this example.
Example 6.1.
/* Linker Command file for the ARM processor */
/* This file was generated by RVDEBUG. You can edit everything
outside the MEMORY block defined by RVDEBUG. Updates by
RVDEBUG will only affect that block. */
/* RVDEBUG: generated data block. Updated Wed Mar 19 17:23:41 2003
Do not modify this block. Do not put MEMORY lines above
this line, put below end of this block. */
MEMORY
{
/* Register @G_CM_CTRL has (masked) value 0000 */
/* Register @G_CM_SDRAM has (masked) value 0000 */
M_BootROM(R): org=0x0000, len=0x3FFFF /* external WaitStates=5 'Boot' */
M_CM_Regs: org=0x10000000, len=0xFFFFFF /* external WaitStates=1 'CM Registers' */
}
/* RVDEBUG: generated data above */
This example shows a combination of internal memory based
on current register settings (@G_CM_CTRL and @G_CM_SDRAM)
in addition to external memory as defined by the loading of a program.
The following notes apply to this automatic file generation process:
If RealView Debugger creates the linker command file a comments section is inserted in the file reporting that it was generated by RealView Debugger, shown in Example 6.1.
If a file already exists and is being updated by RealView Debugger, the comments section is not inserted. RealView Debugger then inserts the generated commands above the original user-generated commands.
If a file already exists and contains a RealView Debugger generated data block then this section is replaced when RealView Debugger updates the command file.