[En-Nut-Discussion] Move some code parts from an application running in ROM to RAM

Harald Kipp harald.kipp at egnite.de
Wed Nov 14 09:45:48 CET 2007


Matthias Wilde schrieb:
> I have running on an Ethernut 3 an large application in ROM. Especially
> for the interrupt service routines I would like to move some routines to
> RAM to execute faster.
> I wonder if I need to define these routines in the linker script explicit
> or is there a easier way out like a flag "prog_char" to prepare a function
> for RAM?
>
>   
The following addition is required in the linker script:

.ramfunc : AT (__ramfunc_image)
{
        PROVIDE (__ramfunc_start = .);
        *(.ramfunc)
        . = ALIGN(4);
        PROVIDE (__ramfunc_end = .);
} >ram

Add the following attribute to the function that should run in RAM:

 __attribute__ ((section(".ramfunc")))

Harald




More information about the En-Nut-Discussion mailing list