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
? If it helps, I am working with a Texas Instruments MSP430 embedded device. Thank you