Clarify switch_app reads and writes; add read test to testfw

This commit is contained in:
Daniel Lublin 2022-10-26 11:38:58 +02:00
parent 4b4f014d38
commit 85ef93cd3c
No known key found for this signature in database
GPG key ID: 75BD0FEB8D3E7830
2 changed files with 50 additions and 37 deletions

View file

@ -151,10 +151,22 @@ int main()
anyfailed = 1;
}
uint32_t sw = *switch_app;
if (sw != 0) {
test_puts("FAIL: switch_app is not 0 in fw mode\r\n");
anyfailed = 1;
}
// Turn on application mode.
// -------------------------
*switch_app = 1;
sw = *switch_app;
if (sw != 0xffffffff) {
test_puts("FAIL: switch_app is not 0xffffffff in app mode\r\n");
anyfailed = 1;
}
// Should NOT be able to read from UDS in app-mode.
wordcpy(uds_local, (void *)uds, 8);
if (!memeq(uds_local, uds_zeros, 8 * 4)) {