Other Parts Discussed in Thread: CCSTUDIO
Hi,
I have been trying to ask this via email 23.5, no answers...
Now since some other bugs have been found & fixed (DMA test) I was finally able to even run the 2.3.1 SafeTI IAR RM48 demo application to try to replicate the issue there.
According to this post there should not be any problems in this test anymore
https://e2e.ti.com/support/microcontrollers/hercules/f/312/p/497516/1800406#1800406
I disagree, yes, possible for-ever-loop doe not exists anymore but the test signals real group3 error to application.
After calling that test the code goes first to FIQ handler (it is expected) and then it goes to data_abort handler. In data abort the code goes to this branch which does not mask the error away (guessing that clearing the diagnostics mode prevents the for-ever-loop)
/* DAbort due to an Flash Wrapper test 2 bit ecc fault inject? */
else if (0 != (sl_flashWREG->FDIAGCTRL & 0x7)) {
maskDAbort = FALSE;
/* Though it's not necessary, turn-off the diag mode */
sl_flashWREG->FDIAGCTRL &= 0xFFF0FFF8; /* Clear Diagnostics enable key */
callbkParam1 = sl_flashWREG->FUNCERRADD;
callbkParam2 = sl_flashWREG->FEDACSTATUS;
ESM_ApplicationCallback((uint32)(ESM_GRP3_MASK | ESM_G3ERR_FMC_UNCORR), callbkParam1, callbkParam2, callbkParam3);
}
Since data abort call is not masked via flag (and the Demo application side (esm callback) "stupidly" just clears the group3 ESM bits even tough real error was signaled to it) this "looks to work in demo application" even tough it is not actually working. In case you add even a minor error handling to data-abort handler (while(1)-loop for non-masked aborts the code goes there and stays there.
if (FALSE == maskDAbort) {
/* Extract err address & report to application */
//while( 1 )
//{
//};
}
Need proper instructions how to mask that error out and also Demo application needs to be fixed. Also I think that the Group3 ESM error should be acked inside SafeTI code (sl_selftest.c) (in case this data abort cannot be avoided) like it does for every other group3 error, currently that test clears only group2 error inside sl_selftest.c. Definitely the acking of group3 esm channel for SafeTI test cannot be inside ESM_Application_callback where to the real errors are signaled.
This test looks to work without this diagnostic key clearing (it restores the settings in sl_selftest.c)
sl_flashWREG->FDIAGCTRL &= 0xFFF0FFF8; /* Clear Diagnostics enable key */
Also the code comment in data abort handler refers to ECC 2 bit fault injection test, so this branch shall not be entered in any other test?
Should there be a check in data abort handler that in case SL_FLAG_GET says that this test is active and diagnostics for mode 7 is enabled ( if (7U == (sl_flashWREG->FDIAGCTRL & 0x7U))) --- there looks to be a bug by the way in current 0 != sl_flashWREG->FDIAGCTRL & 0x7U, that branch is entered in case any diag mode is selected...
This test works in my real application at cpu start up phase when FIQ is not enabled but since we catch every non-masked error the code is stopped :). So the root cause must actually be the FIQ enabling which causes data abort which is not handled in demo app nor in SafeTI code (SafeTI code should check whether the FIQ is enabled or not and also require that group3 error is raised and ack it before returning ST_PASS to caller).
Here my real application report when running that test during runtime
===DATA_ABORT===<CR><LF>
DFSR: 0x1008<CR><LF>
DFAR: 0x20000000<CR><LF>
Status: 0x8<CR><LF>
Read: TRUE<CR><LF>
AxiDec: FALSE<CR><LF>
====================<CR><LF>