12 #include "sw/device/silicon_creator/lib/drivers/retention_sram.h"
13 #include "sw/device/silicon_creator/lib/error.h"
21 static rom_error_t retention_sram_clear_test(
void) {
28 retention_sram_clear();
31 char *buf = (
char *)ret;
41 rom_error_t retention_sram_scramble_test(
void) {
43 retention_sram_clear();
46 LOG_INFO(
"Scrambling retention SRAM.");
47 retention_sram_scramble();
54 "Checking retention SRAM is scrambled (will stall for a short time).");
55 ret = *retention_sram_get();
60 for (
size_t i = 0; i <
ARRAYSIZE(raw); ++i) {
62 LOG_ERROR(
"Retention SRAM unchanged at offset %u.", i);
71 LOG_INFO(
"Finishing retention SRAM scrambling test (matches=%u).", matches);
72 return matches != 0 ? kErrorUnknown : kErrorOk;
75 OTTF_DEFINE_TEST_CONFIG();
81 return status_ok(result);