Hello,
I have two questions regarding data section in C6678 EVM.
1)
I mapped 0x0c000000 to virtual address 0xa0000000, and set the corresponding MAR bit to 0 in order to make whole MSMCSRAM non-cachable.
It is working fine if I read/write via virtual address (i.e, cache disabled).
What I want to do is defining data sections on non-cachable MSMCSRAM.
For example,
In .cfg file,
Program.sectMap[".Test"] = new Program.SectionSpec();
Program.sectMap[".Test"].loadAddress = 0xA0090000;
and in .c file,
#pragma SET_DATA_SECTION(".Test")
int a;
int b;
...
But, the compiler shows warning message as below.
I guess it is why the virtual address is too far.
warning: Section ".Test" requires a STATIC_BASE relative relocation, but is
located at 0xa0090000, which is probably out of range of the STATIC_BASE.
STATIC_BASE is located at 0x0081b400. Might be required to correct
placement of ".Test" so it lies within 0x8000 of the STATIC_BASE.
Alternatively, I can define data sections on physical address of MSMCSRAM,
and make the c codes access via virtual address.
But, there are so many variables and structures on serveral data sections, so it is not appropriate to my case.
Or, if it is declared as 'far', can this problem be solved?
If so, where should I insert 'far' keyword and is there any performance difference between w/ far and w/o far?
Can anybody suggest the best solution?
2) Can I set the length of data section?
For example, I want to set the length of ".Test" section to 0x100,
so ".sharedMemory" below is not allocated between 0x0C000000 and 0x0C0000FF.
I can declare an array in ".Test" section like 'char Temp[0x100]'.
But, In case that the section size is too big (e.g.,3MB), it is not simple to declare 3MB array.
And, I want to make some data sections dedicated to predefined cores,
so I don't want to allocate array on the data sections which other cores are using.
Possible solutions are to use loadAddress only (not use loadSegment), or to define data segment instead of data section.
Is there a better solution?
Program.sectMap[".Test"] = new Program.SectionSpec();
Program.sectMap[".Test"].loadAddress = 0x0C000000;
Program.sectMap[".sharedMemory"] = new Program.SectionSpec();
Program.sectMap[".sharedMemory"].loadSegment = "MSMCSRAM";