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;
table_ptr = 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);
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.
Your last instruction should be
*memory_ptr = (unsigned int) (*table_ptr);
From your debugger, you should be able to check if memory_ptr and table_ptr have the correct address.
Thanks and regards,
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.