Locating a Function at an Absolute Flash Address

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Master Employee</font></font> </a> delu on ‎04-13-2017 04:32 PM

Question

How do I locate a function at an absolute flash address in Simplicity Studio?

Answer

Simplicity Studio supports both the Keil LX51 and BL51 linkers. To select between these, go to Project Properties->C/C++ Build->Settings->General Settings->Use Extended Linker (LX51) instead of BL51.

 

If you check the checkbox, the LX51 linker will be selected; otherwise, BL51 will be selected.

 

Linker.png

 

BL51

 

To locate code at an absolute address with BL51, use the following command-line flag in the Linker area under Project Properties->C/C++ Build->Settings:

 

 

CODE(?PR?func?file(800H))

 

 

Where func is the function name and file is the file name where the function is located.  An example would be:

 

 

CODE(?PR?_ADD?EFM8LB1_BLINKY(800H))

 

 

 

LX51

 

To locate code at an absolute address with LX51, use the following command-line flag in the Linker area under Project Properties->C/C++ Build->Settings:

 

 

SEGMENTS(?PR?_ADD?EFM8LB1_BLINKY(C:2000H))

 

 

Where func is the function name and file is the file name where the function is located in. An example would be:

 

 

SEGMENTS(?PR?_ADD?EFM8LB1_BLINKY(C:2000H))