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.

Large Array Initialization and Access Problem

Other Parts Discussed in Thread: TMS320F28335

Hi,

I am using a TMS320F28335 DSP with code composer V4.1.3

 

I am using a large array to strore an image in memory (static Uint16 [144][89]). I have modified the linker to expand the .ebss section to 16K which should be plenty large to contain this array. Relevant linker code below. I am getting no errors at compile.

   RAMIMG     : origin = 0x00C000, length = 0x004000     /* BB modified code */

   .ebss            : > RAMIMG,    PAGE = 1

My question is twofold.

First I am trying the initialize the array to zero. I have tried setting a value to zero and hoping the compiler would initialize the rest. This does not work. I have also tried the following code :

static Uint16 image[144][89] = {[0...88] = 0x00};

I get the following compilation error :

Severity and Description Path Resource Location Creation Time Id

expected a field name SeniorDesign PixelCapture.c line 29

expression must have struct or union type SeniorDesign PixelCapture.c line 29

 

I have check the enable support for GCC extensions in the language properties section of project properties.

 

So since I was unable to initialize the array I tried to set all the values to zero using the following code :

//Initialize Image Array

for (i=0; i<144; i++)

{

for (j=0; j<89; j++)

{

image[i][j] = 0;

}

}

 

This code runs for ever when I debug on chip. If I pause there are no symbols available and I cannot see where I am in code or the values of any variables. When I step through the code I cannot find the location at which the program crashes.

I believe the problem may be with accessing indexes to far to jump. Do I need some sort of far address?

 

 

Thank You for any help,

Brett

  • Brett Broderick said:
    static Uint16 image[144][89] = {[0...88] = 0x00};

    My gcc compiler doesn't accept that either.  I don't know what is wrong with it.

    On a related note, here is a useful article on TI and GCC support http://processors.wiki.ti.com/index.php/GCC_Extensions_in_TI_Compilers .

    Brett Broderick said:
    This code runs for ever when I debug on chip. If I pause there are no symbols available and I cannot see where I am in code or the values of any variables. When I step through the code I cannot find the location at which the program crashes.

    That image array will be in .bss, not .ebss.  Given what you have shown here, you don't need the far keyword or large memory model.  Make sure .bss contains that array, and that .bss is being allocated to valid memory.

    Thanks and regards,

    -George