2025-02-17 01:10 PM - edited 2025-02-17 01:12 PM
Hello,
I try to implement a tamper detection for my project. In general, it works. When the device is only powered by a coin cell and a tamper is detected, the backup registers are erased and unfortunately also the backup RAM. When the device is powered and a tamper is detected while the firmware is accessing the backup RAM, an imprecise memfault is generated.
Because of performance reasons, I didn't try to guard every byte written into the backup RAM. Instead, I only guard a std::copy, and this (obviously) is not enough. Because of that, I tried to enable the tamper interrupt to catch the tamper event and solve it, before I continue with the copy. The data copied into the backup RAM will be corrupted, but that is okay and can easily corrected. But unfortunately, this does also not work. I still get a memfault before I get the tamper interrupt.
What I want to archive is to delete only the RTC backup registers during a tamper event. That is the place where I keep my secret keys. The backup RAM should be untouched.
Now to my questions:
Is there a ways to disable the backup RAM erase with this MCU?
When it is not possible to disable the backup RAM erase, is there a safe way to access the backup RAM while the tamper detection is enabled?
Thanks for you help in advance!
Toni