Tool/software: TI C/C++ Compiler
Hi all,
There are many ram variables in our appilcation codes which are auto-coding based on Matlab/Simulink. Now we want to store them in Ram one by one just like this:
For instance, a Ram section named MEASURE is made, and the start address is 0x0000 3000. Eight variables named var1~var8 are assigned to the section "MEASURE".
Assumption is that the date type of var1~4 is UINT16, with var5~6 UINT32, and var7~8 FLOAT. As we know that these variables have been defined in their own C filies, with no section assignment.
So they are stored in Ram in a random fashion. However, it is needed to assign these variables in MEASURE section one by one, just in the order of var1->var2->var3->var4->var5->var6->var7->var8.
In order to meet the requirement mentioned above, I tried several methods. First, I extrat these eight variables and print them in a head file with Python script. Then add PRAGMA instruction at the front of them like these below:
#pragma SET_DATA_SECTION("MEASURE")
extern UINT16 var1;
extern UINT16 var2;
extern UINT16 var3;
extern UINT16 var4;
extern UINT32 var5;
extern UINT32 var6;
extern FLOAT var7;
extern FLOAT var8;
#pragma SET_DATA_SECTION()
But the result is not what I expected, these eight variables are still stored in a random fashion. So are there any better methods to reassign these pre-defined variables to a continous ram range one by one with the order mentioned above.
Thanks a lot!