After reading AN4329, I attempted to implement the relocation of a function to internal RAM, but cannot get the compiler to do it. The only difference between my program and the example is that the "funcInRAM" is located in a different '.c' file, and I believe this is causing the problem. I have read through some other discussions on this forum which discuss other problems, but not this one.
The problem is visible in the xMAP, which shows that "my_ram" (where the function should have been relocated to) is empty.
#>2000C000 ___myRAMStart (linker command file)
#>2000C000 ___myRAMEnd (linker command file)
#>00000000 ___CodeSize (linker command file)
The main loop calls the 'funcInRAM()' repeatedly in an infinite loop, and the 'funcInRAM' is defined as follows in a separate file:
#pragma define_section mySectionInRAM ".myCodeInRAM" far_absolute RX
#pragma section mySectionInRAM begin
#pragma section mySectionInRAM end
I have attached my LCF to this post.
I appreciate any help, as I am quite stuck on this.
 relocating code
Original Attachment has been moved to: MK20FX512_flash.lcf.zip