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.

How to store a value to a memory location which is defined in linker command file



A table run time located on M3 flash need to be accessed from R4 flash code. To achieve this, I located a 4 bytes memory on M3 flash in linker command file using a name. When the address of the table is available, the C code will store the address of the table to the memory through this name. Below is the code just doing this.

 void * table_ptr[2];

table_ptr[0] = getTableAddress();   /* the address of the table is now stored in the 1st element of the table_ptr array */

unsigned int  * memory_ptr;

memory_ptr = &memory_label    /* memory_label is defined in linker command file with a fixed memory address */

*memory_ptr = (unsigned int) (table_ptr[0]);

The above code doesn't work and the content at  memory_lable is still blank after executing the code. dose anyone know what is the problem and how to solve it. Thank you.

Joy