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 dsPIC33EP32MC504, several memory regions are defined:

/*
** Memory Regions
*/
MEMORY
{
  data  (a!xr)   : ORIGIN = 0x1000,        LENGTH = 0x1000
  reset          : ORIGIN = 0x0,           LENGTH = 0x4
  ivt            : ORIGIN = 0x4,           LENGTH = 0x1FC
  program (xr)   : ORIGIN = 0x200,         LENGTH = 0x55EC
  FICD           : ORIGIN = 0x57F0,        LENGTH = 0x2
  FPOR           : ORIGIN = 0x57F2,        LENGTH = 0x2
  FWDT           : ORIGIN = 0x57F4,        LENGTH = 0x2
  FOSC           : ORIGIN = 0x57F6,        LENGTH = 0x2
  FOSCSEL        : ORIGIN = 0x57F8,        LENGTH = 0x2
  FGS            : ORIGIN = 0x57FA,        LENGTH = 0x2
  FUID0          : ORIGIN = 0x800FF8,      LENGTH = 0x2
  FUID1          : ORIGIN = 0x800FFA,      LENGTH = 0x2
  FUID2          : ORIGIN = 0x800FFC,      LENGTH = 0x2
  FUID3          : ORIGIN = 0x800FFE,      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.