Hi Nada
RELOCATE_TO in your PRM relocates address of your functions in RAM_CODE from flash to RAM, but nothing copies code from flash to RAM. You need to memcpy((void*)0x3D00, (void*)0xFD00, 0x200) or something.
There's simpler way to have functions in RAM without RELOCATE_TO and memcpy:
1) in project wizard choose ansi startup instead of minimal. If you had minimal, you need to remove from compiler settings -D__ONLY_INIT_SP
2) PRM modification, just one additional line for RAM_CODE
PLACEMENT
..
RAM_CODE INTO RAM;
..
END
3) In you code for any function to be placed in RAM:
#pragma CODE_SEG RAM_CODE
void your_function(void)
{
}
#pragma CODE_SEG DEFAULT
This doesn't do any linker relocation, it directly compiles to RAM. Since RAM is READ_WRITE, linker will treat you code as initialized variables, fill copydown structure and startup routine will initialize RAM with proper code for your routines in RAM_CODE placement.
Edward