Dear all,
Im recently having a problem which i will explain to see if you can help me to find the reason why, and a possible solution.
I have a number of different arrays of integers (int16) with different lengths. I want to make an array of pointers which points to each one of the previously mentioned arrays, however, this list is relatively big. I have 532 arrays, so I would need an array of 532 pointers. This is fine. The problem comes when I compile and execute the program on the DSP, since it goes ´crazy´. And with crazy I mean that I have a firmware that works, but when I include this code (only the definition of the array of pointers), the firmware just does not work as it should.
Other information that might be useful: Im storing the initialization values in the section FLASHB of the flash, and according to the .map file, there is still enough room in the flash sector for that array of pointers.
Here an example of my code:
int16 array1[3] = {0,0, 10000};
int16 array2[10] = {9, -1, 0, 1, 2, 3, 4, 5, 2000, 4000};
int16 array3[3] = {0,10, 30000};
int16 array4[5] = {0,10, 10000,2,5};
int16 array5[1] = {-1};
...
int16 * list_of_arrays[532] = {
array1,
array2,
array3,
array4,
array5,
...
array532
};
Also, additional information. If I do this with, lets say, 100 vectors, everything goes fine. If I do it with 200, everything works fine, but if I do it with 400 or 500, for example, it already starts failing. It seems like there is some memory allocation error or something, bit i couldnt find out.
If someone could let me know the reason of the problem, how to debug it and/or how to fix it, I would appreciate it very much.
Thank you and best regards.