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.
Hi, I've define a large array( unsigned char array[1024*1024*50]; ), and this array is a global variable. In the program, I use memset function to set the values
unsigned char *src;
unsigned char value=0x11;
src=(unsigned char *)(&array[0]);
for(i=0;i<=9;i++)
{
memset(src,value,1024*1024*5);
src+=1024*1024*5;
value+=0x11;
}
when we debug the program, and the results are: while i=0 and 1, the values in the array[] has changes and are same with the value variable, besides, another address in the heap has changed also,and its values is same, too. while i=2,3,4,5, 8 and 9,the values are normal, and only the array[] has changed. however, i=6 and 7, we can watch the value in the array[] isn't the value we assigned. what causes that and how to solve that, besides, what's the maxium length of an array? thank you!
by the way, the version of ccs is ccs3.3, and BIOS's version is 5.31.02
another similar question has posted:http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/99/p/192944/690877.aspx#690877
This C code is simple. Because of the memset call, the loop is not software pipelined. That means the generated code is simpler than usual. Thus, it is very unlikely there is some compiler bug here. Try this code out with a simulator in Code Composer Studio. Of course, be sure the simulator is properly configured to support a large amount of memory. My guess is that this will work fine on the simulator. If so, that means there is some sort of hardware problem. I'm no expert on hardware issues. But the first thing I would check is the configuration of the memory.
Thanks and regards,
-George