RX210: Does RAM retain value upon RES# and Software Reset

Hello All,

I am working on RX210.

I want to know, whether the RAM retains its value upon #RES reset or a Software Reset.

Regards

Sujan.

  • In reply to FrankL:

    Hello,

    Well then, let the experts guide me.

    MCU: RX210

    IDE: IAR

    Requirement: Update a structure with some information before going to reset, so that after the controller come out of reset, the controller after reading the structure should be able to get those information.

    Steps:

    In low_level_init.c file, the following array is declared.

    unsigned char __StartupCode[ 16] @ "MYOWNSECTION";

    This is what the map file shows about the array:

    ___StartupCode                0x000008a4    0x10  Data  Gb  low_level_init.o [1]

    And this is how my linker file lnkr5f52108c.icf looks like:

    define region ROM_region16 = mem:[from 0xFFFF8000 to 0xFFFFFFFF];

    define region RAM_region16 = mem:[from 0x00000004 to 0x00007FFF];

    define region ROM_region24 = mem:[from 0xFFF80000 to 0xFFFFFFFF];

    define region RAM_region24 = mem:[from 0x00000004 to 0x0000FFFF];

    define region ROM_region32 = mem:[from 0xFFF80000 to 0xFFFFFFFF];

    define region RAM_region32 = mem:[from 0x00000004 to 0x0000FFFF];

    define region DATA_FLASH_region = mem:[from 0x00100000 to 0x00101FFF];

    Before going to reset(Both Softreset and #RES) the array __StartupCode is updated. After coming out of reset the value of the array are initialized to zero.

    This might be a trivial, but I am stuck here.

    Please guide me, so as how can I retain the values of the array __StartupCode after reset.

    Regards

    Sujan

  • In reply to sujan:

    You have to add your own section to the linker file and define that it is not initialised.

    initialize by copy { rw, ro section D, ro section D_1, ro section D_2 };
    initialize by copy with packing = none { section __DLIB_PERTHREAD };
    do not initialize  { section .*.noinit, rw section MYOWNSECTION };

    define block HEAP     with alignment = 4, size = _HEAP_SIZE { };
    define block USTACK   with alignment = 4, size = _USTACK_SIZE { };
    define block ISTACK   with alignment = 4, size = _ISTACK_SIZE { };

    define block STACKS with fixed order { block ISTACK,
                                          block USTACK };

    place at address mem:0xFFFFFF80 { ro section .nmivec };

    "ROM16":place in ROM_region16        { ro section .code16*,
                                          ro section .data16* };
    "RAM16":place in RAM_region16        { rw section .data16*,
                                          rw section __DLIB_PERTHREAD,
                                          rw section MYOWNSECTION};