This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Specific address location for RAM variable in RX140

Hi everybody,

I would like to force some RAM variables to be saved by compiler in spefic address range (for example from 0x100h to 0x200h).

I know it is possible to use

#pragma address

directive, but this means I have to calculate all the address for the variables.

I'm looking a solution like using

#pragma section

directive but I'm struggling how to setup the "C/C++ Build->Settings->Tool Settings->Linker->Section" linker menu in e2studio.

I tried the following test

#pragma section SafetyRAM
uint16_t a = 0x0000U;
uint16_t b = 0xFFFFU;
#pragma section

And I added a section in linker option with name "SafetyRAM" and address 0x100. Compiler gives me a warning:

W0561100:Cannot find "SafetyRAM" specified in option "start"

How can I solve? Thanks




[locked by: Sai (SWF) at 14:18 (GMT 0) on 8 Feb 2023]