Hello
In your ANSI C source file define the variable as follows:
Code:#pragma push /* Save the compiler’s state. */#pragma define_section myData ".myData" far_absolute RW#pragma pop__declspec(myData) int variable;
In the Linker Control File, add a new memory area in the MEMORY block and place the section there (in example below variable will be placed at 0x20007FF0).
Code:MEMORY { vector_ram (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000500 user (RWX) : ORIGIN = 0x20000500, LENGTH = 0x00007AF0 varSec (RWX) : ORIGIN = 0x20007FF0, LENGTH = 0x00000010 ipsbar (RWX) : ORIGIN = 0x40000000, LENGTH = 0x0}SECTIONS { .ipsbar : {} > ipsbar .vectors : { . = ALIGN (0x4); } > vector_ram .text : { *(.text) .= ALIGN(0x10); *(.rodata) .= ALIGN(0x10); } > user .myData : { *(.myData) } > varSec .data : { <..continue here ..>That should be it
CrasyCat