Porting from GCC to SEGGER Linker

From SEGGER Wiki
Revision as of 18:36, 5 September 2018 by Johannes (talk | contribs) (Created page with "The SEGGER Linker can easily be used in an existing project to replace the GNU Linker. == Porting an existing Embedded Studio Project == In a standard Embedded Studio project...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The SEGGER Linker can easily be used in an existing project to replace the GNU Linker.

Porting an existing Embedded Studio Project

In a standard Embedded Studio project the target's memory layout is defined in *_MemoryMap.xml. The memory map file can be reused with the SEGGER Linker.

For a default project with one FLASH and one RAM region, these steps need to be done:

  1. Copy the SEGGER Linker Script template file from $(StudioDir)/samples/SEGGER_Flash.icf into your project directory.
  2. Copy the matching startup file from $(StudioDir)/samples/SEGGER_THUMB_Startup.s into your project directory.
  3. Set the project option "Linker" to "SEGGER".
  4. Set the project option "Linker Script File" to the linker script in your project directory.
  5. Exclude or remove thumb_crt0.s from your project.
  6. Add SEGGER_THUMB_Startup.s to your project.

If your memory layout contains multiple FLASH or RAM regions, you can tell the SEGGER Linker to automatically place into multiple regions:

 place in RAM1 then RAM2 { ... };

If you added additional sections to your *_placement.xml, you can also do this in the SEGGER Linker script:

 place in RAM { ..., .myregion };

The SEGGER Linker offers even more functionality to provide you with extensive placement options to best utilize your target's memory. Refer to the SEGGER Linker User Guide (included in Embedded Studio).