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.

Unable to add Program module to my configuration

Other Parts Discussed in Thread: SYSBIOS

Hi

I am developing a custom codec  on DM648 platform. Using CCS5.5  and SYS/BIOS 6.35.

I wanted to use Program module in my application to create a buffer in L2 SRAM . But when I tried to add this via XGCONF, it is not showing up in the .cfg script. The program Module is shown in red button on the right hand side outline section of CCS. Can I add directly into .cfg script, like

var Program = xdc.useModule("xdc.cfg.Program"); ?

Pls reply

Best Regards

JK

  • JK,

    You don't need and should do a use module for Program.  It should already exists in your .cfg file.

    How are you planning to create a buffer via Program?

    Typically, how this would be done is you create a static object like an array of the size you want in your .c file.  Then you also put in into a particular section via a #pragma in your .c file.  Then in your .cfg file, you can place it into L2 SRAM.

    Judah

  • Hi Judah

    I wanted to create raw frame buffer in the L2 SRAM.(for  QCIF  YUV4:2:0). I tried malloc and used to #pragma DATA_SECTION to put that into L2 SRAM. But this is not working. It is still in the DDR2.

    Hence I tried using Memory_alloc(). This requires creating a second heap via .cfg file and placing that in the L2SRAM section. Pls tell me  how to do this.

    Best Regards

    JK

  • JK,

    I think you have two options.

    Option #1.  If you want to create heap and use malloc() to allocate memory, you can do something like the following in your .cfg file.  It will create a Heap, set it as the default heap and place it into L2SRAM segment.

    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem', true);
    var heapMemParams = new HeapMem.Params;
    heapMemParams.size = 0x8000;
    heapMemParams.sectionName = "myHeapMemSec";
    var heap0 = HeapMem.create(heapMemParams);
    Program.sectMap["myHeapMemSec"] = "L2SRAM";

    var Memory = xdc.useModule('xdc.runtime.Memory');
    Memory.defaultHeapInstance = heap0;

    Option #2:  If you don't want to use malloc to allocate the buffer but simply want a static buffer.

    In your .c file do something like:

    #pragma DATA_SECTION(intBuffer, "intBuffer");
    #pragma DATA_ALIGN(intBuffer, 64);        /* align to 64 bytes */

    /* Transfer buffer sizes (MADUs) */
    #define BUFSIZE_16384   16384

    UChar intBuffer[BUFSIZE_16384];

    In your .cfg file do:

    Program.sectMap["intBuffer"] = "L2SRAM";

    Judah