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.

LP-AM243: Retaining a variable in the RAM between warm resets of the main domain

Part Number: LP-AM243

Hello,

I'm seeking a method to maintain a struct variable in RAM persistently across warm resets of the main domain.

To achieve this, I've designated the variable with the attribute __attribute__((section(".noinit"))). In the linker script, I've defined a section for this purpose, ensuring that a distinct memory segment is allocated.

Here's a snippet from the linker script:

.noinit (NOLOAD):
{ *(.noinit*) }
> NOINIT_MEM
NOINIT_MEM: ORIGIN = 0x70100000 - 0x480, LENGTH = 0x480

Aside from this, I have tried attribute noinit and persistent, all results in the same thing.

Upon invoking SOC_generateSwWarmResetMainDomain();, the memory location resets to zeroes.

Could you advise on the appropriate steps to maintain variable retention across resets?

  • Hi Saptarshi,

    Both TCM and OCRAM (0x70000000 - 0x701FFFFF) were set to zero after either WARM_RESET or POR_RESET. I am not sure where this is happening. It could be done in the SBL_NULL. It is not possible to retain the contents in TCM or OCRAM. However, if you are using the AM243x ALV and with DDR memory attached, then it is possible to retain the contents in DDR (0x80000000 - ) for WARM_RESET or POR_RESET.

    Best regards,

    Ming

  • Hello Ming,

    Thanks for the answer. I am currently using SBL_OSPI for my application. Will it be possible to change the behavior of the SBL and get my desired outcome? In that case, can you direct me to where I should look for the function that does this memset to zeros.

    Thanks,

    Saptarshi

  • Hi Saptarshi,

    I will forward your thread to our SBL expert for further help.

    Best regards,

    Ming 

  • Hi ,

    The ROM on AM243x initializes the memory for 1.5MB into the SRAM in order to download the SBL image. From ROM perspective, it does not matter if the reset is POR or Warm Reset and irrespectively, it will reset the memory. However I have not done this experimentation, but you may try to load in between this region 0x70180000 -- 0x701C0000 which is not utilized by System FW or can be used as SBL.

    You may be able to retain memory here.

    Best Regards,
    Aakash

  • Hello Aakash,

    Thanks for the suggestion, however, that section of the RAM also seems to be cleared on reset.  

    Can I use the Board ID EEPROM for this purpose? If so, can you tell me how to disable the WP and more details on the available memory including the first available offset (is it 0xFE)?

    Thanks,

    Saptarshi

  • Hello,

    Our Subject Matter Expert is looking into this and will respond in a few days.

  • Hello Saptarshi,

    Actually, data retaining is not possible on AM64x/AM243 devices after the Warm Reset.

    if you are using M4F core in your Application, we can isolate M4F core from the Reset , which means that when SOC gets reset the reset path is not propagated through the M4F core. So, M4F core memory and M4F core peripherals Run continuously without effecting Reset issue.

    Here, what is the use case ? Why do you want to keep the data that is retained after the Warm Reset ? How much data do you want to keep at the previous value after the Warm Reset ?

    Can I use the Board ID EEPROM for this purpose?

    Can you please confirm are you talking about below EEPROM?

    Regards,

    S.Anil.

  • Hello Anil,

    I would like to store diagnostic information on reset. This information is needed after reset. I would need around 1KB of memory.

    And yes, this is the EEPROM I was talking about.

    Thanks,

    Saptarshi

  • Hello Saptarshi,

    The above external EEPROM is available on the AM243 LP module.

    Currently, I am not sure why we are using this EEPROM and I assume that it will be used in industrial Applications like etherent and ethercat etc. applications. So, currently the WP pin is connected to high, so users can't write the data. And this pin is also not connected to any GPIO's to control WP as low or high.

    If you want to use it, then by manual, we can pull the WP pin as low for this just connect the GND pin of EEPROM to the WP pin. Then you will be able to write.

    But, if we overwrite data on the EEPROM, maybe it will affect the Industrial protocols. That's the reason not given for EEPROM programming for user purposes.

    Regards,

    S.Anil.