I'm porting my working project to DSP/BIOS and it's resulting in some strange behavior.
When I write values to a large array, which I've placed in my extern memory DDR2, and afterwards view them in
the memory map, I can see that they are shattered and wrongly placed with zeros and random numbers in between.
Test case:
#pragma DATA_SECTION(arrayX, ".ddr2") //Linked to DDR2
#pragma DATA_ALIGN(arrayX, 8)
unsigned char arrayX[500];
#pragma DATA_SECTION(arrayY, ".ddr2") //Linked to DDR2
#pragma DATA_ALIGN(arrayY, 8)
unsigned char arrayY[500];
...
memset(arrayX, 0, 500);
memset(arrayY, 0, 500);
for (i = 0; i < (500); i++)
arrayX[i] = 50;
for (i = 0; i < (500); i++)
arrayY[i] = arrayX[i];
...
Results in totally wrong arrays. The end of arrayX got some zeros in between the inserted 50-values.
And arrayY is messed up with 50-values at the first 12 indexes then zeros for the rest with random numbers in between.
At first I was suspecting the build options for the compiler, but the problem remains with no optimization.
Is there something obvious I'm missing here?
My heap and stack are huge, so that's not the problem.
Using CCS 3.3 with BIOS 5.31 on a DM6437 EVM.