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.

F2808 'C' section assignments

I have 2 files of lookup tables that I want in FLASH sectors A & B respectively for updating the operating parameters.

I use BIOS to assign:

FLASH_TBL1  base: 3E8000, len: 4000, space: code

FLASH_TBL2  base: 3EC000, len: 4000, space: code

FLASH             base:3F000, len 7F80, space: code

How do I get the linker to put the tables in the proper place - they are declared as constants.  The #pragma CODE_SECTION wants a function name to place, so how do I place a tables section?

THANKS!

  • Use the #pragma DATA_SECTION described in Section 6.10.5 of the TMS320C28x Optimizing C/C++ Compiler v6.0 User's Guide.

  • OK, I put in the #pragma DATA_SECTION statements and changed the Table sections to data, page 1 in the bios memory settings.  If I don't do anything else It compiles and links with a warning that the sections are undefined.  If I go ahead and flash the part, there are no tables where they should be.  If I put

    SECTIONS{

    TABLE1 : > FLASH_TABLE1 etc

    I get error: can't find any memory areas for allocation of TABLE1...

     

    Thanks for the help!

  • Just so that I am clear, you have defined a memory segment called FLASH_TBL1 but in the linker command file you are allocating TABLE1 to FLASH_TABLE1?

    Shouldn't it be :

    SECTIONS{

    TABLE1 : > FLASH_TBL1

  • Sorry, I just fudged the names for expediency.  The names match.  To re-state, in BIOS I declare:

    FLASH_TBL1 base: 0x3E8000, len:0x4000, space:data

    FLASH_TBL2 base: 0x3EC000, len:0x4000, space:data

    FLASH base:0x3F000, len 0x7F80, space:code

     

    I put pragma statements in the table files.  For the table targeted to FLASH_TBL1 I use:

    #pragma DATA_SECTION(tFluxZero, "FZTBLS")

     

    And several tables / constants targeted to FLASH_TBL2 using this format:

    #pragma DATA_SECTION(SiMax, "TBLS")

    #pragma DATA_SECTION(TiMax, "TBLS")

    #pragma DATA_SECTION(Imot, "TBLS")

     

    const Uint16 SiMax = 16;                       

    const Uint16 TiMax = 16;

    const Uint16 Imot[17][17] =                    

     

    Finally I try including these two lines in the ‘SECTIONS’ of the user.cmd file

     

    SECTIONS

    {

     

    .

    /*** Section FZTBLS      ***/

                FZTBLS                        : > FLASH_TBL1,                     PAGE = 1        

     

    /*** Section TBLS                      ***/

                TBLS                            : > FLASH_TBL2,                     PAGE = 1

    }

     

    And that is when I get the errors:

    >> warning: can't find a memory area named 'FLASH_TBL1' on page 1 for

                allocation of 'FZTBLS'

    >>   error: can't find any memory areas for allocation of 'FZTBLS'

    >>   error: can't allocate 'FZTBLS' into 'FLASH_TBL1' (page 1)

    >> warning: can't find a memory area named 'FLASH_TBL2' on page 1 for allocation

                of 'TBLS'

    >>   error: can't find any memory areas for allocation of 'TBLS'

    >>   error: can't allocate 'TBLS' into 'FLASH_TBL2' (page 1)

    >>   error: errors in input - ./Debug/SR_F2808.out not built

     

    Thanks Again!

    Carl

     

     

  • This may sound obvious, but is the linker command file that BIOS generates included in the project?

    Somewhere, a linker command file needs to have a MEMORY statement declaration for FLASH_TBL1 and FLASH_TBL2.

  • Carl,
    which version of BIOS are you using? How did you specify your memory layout, in which file?

  • I have

    CCS 3.3.38

    IDE 5.98.0.219

    BIOS 5.31.02

    Code Gen Tools v4.1.3

     I set up the memory in the BIOS.  I may be missing a step somewhere, because even though I add memory sections in the Memory Section Manager they don't show up in the script window and looking at the generated _cfg.cmd file I can see that my new sections are not included.

     /* MODULE MEM */

    -stack 0x200

    MEMORY {

       PAGE 1:   M0SARAM:    origin = 0x400,         len = 0x400

       PAGE 1:   L0SARAM:    origin = 0x8000,        len = 0x1000

       PAGE 0:   OTP:        origin = 0x3d7800,      len = 0x400

       PAGE 0:   FLASH:      origin = 0x3e8000,      len = 0xff80

       PAGE 0:   H0SARAM:    origin = 0xa000,        len = 0x2000

       PAGE 0:   BOOTROM:    origin = 0x3ff000,      len = 0xfc0

       PAGE 1:   PIEVECT:    origin = 0xd00,         len = 0x100

       PAGE 0:   L1SARAM:    origin = 0x9000,        len = 0x1000

       PAGE 0:   BEGIN_M0:   origin = 0x0,           len = 0x2

       PAGE 0:   BEGIN_FLASH: origin = 0x3f7ff6,     len = 0x2

       PAGE 0:   CSM_RSVD:   origin = 0x3f7f80,      len = 0x76

       PAGE 0:   PASSWORDS:  origin = 0x3f7ff8,      len = 0x8

    }

     

     

  • Carl,
    when you add a memory object in the Memory Manager, you are not seeing the corresponding statements being created in the right pane of gconf, where the Tconf script is generated? Is that specific to the Memory Manager? If you create other objects, logs for example, do they appear in the Tconf script? Any warnings when you click on Save icon?

  • So, the .tcf file does have some updates.  The original configuration is at the beginning and the updates are at the end of the file.  No warnings are generated when I save.

    /* applying user changes */

    bios.L1SARAM = bios.MEM.create("L1SARAM");

    bios.L1SARAM.base = 0x9000;

    bios.L1SARAM.len = 0x1000;

    bios.L1SARAM.createHeap = 0;

    bios.BEGIN_M0 = bios.MEM.create("BEGIN_M0");

    bios.BEGIN_M0.len = 0x2;

    bios.BEGIN_M0.createHeap = 0;

    bios.BEGIN_M0.space = "code";

    bios.MEM.EBSSSEG = prog.get("M0SARAM");

    bios.L0SARAM.len = 0x1000;

    bios.FLASH.base = 0x3e8000;

    bios.FLASH.len = 0xfff6;

    bios.H0SARAM.base = 0xa000;

    bios.LNK_dataPump.order = 1;

    bios.RTA_dispatcher.order = 0x2;

    bios.IDL_cpuLoad.order = 0x3;

    bios.PIE_INT1_6.fxn = prog.extern("ADCINT_ISR");

    bios.PIE_INT1_8.fxn = prog.extern("WAKEINT_ISR");

    bios.PRD_clock.order = 1;

    bios.M0SARAM.base = 0x2;

    bios.M0SARAM.len = 0x3fe;

    bios.M0SARAM.createHeap = 0;

    bios.M0SARAM.base = 0x400;

    bios.M0SARAM.len = 0x40

    :

    :

    bios.MEM.instance("FLASH").base = 0x3ef000;

    bios.MEM.instance("FLASH").len = 0x7f80;

    bios.MEM.create("FLASH_TBLS");

    bios.MEM.instance("FLASH_TBLS").base = 0x000003;

    bios.MEM.instance("FLASH_TBLS").len = 0x4000;

    bios.MEM.instance("FLASH_TBLS").createHeap = 0;

    bios.MEM.instance("FLASH_TBLS").space = "code";

    bios.MEM.create("FLASH_FZTBL");

    bios.MEM.instance("FLASH_FZTBL").base = 0x3e8000;

    bios.MEM.instance("FLASH_FZTBL").createHeap = 0;

    bios.MEM.instance("FLASH_FZTBL").len = 0x4000;

    bios.MEM.instance("FLASH_FZTBL").space = "code";

    bios.MEM.instance("FLASH_TBLS").base = 0x3ec000;

    bios.MEM.instance("FLASH").base = 0x3f0000;

    bios.MEM.instance("FLASH_FZTBL").space = "data";

    bios.MEM.instance("FLASH_TBLS").space = "data";

    bios.MEM.instance("FLASH_FZTBL").destroy();

    bios.MEM.create("FLASH_TBL1");

    bios.MEM.instance("FLASH_TBL1").base = 0x3e8000;

    bios.MEM.instance("FLASH_TBL1").createHeap = 0;

    bios.MEM.instance("FLASH_TBL1").len = 0x4000;

    bios.MEM.instance("FLASH_TBLS").destroy();

    bios.MEM.create("FLASH_TBL2");

    bios.MEM.instance("FLASH_TBL2").base = 0x3ec000;

    bios.MEM.instance("FLASH_TBL2").createHeap = 0;

    bios.MEM.instance("FLASH_TBL2").len = 0x4000;

    // !GRAPHICAL_CONFIG_TOOL_SCRIPT_INSERT_POINT!

    if (config.hasReportedError == false) {

    prog.gen();

    }

     

  • Ok, so your TCF script contains your new memory objects, but when you build the project the objects are not in the generated linker command file, correct? If you go to Debug directory of your project, you'll find a file with the extension .cdb. Can you please post it together with the linker command file after you clean and rebuild your project? Please also post the complete output from the console window.

  • I don’t find the .cdb file attached to the project in CCS and  I don’t find it in the debug directory either.  There are two .cdb files that I attached in the main project directory.

    I have three .cmd files in the project that are attached along with the build output file.

    Thanks!

    Carl

  • Carl,
    I don't see any attached files. Can you try again?

  • I hope it worked this time.  This format of communication is very tedious.  Any chance I could get a direct email and or phone help?

  • I still don't see any attached files. You can try adding me as a friend on the forum, and then you'll be able to send private messages. Just click on my name and then you'll see that option on the right-hand side of the screen.
    It's not going to work siginificantly faster than posting on the forum, but at least you don't have to post possibly proprietary code on the Web. If you decide to do that, please zip up the whole project and send it to me, as well as the complete output from the console window.

    The phone help is not generally available. Such requests usually go through some business channels and then I am asked by my supervisor to work with the customer. Even in such a case I would have to look at the project first, before the phone communication is of any help.  

  • I've been having alot of trouble with this site / process because of recent upgrades  in our internet security.  I posted the files in my folder.  I hope you can access them.

     

  • 5504.TI_Files.zip

    Here is another attempt to send them.

  • Sasha,

    I attached the SR_Flashcfg.cmd and removed the one with the invalid name.  Everything compiled and linked correctly and I find the tables in the flash sectors as intended. 

    Thanks,

    Carl