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

RTC RAM problem of LPC2378

Dear all
I am storing some variable(normal variable, unsigned char ,int, float ,char Array etc.) in RTC RAM.
After some time processor stop execuation.If I delete all RTC RAM variable from program,and downloading hex file again.but still it is not working.

what will happened? How can I erase RTC RAM?
waiting for your reply...

Shyam T
Pune India.

Parents
  • You clear the battery-backed RAM just like you clear any other RAM:

    memset(NVRAM_PTR,0,NVRAM_SIZE);
    

    The NXP datasheet contains information how to use IAP to write to flash sectors. You do not use flash sectors to store "variables", since the flash supports a limited number of write cycles, and you have to erase the flash sector before writing to it. But the flash sectors are excellent for storing configuration.

    By removing the battery, the contents in the RAM will deteriorate. But there is no guarantee that the RAM will end up in any given state. All you are allowed to know is that after removal of the battery, the RAM will be in an unknown state.

    But as I have already said: You should not worry so much about how to erase the RAM - you should worry about writing an application that works even with broken contents in the RAM. Any other solution is a broken solution. Since the result of using a broken pointer is fatal, you should avoid storing pointers in this RAM - and if you do, you should then "protect" your pointers by a high-end checksum so you can decide with a very high probability if the pointer values are valid or if they are broken.

Reply
  • You clear the battery-backed RAM just like you clear any other RAM:

    memset(NVRAM_PTR,0,NVRAM_SIZE);
    

    The NXP datasheet contains information how to use IAP to write to flash sectors. You do not use flash sectors to store "variables", since the flash supports a limited number of write cycles, and you have to erase the flash sector before writing to it. But the flash sectors are excellent for storing configuration.

    By removing the battery, the contents in the RAM will deteriorate. But there is no guarantee that the RAM will end up in any given state. All you are allowed to know is that after removal of the battery, the RAM will be in an unknown state.

    But as I have already said: You should not worry so much about how to erase the RAM - you should worry about writing an application that works even with broken contents in the RAM. Any other solution is a broken solution. Since the result of using a broken pointer is fatal, you should avoid storing pointers in this RAM - and if you do, you should then "protect" your pointers by a high-end checksum so you can decide with a very high probability if the pointer values are valid or if they are broken.

Children
No data