Tool/software: Code Composer Studio
How can i move initialized variable to Flash?
I want to move SRAM variable to Flash.
1. How can i move variable which is in .data or in .bss (SRAM) to Flash?? Not const data which is already in Flash.
when i do this code,
#pragma DATA_SECTION(var1, ".mydata");
#pragma DATA_ALIGN(var1, 2);
int var1 = 5;
void main(void){
printf("var1 = %d\n", var1);
}
then, var1's address is in Flash but var1's value is not 5. it's value is just trash.(like -1)
How can i move variable to Flash perfectly?
2. Also, how can i move "local variable" to Flash?? If not, How can i copy it from SRAM to Flash?
void main(void){
int var2 = 10;
printf("var2 = %d\n", var2);
}