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

Storing variables at Battery back up RAM

Hi,

I have almost 50 variables defined in my program. Now I want values of those variables to be retained by controller after power cycle. I am using LPC2378 controller and it has battery back up RAM facility.

From KEIL manual I can found only way to give specific address is by _at or by defining pointer pointing to address in battery backup RAM. Using the above mentioned process I need to specifically mention address to every variable.

Can any one suggest me some other option by which I can define all those variable in battery back up RAM at a time?

Thanks in advance for help!

Regards,
Prasad

Parents
  • Hi,

    Do you mean to use something like mentioned in this link? http://www.keil.com/support/man/docs/ca/ca_ap_linkerloc.htm

    If yes, then I am not very much sure about using the LA so I would like to summarize the steps below, would you please validate the same?

    1. Define all those variables in single C file.
    2. This will give segments defined for each variable in map file.
    3. Then use such a line e.g. 'LA ... almctrl.obj SEGMENTS(?DT0?ALMCTRL(0x00108000)) ...' to define that segment in specific address.
    4. But where should I place this line in KEIL? (Linker section of project options? )
    5. Do I need to insert this line for every variable? Or can I just place the newly created file.o in battery backup area directly?

    Please guide.

    Thanks,
    Prasad

Reply
  • Hi,

    Do you mean to use something like mentioned in this link? http://www.keil.com/support/man/docs/ca/ca_ap_linkerloc.htm

    If yes, then I am not very much sure about using the LA so I would like to summarize the steps below, would you please validate the same?

    1. Define all those variables in single C file.
    2. This will give segments defined for each variable in map file.
    3. Then use such a line e.g. 'LA ... almctrl.obj SEGMENTS(?DT0?ALMCTRL(0x00108000)) ...' to define that segment in specific address.
    4. But where should I place this line in KEIL? (Linker section of project options? )
    5. Do I need to insert this line for every variable? Or can I just place the newly created file.o in battery backup area directly?

    Please guide.

    Thanks,
    Prasad

Children