I'm using Halcogen 04.05.01 generated code with a RM48HDK, with a RM48L952 which I believe is Die Rev. C, to validate the hardware initialization registers for the software team.
While implementing the SRAM ECC tests, I've modified the bit BTCMECC of the Secondary Auxiliary Control Register of Cortex-R4 cp15 to disable correction. By doing that, I could beautifully generate a data abort as soon as I had a single-bit error in SRAM, which was treated as an uncorrectable error. For us, this is a must-have, since our certification company don't really like correction, and both single and double bit errors are treated in the same handler.
But, the same thing does not happen when injecting error in the Flash ECC. Even when enabling the ATCMECC register, only a double-bit error generate a data abort. I understand that the access to ECC, OTP and the mirrored space is handled by the Flash Wrapper, while the main program flash (starting from address 0x00000000) is handled by ATCM.
While injecting the error in the checkFlashECC function from Halcogen code, all I got was an ESM group 1 error, because the function checks the mirrored space flash memory (handled by Flash Wrapper). Changing the addresses which were being checked to the main program flash does not generate any error at all, since the injection is in the Flash Wrapper. Double-bit faults do generate data aborts.
The doubts I have:
1) I've tried, before changing the checkFlashECC function, to generate an ESM Group 3 error by changing EDACMODE to 0x05 while injecting error, but got no success. Only ESM Group1 error was signaled. Is that correct?
2) Disabling correction on ATCM port with bit ATCMECC set will generate a data abort when a single-bit error in the main program flash is detected?
3) If the answer to question 2 is yes, how can I test it? I've tried to manually change the ECC for address 0x00000000 by changing address 0xF0000000 (the same way to test the SRAM ECC), but of course, that generates a data abort.
My major concern is that if main program flash correction is disabled and no abort or ESM flag is set, then it is possible that the main program keeps running with corrupted data.