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.

Memory Error ... but there shouldnt be one ...

Hi,

I am new to DSP programming. I am currently working on C6416. I have been given a code to check and verify. The thing is that once you run the code as it is with no change at all the code runs very well. But  once i modify the code, say declare a new variable, i get the memory error. Its states that the dsp is trying to write in areas that have been reserved by the  hardware.

secondly as much as i have calculated i have an array of 900 short integers. So it should take 1800 bytes considering 16 bits per short int. The internal memory of the DSP is IM which should be properly accommodating the variable but it does not.

Another very confusing thing is that if i define an array named temp as follows (Ignore the syntax)

for i = 1:900

temp[i]=i;

end

then it works fine but once i define individually like

temp[1]= 2;

temp[2]=3;

.

.

.

temp[180]=12;

for i=181:900

temp[i]=i;

end

then i get the memory error ...

 

any help or any hint will be highly appreciated .

 

 

  • Ignoring syntax, both methods are identical and there is no memory error.

    Debug your program to determine where and then why the error occurs.

    • By repetition and the use of breakpoints (or by reading the error message), determine which program line results in the error being generated.
    • Repeat and then stop at that instruction and see what it is trying to do.
    • Figure out why its intended operation is invalid.
    • Put dummy statements in front of that instruction, if needed, to eliminate pipelining as a source of confusion.