Using isymexport to export symbols from one project to another

Technical Note 95375

Architectures:

ARM

Component:

linker

Updated:

5/31/2018 9:14 AM

Introduction

You want to place const data in (for example) external flash, and later on use the data from a separate project. Using the method described in this Technical Note, you will be able to use the symbolic names of the const data (i.e. there is no need to use absolutely placed symbols and use their addresses to access them). You will also avoid re-downloading the const data to flash, and having to rebuild it in the project.

Solution

Use the IAR Absolute Symbol Exporter, "isymexport". This is a step-by-step instruction on it's use:

A1. Create a project for the const data library.

A2. Configure the target device (for example Cortex-M3).

A3. Configure the linker to use an address range separate from the application.

A4. Select General Options -> Library Configuration -> Library: None

A5. Set the default program entry to an existing symbol in Linker -> Library options.

A6. Add the export of library symbols in Build Actions -> Post-build command line:

$TOOLKIT_DIR$\bin\isymexport.exe "$TARGET_PATH$" "$PROJ_DIR$\const_lib.symbols" --edit "$PROJ_DIR$\const_data_lib.edit"

 

B1. Create a project for the application .

B2. Configure the target device (for example Cortex-M3).

B3. Configure the linker to use an address range separate from the address range of the library.

B4. Add the exported library symbols to Options -> Linker -> Library -> Additional libraries:

$PROJ_DIR$\const_lib.symbols

 

C1. If the flash where the const data is located is supported by an IAR Embedded Workbench for for ARM flash loader, you can download the const data library to the target device (needed at least once) by adding the output file to Options -> Debugger -> Download extra image -> Path:

$PROJ_DIR$\Debug\Exe\const_lib.out

Comments

  • You will find an example project on the link: Example project (ARM 8.11).
  • Also see the screenshots below showing the various project options that need to be set. 
  • In the library, the const data variables are marked with __root to force the linker to keep the data.
  • The symbols are saved in the "const_lib.symbols" file. Note that there is no strict name/extension to be used, ".symbols" is just an example.

All product names are trademarks or registered trademarks of their respective owners.

We do no longer support Internet Explorer. To get the best experience of iar.com, we recommend upgrading to a modern browser such as Chrome or Edge.