Unable to map constant data to __far areas of flash memory

Hello All,

I am working on a RL78 G14 Target whom reference is : R5F104GL


Compiler is Renesas CC-RL V1.08


The aim of the project I have is to locate huge quantities of data (over 30KBytes) in Flash that should be modified from time to time by my embedded application via the Renesas FSL libraries.

Now, I am just starting in writing this chunk of code to simply place these two Flash variables in Flash : one in __near area Flash on-board memory (MyNearAddressedNonVolatileConstant) and the second in the __far area Flash on-board memory (MyFarAddressedNonVolatileConstant).



Below is copy of the C source file :


void  main(void);

static __near void CPUSavePSW (void);

static __near void CPURestorePSW (void);

void __far MyFarAdressedFunction (void);


unsigned char MyGlobaleRAMVariable;



#pragma section const MyConstant

/* constant in Flash intended to be located in MyConstant_f and to be modified by Renesas FSL libraries later */
const unsigned int __far MyFarAddressedNonVolatileConstant= 5U;

/* constant in Flash intended to be located in MyConstant_n */
const int __near MyNearAddressedNonVolatileConstant= 5;

#pragma section




#pragma inline_asm       CPUSavePSW

static __near void CPUSavePSW (void)



MOV !(_MyGlobaleRAMVariable), A



#pragma inline_asm       CPURestorePSW

static __near void CPURestorePSW (void)

MOV A,!(_MyGlobaleRAMVariable)




void  main(void)


// TODO: add application code here






void __far MyFarAdressedFunction (void)

MyGlobaleRAMVariable = __get_psw();




Link section options are




Console output gives :


W0561520:"on chip debug" in ".option_byte" created by device file

W0561122:Section address in start option is incompatible with alignment: ".const"


W0561122:Section address in start option is incompatible with alignment: "MyConstant_n"

E0562320: Section address overflowed out of range : ".const"



Based on the above description of source code and linker start options, 

1) Could you check the above code and help me understanding:

1-a) why the project is not compiling and generated such Error on .const address ?
1-b) confirm if the __far constant MyFarAddressedNonVolatileConstant  is not mapped to demanded address in Flash 
(address is intended to be located in Code Flash and over the first 64K, more precisely at 00FDE8
as you can see the above link section definition)
2) In addition, I would like to know if __far data in program flash that are intended to be modified via FSL library should be declared in section with "text" attribute or with "const" attribute ?


 Thank You