This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Strange question about Array

I declare a array, and set the value.

ubyte i,ubData[3];
for(i=0;i<3;i++)
ubData[i]=i;

I debug this program ,the value of array element is correct. But when i download the program into flash,I find the value of array element is 0xff. The value of element is error.
For example , the value of ubData[1] is 0xff,not 1.

So i modify the program like this:

ubData[0]=0;
ubData[1]=1;
ubData[2]=2;

I download the program into flash again,run it. The value of array element
is correct. The value of ubData[1] is 1.

If I set the array element value like :
i=0;
ubData[0]=i;
The real value of ubData[0] is 0xff,but not 0. Why?

I can't explain this.

Parents
  • I found it's possible that the memory config incorrectly.The variable shoud be located in Iram or RAM,but really in ROM.

    Somebody knowhow to config the MCB167 net evalution board memory address. The MCB167 net board has 1MB external ROM and 1MB external RAM. How do I locate the Internal RAM ,external ROM and external RAM address range.

Reply
  • I found it's possible that the memory config incorrectly.The variable shoud be located in Iram or RAM,but really in ROM.

    Somebody knowhow to config the MCB167 net evalution board memory address. The MCB167 net board has 1MB external ROM and 1MB external RAM. How do I locate the Internal RAM ,external ROM and external RAM address range.

Children