How can I use C to Access Data Stored in Program Space Memory on the TMS320C24x DSP?
On TMS320C24x devices, it is sometimes desirable to place data in program space memory rather than in data space memory. In particular, the on-chip flash (or ROM) in the program space provides a large nonvolatile memory for storing constant arrays, look-up tables, and string tables. When working in the C programming language, however, it is not sufficient to simply link the data into the program space, as the C-compiler expects all constants (and variables) to be in data space memory. No mechanism exists in the C-compiler for accessing program space memory, other than at code-initialization time. One method for overcoming this problem is to copy the data from the flash (or ROM) into data space RAM as part of the code-initialization process. This could be done using a custom assembly code routine, or the C-compiler does provide some built-in capability for initializing global and static variables and constants. The C-code could then access the copies of the data in the data space during