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.
Tool/software: Code Composer Studio
Hi,
Is it possible to get the start address and size (or end address) of a custom memory section?
For example, I define some variables in a custom area ".myarea"
#pragma DATA_SECTION(my_var, ".myarea") volatile unsigned char my_var[10];
Then I place this region in FRAM in the linker file:
.myarea : type = NOINIT{} > FRAM
Note that I don't want to define a pre-defined area with a fixed size in the linker file. I want this region to be placed in FRAM and grow organically.
Is it possible to read the start address and size of ".myarea" in my application code to do something like a memcpy?
Regards,
Luis R
I found that the following can work:
.myarea : RUN_START(MYAREA_START), RUN_SIZE(MYAREA_SIZE), type = NOINIT{} > FRAM
And the code:
uint8_t *ptr; uint16_t i; extern uint16_t MYAREA_START, MYAREA_SIZE; ptr = (uint8_t *) _symval(&MYAREA_START); for (i=0; i < _symval(&MYAREA_SIZE); i++) { }
This information is found here
The RUN_START operator is described in MSP430 assembly tools manual. Proper use of symbols created in the linker command file is discussed in the section titled Using Linker Symbols in C/C++ Applications.
Thanks and regards,
-George