How can I use a RealView symbol definitions file (symdefs/.sym) file in IAR Embedded Workbench for ARM?
This is an technically advanced solution. It requires that you for example know what AEABI is and what calling convention is used.
Only a limited numbers of errors and warnings can be produced for the external symbols.
You want one image generated with IAR Embedded Workbench for ARM to know the global symbol values of another image generated with RealView Compilation Tools.
You can use a symbol definitions (symdefs) file.
Generate and copy this file to your project directory. Use the armlink option --symdefs.
armlink --symdefs filename
For further information regarding the ARM Linker you are refeered to ARM documentation.
Use the sym2h.bat script file in prebuild to generate the .h and .f files -
IAR Embedded Workbench > Project > Options... > Build Actions > Pre-build command line:
$PROJ_DIR$\sym2h.bat $PROJ_DIR$\filename.sym
Use: sym2h.bat filename
The filename should be a fully qualified path name.
Output directory is the same as the input directory.
Filename input is required. The filename should be a fully qualified path name.
Output directory is the same as the input directory.
To use the generated symbol definitions file add an Extra Option to ilinkerarm.exe -
IAR Embedded Workbench > Project > Options... > Linker > Extra Options > select 'Use command line options' and Command line options:
-f $PROJ_DIR$\filename.f
Use: -f file
Read command line options from file
To use the generated external definitions file add include to your code -
#include "filename.h"
Tested with a symdefs file generated from RealView Compilation Tools version 2.2 [Build 576] and IAR Embedded Workbench for ARM version 5.11.
Note that this bat file only generates a standard definition based on if the symbol is A(arm) and T(thumb) or D(data).
If A or T script uses -
void <SYMBOL_NAME>();
If D script uses -
extern int <SYMBOL_NAME>;
You may have to cast the use of the symbols to what you need.
If you not already have your externally built image on your target, one way is to use -
ilinkarm.exe --image_input filename.axf
Use: --image_input file[,symbol[,section[,alignment]]]
Put image file in section from file
There is an example project on the link: Example project including sym2h.zip.
IAR Systems neither sells nor supports sym2h.bat - it is not part of our tool chain. Thus these files are provided as is without any promise of further support or information. If you have improvement suggestions regards to sym2h.bat that you want to share with us and other developers we are interested to hear them.
All product names are trademarks or registered trademarks of their respective owners.
© IAR Systems 1995-2021 - All rights reserved.
We use cookies on this website to provide you with a better experience. You need to accept cookies to continue using this site. Cookies