Place Functions in RAM with SEGGER Linker

From SEGGER Wiki
Revision as of 15:48, 17 June 2020 by Nino (talk | contribs) (Created page with "Category:Embedded Studio This article will show how to place a function into RAM with SEGGER Linker and Embedded Studio. = How to= * Create a symbol or function you want...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This article will show how to place a function into RAM with SEGGER Linker and Embedded Studio.

How to

  • Create a symbol or function you want to place in RAM
  • Open the SEGGER Linker script file and place the specific symol in RAM. This can be done e.g. as follows (or in one of the other ways documented ):
place in RAM1 {symbol MySymbol};
  • To make sure this stays valid after a reset/reboot of the device the library functions must be initialized during startup by copying them from Flash to RAM. That way the application also works stand alone without a debugger.
  • This can be done by adding the following line to the remaining "initialize by copy entries".
initialize by copy { section .text.MySymbol, section .text.MySymbol.* };

Example project

The following example project will show an example implementation of such RAM function. A simple function Count() is created which is placed in RAM and executed.

Prerequisites

To be able to build and debug the project the following prerequisites must be met:

Project files

RAMFunc_Example.zip