cancel
Showing results for 
Search instead for 
Did you mean: 

ST92F150 split code into 2 fash sectors by files

scott239955
Associate II
Posted on January 19, 2005 at 09:06

ST92F150 split code into 2 fash sectors by files

2 REPLIES 2
scott239955
Associate II
Posted on May 17, 2011 at 11:36

Does anyone know how to split code into two flash sectors on a file bases. In other words, instead of specifying flash section for each function, can you do it for all the functions in a file or files?

Instead of:

void my function(void) CODE_SECTION (.code_sec2);

Can you place all the functions in my_file.c in .code_sec2 with one specification?

:o

kapil
Associate II
Posted on May 17, 2011 at 11:36

Yes You can do this as Following

If you have five files crtbegin.c, crtend.c, main.c, mem.c, timers.c

and want to allocate first 3 to one sector and other two in to another sector e.g Flash2 and Flash3 (defined by you )

do the following in the .ld file

.text :

{

crtbegin.o(.text)

crtend.o(.text)

main.o(.text)

} > FLASH2

.text1 :

{

mem.o(.text)

timers.o(.text)

} > FLASH3