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.

Question about the pointer extracting data from memory

Hello:

   I use three pointer variable at .c file.  The first and second pointer points to the IRAM address and the third points

to the CE0 of C6713.

 

 

 

Then I created three sections of digits at asm:

 

And I use cmd file to allocate space for these 30 digits:

 

Notice that there is no overlap.

 

However, when I try to print the 30 digits out and their address out by using the pointer, why I could successfully

print the first and third section of digits out but the second section failed?

 

 

 

Remark: you see, the second sections of data cannot be extracted and the pointer pointed randomly to some other

address.

 

 

Could you please tell me why this happens?  Is the pointer variable always unstable or I did something wrong with

the memory allocation at cmd file?

 

Thank you

 

 

  • Could you attach the project .map file here.

    Also try to use the following cmd & update us the results.

    MYDATA1 o = 0x00000000 l = 0x00000100
    MYDATA2 o = 0x00000100 l = 0x00000100
    IRAM o = 0x00000600 l = 0x003FFA00
    MYDATA3 o = 0x80000100 l = 0x00000100
  • Yu Zhang39 said:

     

    Notice here you keep assigning to "point1".  I think you meant to do the first assign to point1, the second assign to point 2, etc.  Here point2 is not being initialized to 0x00000020.  Rather it is uninitialized, so that is why you see the weird address for the second set of values.  Further, because it is some unexpected address, that is why you see unexpected values when you de-reference those addresses.