This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28388D: Retain RAM data between internal watchdog resets now working

Part Number: TMS320F28388D

Hello Experts,

I have a scenario, which is working intermittently.

I want to have a set of variables defined and uninitialized. These variables will be set during execution. Post that, the system would initiate an internal watchdog reset and expect the data be present and not erased in those memory locations.

I have used the below options to perform the same

Cmd file:

RAMD1            : origin = 0x00C800, length = 0x000800

ReservedRam :>  RAMD1, type=NOINIT

Code:

#pragma DATA_SECTION(u32UninitRAM,"ReservedRam")
unsigned int  UninitRAM;

Expectation:

If the variable is set with 30, then after a watchdog reset, it's expected to retain 30.

This works sometimes and sometimes not. I am not sure what i am missing here.

I have used this way in F28335 and it never failed.

Will this data be part of .bss section? if not where will it be allotted.?

Please guide

Thanks

Mohan

  • Hi Mohan,

    F28355 was coff based project and now it's EABI where all the variable get initialized as part of cinit routine but you are using NOINIT attribute so it should work. 

     This works sometimes and sometimes not. I am not sure what i am missing here.

    Any idea if there is any difference in sequence when it works and when it does not work ? Also can you put a break point at your application entry point (code_start) and check the value there and see if it always correct. If not then it may be getting overwritten in application itself before WD reset. 

    Regards,

    Vivek Singh

  • Hi Vivek,

    when the issue was pinpointed, I noticed below as the only difference.

    Not working

       .bss             : >> RAMLS3_4_5_6_7 | RAMGS0 RUN_SIZE(_Testbss)

    Working :

    .bss             : > RAMLS3_4_5_6_7 | RAMGS0 RUN_SIZE(_Testbss)

    code

    //initialize the uninitialized global variable to zero
    for(index = 0; index <BssSize ; index++)
    {
    addr[index] = 0;
    }

    In my application, I use the above to reach the main code faster and initialize the bss in main. this was the only difference.

    Even with the above changes or without that behavior is not consistent.

    I Could not try the breakpoint method.

    The RAM D1 is not allotted to any other section in cmd file. Hence I assume it should not have been overridden, and in code I have used the variable only once to validate it.

    Thanks

    Mohan

  • After disabling the below code snippet:

    for(index = 0; index <BssSize ; index++)
    {
    addr[index] = 0;
    }

    with zero_init =off

    its working now.