AnsweredAssumed Answered

Array access problem / memory location conflict

Question asked by Alexander Buergel on May 16, 2013
Latest reply on May 21, 2013 by Alexander Buergel

Hi there!

I am pretty new to codewarrior. I am using Codewarrior IDE 5.9.0 Build 5294. All settings are default since it is a new installation. I generated a project for MC9S12XEQ512 in single chip mode using "device initialization wizzard".

In my main.c I have declared an array "unsigned char  dataBuffer[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};"

My problem now is, that, for reasons I don't know the values within this array seem to randomly change.

To me, it looks as if some other operations do take place in the same RAM memory location as my array is located in, and therefore the values in the array get mixed up...

I am using interrupts, but they do not access this array.


Has anybody an idea what might cause this problem?


I already figured out that the problem seems to disappear when I declare the array to be "static unsigned char"...


Kind regards,