Linker Script

Table of Contents

There are two basic linker scripts one to load into ROM and one for RAM. The script mrm_rom_1k.ld is a ROM script that reserved 1K on TOP of RAM that I allocated for personal use. This allows me to have persistent memory in the battery backed RAM.

The linker script is where memory layout for the program is setup. For details, consult the GNUPro Tools for Embedded Systems section the Linker Script. The important part, is the call to the STARTUP command where it loads C runtime 0 startup code (crt0). In the case of the MRM, it is the modified mrm_crt0.o. This command will have to be modified with the full path to this file.

STARTUP(/home/derek/oomrm/lib/startup/mrm_crt0.o)

mrm_crt0

The crt0 is where the _start symbol is defined where the application where boot. Again, for further information see the GNUPro Tools for Embedded Systems

__ram_start

Be sure to change your RAM size, either 512K or 32K. Also, the OOMRM ROM loaded linker script has been customized for the oGBcamera object. Currently, it sets aside a portion of memory 0x400 bytes for internal data for the 512K version. The GBcamera code will have to be further modified to work with the 32K version.

__ram_start  = 0x03100; /* 100 for oGBcamera */

__stack      = __ram_start + __ram_size - 0x49000; /* 0x49000 for TASK_RAM, WAYPOINT_RAM, MAP_RAM, and ID_RAM */

GROUP

Sets up all the default libraries to link upon startup. Currently contains:

  1. mrm
  2. c
  3. gcc
  4. m

_end

This symbol defines the heap start and is used in sbrk.c to establish memory allocation.