Hi Everyone,
I am testing the VIM parity check on RM42L432 with the following code. The parity check result can pass a few times(ESM channel 15 is flagged), but after a hundreds times, the ESM channel 15 can not be flagged.
And I also found that the interrupt may be effected by the VIM parity check if the VIMRAMLOC is set to 0xFFF82000 although the 0xFFF82000 is related to a Phantom Vector!
Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#define VIMRAMPARLOC (*(volatile uint32 *)0xFFF82578U)
#define VIMRAMLOC (*(volatile uint32 *)0xFFF82178U)
void vimParityCheck(void)
{
volatile uint32 vimramread = 0U;
uint32 vimparctl_bk = VIM_PARCTL;
/* USER CODE BEGIN (49) */
/* USER CODE END */
/* Enable parity checking and parity test mode */
VIM_PARCTL = 0x0000010AU;
/* flip a bit in the VIM RAM parity location */
VIMRAMPARLOC ^= 0x1U;
/* disable parity test mode */
VIM_PARCTL = 0x0000000AU;
/* cause parity error */
vimramread = VIMRAMLOC;
/* check if ESM group1 channel 15 is flagged */
if ((esmREG->SR1[0U] & 0x8000U) ==0U)
{
/* VIM RAM parity error was not flagged to ESM. */
selftestFailNotification(VIMPARITYCHECK_FAIL1);
vRedunLedOn(); /*LED indicator*/
}
else
{
/* clear VIM RAM parity error flag in VIM */
VIM_PARFLG = 0x1U;
/* clear ESM group1 channel 15 flag */
esmREG->SR1[0U] = 0x8000U;
/* Enable parity checking and parity test mode */
VIM_PARCTL = 0x0000010AU;
/* Revert back to correct data, flip bit 0 of the parity location */
VIMRAMPARLOC ^= 0x1U;
}
/* Restore Parity Control register */
VIM_PARCTL = vimparctl_bk;
/* USER CODE BEGIN (50) */
/* USER CODE END */
}