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.

Linker command file on KeyStone II DSPs

Hello,

I am running a program on DSPs-only on KS II platform. I did not use CCS, but the loadti.sh utility.

But what I found the linker command file I am using is for KS I, and may not reflect the correct memory configuration for KS II. Attached please find the linker command file I am using (I have renamed to .txt in order to be uploaded).

Is that OK for using on KS II? If not, could you please point me a correct one I should use?

Another question, where to configure the system heap, like

Program.sectMap["systemHeap"] = "MSMCSRAM";

//Program.sectMap["systemHeap"] = "L2SRAM";
//Program.sectMap["systemHeap"] = "DDR3";

I do remembered there is a file to set this,  but couldn't find it now. Could you please show me this?

And also, if I set the  system heap on e.g. MSMCSRAM, when I am using the malloc() to allocate memory on system heap, the memory will be on the MSMC, right? 

Many thanks

Cheng1643.c6678_unified.txt

  • Cheng,

    You need to look at the K2H data sheet for the memory map. For example, L2 and MSMC are larger, but if you only use a portion of it, it should be OK.

    Program.sectMap["systemHeap"] = "MSMCSRAM"; =====> this kind of setting is inside the .cfg file. E.g, PDK \packages\ti\drv\hyplnk\example\memoryMappedExample\k2h\c66\bios\memoryMappedExample.cfg

    Yes, malloc() allocates memory from heap.

    Regards, Eric 

  • Hi Eric,

    Thanks for your reply! 

    From the packages\ti\drv\hyplnk\example\memoryMappedExample\k2h\c66\bios\memoryMappedExample.cfg, I found my .cfg file is as follows:

    36 var System = xdc.useModule('xdc.runtime.System');
    37 var hlink = xdc.useModule('ti.drv.hyplnk.Settings');
    38 /* Use the CSL module and indicate that INTC library will be used. */
    39 var devType = "k2h";
    40 var Csl = xdc.useModule('ti.csl.Settings');
    41 Csl.deviceType = devType;
    42 Csl.useCSLIntcLib = true;
    43
    44 Program.sectMap[".text"] = "MSMCSRAM";
    45 Program.sectMap[".const"] = "MSMCSRAM";
    46 Program.sectMap[".init_array"] = "L2SRAM";
    47 Program.sectMap[".csl_vect"] = "L2SRAM";
    48 Program.stack = 1024*4 + 0x400;

    There is actually no information to set the system heap. Should I add the following lines in the .cfg file?

    BIOS.heapSize = 0x7D00;
    BIOS.heapSection = "systemHeap";
    //Program.sectMap["systemHeap"] = "L2SRAM";
    //Program.sectMap["systemHeap"] = "DDR3";
    Program.sectMap["systemHeap"] = "MSMCSRAM";

     

    Do I need to rebuild the pdk package? Could you please show me how to build that?

    The basic idea to set this to set the system heap location, e.g. MSMC, then I could allocate a memory using malloc() on MSMC and measure the time loading a data from MSMC. Is it a reasonable solution?

    Or do you have other ways to do this, i.e. allocate a memory on L2, MSMC or DDR, no matter if the array static or dynamically allocated? Because rebuilding the pdk package again and again may not be a desirable solution.

    Thanks

    Cheng

     

  • Cheng,

    This is just an exmaple how in the .cfg you can configure your memory placement. For your test, I don't recommend you re-build the PDK or use .cfg in a BIOS program. Rather, I believe you can just use your .cmd file for simplicity, you can put everything in L2, then heap is also allocated from L2; if you put everything in MSMC, then heap is also in MSMC. Look at the .map file generated, with a few trails you can find out.

    Regards, Eric

  • Hi Eric,

    That sounds doable. For the .map file, I remembered the CCS would generate that. Do you know how to get .map file without using ccs?

    Thanks

    Cheng

  • Cheng,

    How do you build DSP code without CCS? You use cl6x in command line? If yes, to generate a map file, add option -m"test.map"

    Regards, Eric