I have trouble to retain the SAM L11 Trust RAM (TRAM) data after SAM L11 is reset (logic low at reset pin). It always clear the TRAM data to 0x00 what ever I put 0x55 or 0xaa into the first byte of TRAM.
ptr=(0x42003500); // TRAM first data byte.
TRAM->CTRLA.reg |= TRAM_CTRLA_ENABLE ;
printf("\n\nTRAM test V1.1\n");
printf("w-write; r-read; s-sleep standby; o-sleep off\n");
if(a=='i') *ptr=0x55; //store1=0x55;
else if(a=='x') *ptr=0xaa; // store1=0xaa;
else if(a=='r') printf("store1=%x \n",*ptr); //store1);
} // while(1)
I just want to keep a password in TRAM with Battery, if the TRAM is always cleared at hardware reset, the password can not be stored in the TRAM.
For my case, how can I use TRAM? Is the TRAM data cleared by hardware reset or by the start up code before main()? Since I directly operate TRAM with pointer, I don't think the start up knows that I will use TRAM. I can write 0x55 or 0xaa to TRAM and read back, but after reset, it becomes 0x00.
"220.127.116.11 Enabling, Disabling and Resetting
The TRAM is enabled by writing a one to the Enable bit in the Control A register (CTRLA.ENABLE). The
TRAM is disabled by writing a zero to CTRLA.ENABLE.
The TRAM is reset by writing a one to the Software Reset bit in the Control A register (CTRLA.SWRST).
All registers in the TRAM will be reset to their initial state, and the TRAM will be disabled. All data in the
secure RAM will be cleared to ‘0’."