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.

Memory Fill in DSP/BIOS

Hi,

Hopefully this is an easy one:

I am converting a program that runs OK under SYS/BIOS to work with DSP/BIOS. In my configuration I want to initialise a block of memory to zeros. In the SYS/BIOS CFG file I have this:

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

Program.sectMap[".bss"].loadSegment = "IRAM";

Program.sectMap[".bss"].fill = 0;

What is the equivalent to put in the DSP/BIOS TCF file?

Cheers,

John

  • Hi John,

    You can do this in BIOS 5.x using a linker command file (i.e. not in the configuration/*.tcf file).

    It should look something like this for example:

    /********************************************************/
    /* Sample command file with MEMORY directive */
    /********************************************************/
    file1.obj file2.obj /* Input files */
    --output_file=prog.out /* Options */
    #define BUFFER 0
    MEMORY
    {
    FAST_MEM (RX): origin = 0x00000000 length = 0x00001000 + BUFFER fill = 0
    SLOW_MEM (RW): origin = end(FAST_MEM) length = 0x00001800 - size(FAST_MEM)
    EXT_MEM (RX): origin = 0x10000000 length = size(FAST_MEM)

    Please see TMS320C6000 Assembly Language Tools User's Guide chapter 7.5.3.2 MEMORY Directive Syntax.  (you can find this in your CCS installation, e.g. for me it's here: C:\Program Files\Texas Instruments\C6000 Code Generation Tools 7.2.0\doc\SPRU186U.pdf.  spru187S.pdf also has linker command info)

    Steve

     

  • Hi Steve,

    Thanks for your reply. I was under the impression that the cmd linker file(s) were generated by the pre-compiler using the configuration file. Am I allowed to specify an additional cmd file as well? Do I have to specifically reference it from my project settings or another project file?

    Also, when I have used cmd linker files before (e.g. in 28x projects with no OS) I have done this sort of thing in the 'SECTIONS' part, not the 'MEMORY' part, like this:

    SECTIONS

    { 

       .ebss            : > R_DATA,         PAGE = 1, FILL=0

    }

     

    Is this a better place since I only want particular sections filled, not whole memory blocks.

    Cheers,

    John.

     

  • Hi John,

    Are you using CCSv4.x or CCSv5.x?  If so, then you just need to add your linker command file to your project, and it will get picked up.

    Steve

  • Hi Steve,

    Thanks again for your help. I am using CCS 4.2, I did add the linker file to my project and got it to work. However, for the record, I also had to add the following line to my TCF file:

    bios.MEM.USERCOMMANDFILE = 1;

    Also, I had to assign other sections in my linker file or I ended up with warnings, my linker file ended up looking like this:

    SECTIONS {

            .bss:     {} > IRAM, fill = 0

           

            .far:     {} > IRAM, fill = 0

     

            .text:    {} > IRAM

     

            .cinit:    {} > IRAM

     

            GROUP {

             .const: align = 0x8 {}

             .printf (COPY): {}

            } > IRAM      

    }

    The .bss and .far sections are the ones I wanted zero filled. The assignments for the other sections I copied from the DSP/BIOS generated linker file from before. It now appears to work as desired.

    Cheers,

    John.