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

Matthias Wilde ethernut at stockelache.de
Tue Mar 18 18:16:29 CET 2008


Hello Harald,

may be you remember the discusion to let some functions run inside ram
where the major part of the application runs in ROM.
For this I would like to request changes in the linker scripts at91_rom.ld
and at91_httprom.ld

Original:


  .data : AT (__data_load_start)
  {
    PROVIDE (__data_start = .);
    *(.data)
    . = ALIGN(4);
    edata = .;
    _edata = .;
    PROVIDE (__data_end = .);
  } > ram


New version added ramfunc section:

  .data : AT (__data_load_start)
  {
    PROVIDE (__data_start = .);
    *(.data)
    . = ALIGN(4);
    *(.ramfunc)
    . = ALIGN(4);
    edata = .;
    _edata = .;
    PROVIDE (__data_end = .);
  } > ram


In my application this works fine, if anybody has concerns about this,
please let me know


Best regards


Matthias Wilde




> 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
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>


-- 




More information about the En-Nut-Discussion mailing list