I'm investigating the Hercules Safety Demo code. When I checked the HET parity error, the parity error occured on an unexpected line of code.
The error is generated in the file nhet.c , in the function void NHET_Parity(void):
The error is thrown at this line:
/** Enable NHET Parity */
nhetREG->HETPCR = 0x0000000A;
I was expecting it to happen here:
/** Corrupt the Parity RAM location to introduce a * Single bit error */
RAMBASE = (unsigned int *) (nhetMEM+0x2000) ;
*RAMBASE =~(*RAMBASE);
because it is only at that point that the memory inconsistency is introduced?
/** @fn void NHET_Parity(void) * @brief NHET RAM Parity Error creation and check routines. */ void NHET_Parity(void) { unsigned int temp; unsigned int *RAMBASE = (unsigned int *)nhetMEM; /** Enable NHET Parity */ nhetREG->HETPCR = 0x0000000A; // this is where the error is occuring /** Fill NHET RAM with known Pattern * The Parity Gets updated while filling the RAM */ for (temp=0;temp<0x080;temp++) { *RAMBASE = 0xA5A5A5A5; RAMBASE++; } /** Enable access to parity RAM */ nhetREG->HETPCR |= 0x00000100; /** Corrupt the Parity RAM location to introduce a * Single bit error */ RAMBASE = (unsigned int *) (nhetMEM+0x2000) ; *RAMBASE =~(*RAMBASE); // this is where I was expecting it to occur