This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am trying out ECC on my device and am having some issues. I use HALCoGen to generate the ECC code and nowECC to inject errors. When I inject a double bit error, everything works as I would expect; it gets into the prefetch abort once the 64 bit chunk with the error has been loaded. If I inject only a single bit error, no correction or exception seems to happen. This picture shows the issue happening. The upper highlighted part shows the push command at the beginning of a function. nowECC modified this line to push r5 when it should not. In the lower highlighted region, you can see it does not pop r5 off which causes some issues. From the registers displayed, it looks like it detects an uncorrectable ECC error, but it looks like it may not be referring to this section in flash.
Can anyone explain why this is happening?
Sunil,
I apologize for the confusion. This is not in the abort handler. This test I have is for exercising the abort handlers. This function executes some code that would cause an exception if a variable is previously set.
I'm just using the Halcogen code for initializing it. Here are the CP1 register values related to TCM:
CP15_TCM_BTCM_REGION 0x08000039
CP15_TCM_ATCM_REGION 0x00000039
CP15_TCM_TCM_SELECTION 0x00000000
Here is the code Halcogen generates to set it up.
/* Enable CPU Event Export */
/* This allows the CPU to signal any single-bit or double-bit errors detected
* by its ECC logic for accesses to program flash or data RAM.
*/
_coreEnableEventBusExport_();
/* USER CODE BEGIN (9) */
/* USER CODE END */
/* Enable response to ECC errors indicated by CPU for accesses to flash */
flashWREG->FEDACCTRL1 = 0x000A060AU;
/* USER CODE BEGIN (10) */
/* USER CODE END */
/* Enable CPU ECC checking for ATCM (flash accesses) */
_coreEnableFlashEcc_();
I agree that the function is supposed to only push R3 and LR to the stack. If I don't modify the bits with nowECC, that is what happens. How could ECC be working and correct the instruction to something that it was not supposed to be when there was only a single bit error?
I couldn't find the register FEDCSTATUS. Where do I find that? When I typed that in the expressions tab in the same way I did in the image above, it says it couldn't find it. I looked in the ESM registers. The register the debugger calls "Stat1" is all zeros. Is that ESM group1 status?
Thanks,
Westin
Westin,
I had a typo in the register name that I mentioned. The FEDACSTATUS is at address 0xFFF8_701C.
Can you also post the contents of the other FCOR* registers along with the FEDACSTATUS register?
Regards,
Sunil
Westin,
Can you put a breakpoint on address 0x3459C and then read out the flash module registers when the execution stops here? Please also check the ESM status registers. The FEDACSTATUS register shows a detected uncorrectable error (bit 8). Can you clear this bit in the pre-fetch abort handler?
Regards,
Sunil
I'm pretty sure the corrupted instruction is being executed and not just displayed in the debugger. I made a break point on the push command and ran to it. At this point, the SP register was 0x08000EC8. I stepped over it and the SP register changed to 0x08000EBC. This indicates to me that three registers are being pushed onto the stack. Additionally, the PC register goes to 0 after we pop from the stack because R5 is zero and gets popped onto PC.