Hi,
I am trying to get the self tests for flash L2FMC module, using SafeTI Library 2.4.0 and also implementing on my own (Address Tag Register test, mode 5, which is not done in SafeTI Lib for the TMS570LC4357).
For ECC 1bit test executed with SafeTI Lib function SL_SelfTest_Flash:
Here always the following conditions fails:
if (((((sl_epcREG1->EPCERRSTAT & EPC_ERR_CAM_FULL) == EPC_ERR_CAM_FULL) ||
((sl_epcREG1->EPCERRSTAT & EPC_ERR_CAM_OVRFLW) == EPC_ERR_CAM_OVRFLW) ||
(sl_epcREG1->CAMAVAILSTAT != regBkupCamAvail))) &&
((((sl_esmREG->SR1[0]) & BIT(ESM_G1ERR_EPC_SERR))) == (BIT(ESM_G1ERR_EPC_SERR)))) {
/* Clear ESM status registers */
sl_esmREG->SR1[0] = BIT(ESM_G1ERR_EPC_SERR);
....
because in ESM status register the expected bit is not set.
The strange thing is:
If I add a read to the ESM status register (sl_esmREG->SR1[0]), just before the following line triggering the ECC 1bit error it works:
flashread = *(volatile uint32 *)flashBadECC1;
Then I also tried to implement the Address Tag Register Test like proposed in the reference manual of the microcontroller:
It seems to work correctly first, checking only the error flag flashWREG->FEDAC_PASTATUS, the expected bit is set after the test.
According to reference manual the error is also routed to ESM and according to data sheet a ESM group 3 error bit 13 should be set including error reaction: Bus Error, ESM -> nERROR.
If I check esm bit after the test, I do not see the corresponding bit set.
Then I tested the same as above here, reading the esm status register before the test. And at least when stepping though the code, I see the bit in the esm status register set after the test, but no other reaction.
Nevertheless for this test after a system reset, the esm group 3 status bit for the expected error is set and the system does not start up as this is checked during startup.
So questions regarding this issue:
Do I have to expect the esm bits set (at least in ECC 1bit from safety lib it is expected)?
Any idea why reading the status registers does not show the expected bit?
Why does it work with the additional read?
Any other idea what could go wrong?
Best regards,
Dirk