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.

How to make a small ram area used specially: cleared when powerup, not cleared when restart, read/write normally in normal

HI,

   I just want to get a few word to be used as system abnornal startup counter: when power-on-reset, the data cleared (or can be cleared by read COP), when other abnormal such as watchdog or external reset, the data canbe added up, so sometime later, system restart number can be get if power keeps up.

Can anybody give some advice about how to do it in steps including how to read/write the area?