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.

Compiler/MSP430F2274: How to place an array at a specific memory location that is provided from a variable?

Part Number: MSP430F2274

Tool/software: TI C/C++ Compiler

For an embedded system project, an array is supposed to be placed in RAM. I have split the device's RAM into two sections, one which stores globals and other data, and another section, RAM_DATA, which I wish to store two arrays (a source location and a destination location).

There is a global value mem_val that is set to the start of the RAM_DATA address, and now wanted to make the source array begin at the location which is stored held in location.

From what I have garnered from online sources, they utilize the stdint.h header file to use uintptr_t and uint32_t values to set start of the array. When debugging the program, the array does not start at this value, and was inquiring about how to fix this problem. Here is some code that is relevant to the question.

volatile uintptr_t mem_val = 0x0219;

 int main(void)
 {
      char cur_loc[128];
      uint32_t *cur_loc = (void *)mem_val;
      ...
      return 0;
 }

Obviously there is something wrong with the array initialization and then making it pointer, but beyond that, is there a method of making the array cur_loc begin at the value given to mem_val?

**Attention** This is a public forum