Skip to main content
Visitor II
January 19, 2005
Question

ST92F150 split code into 2 fash sectors by files

  • January 19, 2005
  • 2 replies
  • 738 views
Posted on January 19, 2005 at 09:06

ST92F150 split code into 2 fash sectors by files

    This topic has been closed for replies.

    2 replies

    Visitor II
    May 17, 2011
    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

    Visitor II
    May 17, 2011
    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