It is much easier to place code to RAM without RELOCATE_TO and custom CopyCodeToRAM() routine. You need dedicated PLACEMENT to RAM for code. You can't place variables and code to the same PLACEMENT since this will lead to build errors. Once code is redirected using #pragma to your dedicated code in RAM placement, the rest will do _Startup(). Without this automatic initialization one needs to care to compile code for one address (think about absolute addressing), but place it to different address so that it lands in nonvolatile memory.
In AN4258 RELOCATE_TO is present in prm/Project.prm file. AN4258 SCI interrupt routine keeps running in RAM ro receive new data. Interrupt vectors table at top of RAM is set up in static void InterruptModuleSetup(void). Only one vector for SCI is initialized in RAM vectors table. So if you wish to abandon RELOCATE_TO usage edit PRM like this
SEGMENTS
//RAM = READ_WRITE 0x3900 TO 0x3CFF;
//RAM_CODE_SEG = READ_ONLY 0xFD00 TO 0xFEFF RELOCATE_TO 0x3D00;
//ROM_F000 = READ_ONLY 0xF000 TO 0xFCFF;
RAM = READ_WRITE 0x3900 TO 0x3EFF;
// no need to split RAM SEGMENT INTO dedicated pieces for code and RAM
ROM_F000 = READ_ONLY 0xF000 TO 0xFEFF;
..
PLACEMENT
// RAM_CODE INTO RAM_CODE_SEG;
RAM_CODE INTO RAM;
..
I misguided you in previous messages to use dedicated PLACEMENT for code, no, it should be dedicated SEGMENT for code. No, I was right previously, you need dedicated PLACEMENT's for code and variables, updated PRM mods above, sorry.
Then add default Start12.c, edit bootloaders StartS12X.s to jump to _Startup instead of main:
xref _Startup ; was xref main
...
jmp _Startup ; was jmp main