0

Good evening

I have tried a few ways of placing functions in RAM. I am trying to do this so i can write data into my user data flash on the RX630 from the user boot area.

Initially i placed the functions in the .data section and this placed the functions in RAM but the return from the function would fail as if the stack was damaged.

I then created a new section in the middle of the RAM called .rtdata and added my functions to that section. This works 100% when using the E1 debugger. When i remove power the functions disappear and the code does not run.

How can i safely add my functions to RAM so they do not cause trouble with the variables placed after the .data area and be available after power up?

Info:

e2studio v5.4.0.018 & GCC for Renesas 4.8.4.201701-GNURX Windows

.data -> 0x0000

.gcc_exc -> after .data

.bss -> after .gcc_exc

.rtdata -> 0x4000

ustack -> 0x17000

istack -> 0x17FFF

function desc:

unsigned int __attribute__((section(“.rtdata”),noinline))program_flash_block (volatile unsigned short *rom)

or

unsigned int __attribute__((section(“.data”),noinline))program_flash_block (volatile unsigned short *rom)

Regards

Richard

Darius Galis selected answer