I know Cortex-M4 doesn't support virtual memory. Do you always have to load VA from some LA in flash? For instance you allocate empty value memory at compile time.
Hi jvanmont,
we usually treat addresses as VA=LA, because almost applications are single task scheme. Do you ask how to realize a multi-task system using address translation from VA to LA? I think you can use PIC (position independent code) to make an address translation by using the following GCC options.
-fpic
-msingle-pic-base-mpic-register=reg
The default base register is r10 (a.k.a. sll). By changing the base address value, you would able to realize an address translation.
Best regards,
Yasuhiko Koumoto.
This is a single thread application. I compiled an empty memory array in some sram section. I review my memory mapping and see that this section is loaded from empty flash region? I wonder why it need his load address from flash?
This is the array in sram:
static U32 extMem[GUI_NUMBYTES / 4] __attribute__((section(".ExtRAMData")));
do you say that the empty memory array is assigned to the flash region regardless to your intention? Please show us your linker directive and the result memory map.
Best Regards,Yasuhiko Koumoto.
yasuhikokoumoto I have this mapping.
But I like to view the complete LA region in my mapping. For now it is not shown.
I am now confusing to see the mapping. Is it the result after the linker? Or, is it your input for the linker? Are you using Cortex-M4? why is such the mapping that VA is not equal to LA possible? I am afraid the ExtRAMData would be always located at the address 0x19000. That is, VA might be ignored. By the way, what the tool chain do you use?
Sorry, I wasn't clear on the mapping. ExtRAMData section VA is in ram at 0x2000099c and it is loaded from 0x08017170. The size of ExtRAMData is 0x19000.
I think I understood your situation. You should copy from 0x08017170 (flash) to 0x2000099c (SRAM) in the startup routine. The value of SRAM area is undefined and you should initialize it by the values in the flash. If the ExtRAMData is an array of null data, you can directly write the values of 0 in the ExtRAMData. The program would be carried out only by VA.
Best regards,Yasuhiko Koumoto.