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.
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?func?file(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))
int add(int a, int b)
{
return a+b;
}
//-----------------------------------------------------------------------------
// Main Routine
//-----------------------------------------------------------------------------
void main (void)
{
int x, y;
add(x,y);
while (1) {} // Spin forever
}
Locating a Function at an Absolute Flash Address
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.
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:
Where func is the function name and file is the file name where the function is located. An example would be:
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:
Where func is the function name and file is the file name where the function is located in. An example would be: