10.3.4.6 In-Circuit Debugger Memory

An in-circuit debugger/emulator requires a portion of data memory for its variables and stack. Since the debugger is linked separately and in advance of user applications, the block of memory must be located at a fixed address and dedicated for use by the debugger.

/*
** ICD Debug Exec
**
** This section provides optional storage for
** the in-circuit debugger. Define a global symbol
** named __ICD2RAM to enable the debugger. This section
** must be loaded at data address 0x800.
*/
.icd __DATA_BASE (NOLOAD):
{
   . += (DEFINED (__ICD2RAM) ? 0x50 : 0 );
} > data

Section .icd is designed to optionally reserve memory for the in-circuit debugger/emulator. If global symbol __ICD2RAM is defined at link time, 0x50 bytes of memory at address 0x800 will be reserved. The (NOLOAD) attribute indicates that no initial values need to be loaded for this section. The name for this symbol was created when there was only one in-circuit debugger, the MPLAB ICD 2.