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.

c6713DSK SDRAM issues

Hi,

I'm trying to put a large data matrix into SDRAM on c6713DSK board. The matrix has a size of 72 (rows) x 512 (cols). The IRAM in this case is definitely insufficient to store such a large matrix, so I search for the way to use SDRAM. Here are the changes I made.

in .cmd file, I defined .extBuffer0 along with other section items

 

SECTIONS

{

...

.extBuffer0 >       SDRAM

...

}      

in my main.c file, I use #progma as

 

#pragma DATA_SECTION( h, ".extBuffer0" );

float h[72][512] = {{...},{...}...};

However, I still receive errors as:

 

 

>>   error: can't allocate .cinit, size 00024074 (page 0) in IRAM (avail:

            0000fdff)

I don't why the error is thrown in my case. Does anyone have the same problem? How did you solve this problem?

I'm sure not other large matrix is defined somewhere else in my code. This is the only one. The CCS version I'm using is 3.1.0

 

Any help will be highly appreciated!

 

 

 

  • When you create something like:

    int my_array[4] = {0, 1, 2, 3};

    you will actually end up with 2 allocations:

    1. Uninitialized area in .far/.bss which is the address you would be accessing at run-time, i.e. the address to which my_array is linked.
    2. A record in .cinit which contains the intial values (0, 1, 2, 3).  This gets copied to its run-time location prior to main.

    In your case the issue is that your large array is causing a huge record to be created in cinit which no longer fits in IRAM.  I see two possible solutions:

    1. Allocate cinit to SDRAM in your linker command file.
    2. Declare the array as "const" if you're not going to modify it at run-time and then you'll only get a single allocation.