Ahmad Nasser

copying code from ROM to RAM on startup on MPC56xx

Discussion created by Ahmad Nasser on Aug 26, 2010
Latest reply on Jun 29, 2011 by medhat hussain

I am using the MPC5645S. I have some files that need to be located in flash but copied to RAM on startup. The startup code performs the copy by parsing a table __rom_copy_info:

__rom_copy_info *dci;
    __bss_init_info *bii;
    
     /* Copy from ROM to RAM: */

    dci = _rom_copy_info;
    while (1) {
        if (dci->rom == 0 && dci->addr == 0 && dci->size == 0) break;
         __copy_rom_section(dci->addr, dci->rom, dci->size);
         dci++;
    }

My question is how to tell the linker to specify that certain segments/files need to be located in that table so that the code can be copied to RAM on startup?

Outcomes