10.3.2 Memory Region Information

The next section of a linker script defines the various memory regions for the target device using the MEMORY command.

For the dsPIC30F3014, several memory regions are defined:

/*
** Memory Regions
*/
MEMORY
{
  data  (a!xr)   : ORIGIN = 0x800,         LENGTH = 0x2000
  reset          : ORIGIN = 0x0,           LENGTH = 0x4
  ivt            : ORIGIN = 0x4,           LENGTH = 0x7C
  _reserved      : ORIGIN = 0x80,          LENGTH = 0x4
  aivt           : ORIGIN = 0x84,          LENGTH = 0x7C
  program (xr)   : ORIGIN = 0x100,         LENGTH = 0x17F00
  eedata         : ORIGIN = 0x7FF000,      LENGTH = 0x1000
  FUID0          : ORIGIN = 0x8005C0,      LENGTH = 0x2
  FUID1          : ORIGIN = 0x8005C2,      LENGTH = 0x2
  FUID2          : ORIGIN = 0x8005C4,      LENGTH = 0x2
  FUID3          : ORIGIN = 0x8005C6,      LENGTH = 0x2
  FOSC           : ORIGIN = 0xF80000,      LENGTH = 0x2
  FWDT           : ORIGIN = 0xF80002,      LENGTH = 0x2
  FBORPOR        : ORIGIN = 0xF80004,      LENGTH = 0x2
  RESERVED1      : ORIGIN = 0xF80006,      LENGTH = 0x2
  RESERVED2      : ORIGIN = 0xF80008,      LENGTH = 0x2
  FGS            : ORIGIN = 0xF8000A,      LENGTH = 0x2
  FICD           : ORIGIN = 0xF8000C,      LENGTH = 0x2
}

Each memory region is range-checked as sections are added during the link process. If any region overflows, a link error is reported.

MEMORY regions are shown below.