hello Ivan.
I suggest you check this document
Relocating Code and Data Using the CW GCC Linker File for Kinetis
it includes how to copy code from ROM to RAM
============================================
this answer is for you. if it helps, please click on "Correct Answer " button. thanks!
Best Regards.
Zhang Jun
Hello.
You can easily copy it using memcpy.
Take a look at this code snippet:
void romFunction (void)
{
//Do your stuff
};
void main (void)
{
uint8_t ramSpace[1000];
memcpy (ramSpace,romFunction,1000); //Don't care if you copy more code than needed. After function return, no code will be executed
void (*ramFunction)(void)=(void (*)(void))ramSpace;
ramFunction();
}
Regards.