Here is simple example which I copied from some old test project.
In linker file:
MEMORY
{
...
my_ram: org = 0x40030000, len = 0x0000C000 //just example, use addresses you need
...
}
SECTIONS
{
...
.__my_ram: {} > my_ram
...
}
In *.c file:
#pragma push
#pragma section all_types ".__my_ram" ".__my_ram" data_mode=far_abs
volatile unsigned int data1;
volatile unsigned int data2;
volatile unsigned int data3;
#pragma pop
The order of data1, data2, data3 in RAM will be the same as order in this section. You can check it in the map file.
Regards,
Lukas