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.

C6747 SDRAM Data Memory Allocation Question



Hi,

I am using the C674 starter kit with CCSv3.3, bios 5.33.05, PSP 1.30.01.  I am trying to use a block of 80K audio scratch buffer from SDRAM and I have some difficuties.

1. I created a 80KB block of data from DSP/BIOS Config TCF.  This buffer name is 'AudioScratchData'.

2. I compiled the application and saw the MAP file has 'AudioScratchData' with address of 0x1183dbc8'.  This is the DSP RAM address.

3. The MAP file shows 'AudioScratchData$databeg' has the address of 0xc006ede0.  This is the SDRAM address.

My question is how is the application access (reference) to this 'AudioScratchData$databeg'? 

Thanks,

Dennis

  • Dennis Nguyen said:
    1. I created a 80KB block of data from DSP/BIOS Config TCF.

    Please explain what this means. Normally, a block of data to be used as a buffer will be allocated in your C code by the declaration and possibly a #pragma DATA_SECTION command or possibly a far keyword.

  • Hi Randy,

    I created the buffer from 'Buffer Manager' and I attached the TCF screen dump wit this post.  This is may be more than what I looked for but I want to understand how the 'Buffer Manager' works.  I used the #pragma DATA_SECTION and I was able to use it ok.  Please comment on the 'Buffer Manager'.

    Thanks,

    Dennis

     

  • Hi Dennis,

    The "Buffer Manager" or the BUF module is not used for static buffers. For static buffers please use  #pragma as suggested by Randy.

    The BUF module provides APIs for dynamic memory allocation (similar to MEM). You can use BUF_alloc() and BUF_free() to allocate and free memory at run-time. There are some advantages of allocating memory using BUF. BUF provides deterministic allocation times and can be called from all thread types. It is optimized for fixed length allocation and there is less fragmentation. Please read the BIOS User Guide for more details on BUF module.

    Regarding the map file when using BUF, the 'AudioScratchData' at address of 0x1183dbc8' is the BUF instance object. The 'AudioScratchData$databeg' at 0xc006ede0 is the buffer pool used for allocation by that BUF instance. The application would call BUF_alloc and BUF_free and will not directly reference  'AudioScratchData$databeg' .

    Regards,

    Nitya