AnsweredAssumed Answered

MPC560xB - Copy a code from flash to RAM for executing it in RAM

Question asked by Romain BENET on Mar 1, 2016
Latest reply on Mar 2, 2016 by Romain BENET

Hi,

 

for my application I have to execute a specific code in RAM location.

My problem is: how can I store by default this specific code into flash memory and at the beginning (startup execution before main application) this code is automatically copying into RAM memory and execute from RAM location automatically when I call this function?

 

For example:

function to save in ROM and to copy in RAM: void ExecuteInRam(void)

memory section into the linker:

          SaveCodeInFlash:     org = 0x00003000, len = 0x00001000 /** section where is stored this function in flash */

          ExecuteCodeInRam: org = 0x40000000, len = 0x00001000 /** section where is copying this function for execution */

 

I read CodeWarrior Linker Command File (LCF) for Qorivva/PX [AN4497] / Kinetis [AN4498] and Relacating Code and Data using the CodeWarrior LCF for ColdFire Architecture [AN4329] documents but I need your help.

 

Best Regards,

Romain

Outcomes