I want to be able to "send myself a message" across powered resets, e.g., to see what was going-on when a reset occurred.
I am using IAR and have a variable defined using the __no_init keyword, so its value does not get initialized (by 'C') upon reset, e.g.,
__no_init RESET_CAUSE resetCause;
If I can assume that the value of resetCause in RAM is always 0x0000 the first time after programming the MCU and after power off, this approach works. However, I'm not sure what my guarantees are regarding the value of uninitialized RAM. In my case, resetCause (a 16-bit value) begins at address 0x205.
Q1: Is there a better way to "pass" values across powered resets?
Q2: What are my guarantees regarding the value of uninitialized RAM?