This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

where to define specific sections for linker

Other Parts Discussed in Thread: SYSBIOS

I'm uisng F2808, with CCS 4.x and BIOS 6.x.

When I do a build all, the common_p28L_x.xdl file gets regenerated. This file appears to be used when I link.

I tried to change some of the sections to different memory areas (such as .text and .cio) in the common_p28L_x.xdl, but of course, when I do a build all, the file gets overwritten. It is putting the sections in various places, but I don't know where to define those, so I can specifically place sections at different locations.

What do I need to change / update to redefine where the tool is automatically putting those sections?  I want to specifically define where individual sections are place. For example, can I place .cio to L0SARAM or .cio to L1SARAM?

I'm having a hard time distinguishing what level control I have over the linker, as oppose to what gets autogenerated.

Thanks-

Jeff

  • Hi Jeff,

    You can place sections in your BIOS configuration file (*.cfg). Here is an example showing placement of ".cio".

    Program.sectMap[".cio"].runSegment = "L0SARAM";

    The BIOS User guide has a Memory chapter that has more details. The latest doc can be found here: 

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_30_02_42/exports/docs/docs/Bios_User_Guide.pdf

    Regards,

    Nitya

  • That gets me closer.  Good information.

     

    I added the following line to my common.cfg file.

    Program.sectMap[".text"].runSegment = "FLASH";

    I get an error that says: Cannot set property "runSegment" of undefined to "FLASH"

    The FLASH section was defined in the MEMORY structure in my common_p28L_x.xdl (autogenerated).

    MEMORY
    {
        PAGE 0: MSARAM : org = 0x0, len = 0x800
        PAGE 1: PIEVECT : org = 0xd00, len = 0x100
        PAGE 0: LSARAM : org = 0x4000, len = 0x2000
        PAGE 0: OTP : org = 0x3d7800, len = 0x400
        PAGE 0: FLASH : org = 0x3e8000, len = 0x10000
        PAGE 0: H0SARAM : org = 0x3f8000, len = 0x2000
        PAGE 0: BOOTROM : org = 0x3ff000, len = 0xfc0
    }

    It seems that the CFG file does not know that the MEMORY structure was defined in the autogenerated file?

    What am I doing wrong? 

    There's probably a benefit having to set up all thses files just to set up the linker map, I just can't see it right now.

    Thanks-

    Jeff

     

  • I apologise!  You only need the following line.

    Program.sectMap[".text"] = "FLASH";

    To be able to set load and run Segments the cfg code is a bit more elaborate.

    Program.sectMap[".text"] = new Program.SectionSpec();

    Program.sectMap[".text"].loadSegment = "FLASH";

    Program.sectMap[".text"].runSegment = "RAM";

    You could also add your own linker.cmd file to your project with SECTIONS information.

    Regards,

    Nitya

     

  • Thanks Nitya-

    That worked!!  I was able to squeeze the SYS/BIOS into the F2808..although I'm not sure I'll have much room for anything else...I shall see (keeping my fingers crossed).

    I look forward to when TI can improve the Linker / memory map configuration so it's a little more centralized and straight forward. It's not easy for us guys that are use to modifying 1 text linker file, then compiling.  This new process is a bit cumbersome (half automated, the other half manual,  and the other half guess work...Yes, in my world there are 3 halves :-) )

    Thanks again for your help.

    Jeff

  • Hi Jeff,

    SYSBIOS does allow users to minimize code and data used.  The User Guide has a section "Minimizing Application footprint section"  that will help.

    I will give your feedback to the right people.

    Regards,

    Nitya