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.

VIM RAM parity error detection doesn't generate ESM interrupt but goes into prefetchEntry

Other Parts Discussed in Thread: HALCOGEN

I'm using HALCoGen 2.09.000 .
In the generated code _c_int00(), i use this function to enable parity check and parity bits memroy mapped,
    VIM_EnableRAMParityCheck();
    /* Initialize VIM table */
    {
        unsigned i;

        for (i = 0; i < 64U; i++)
        {
            vimRAM->ISR[i] = s_vim_init[i];
        }
    }

static void VIM_EnableRAMParityCheck(void)
{
 vimParityREG->TEST = 1U; /* parity bits are memory mapped*/
 vimParityREG->PARENA = 0xAU; /* VIM parity is enabled*/
}
while debugging, the VIM parity bits updated correctly after VIM RAM initialization.
And i enable VIM parity error in low level interrupt in ESM module.
And also, i use SPI3(master) and SPI1(slave) communicating, and enable SPI1 transfer-complete interrupt in high
level interrupt.
Before spi1HighLevelInterrupt() enters, i change the corresponding parity bit value to a wrong value in VIM RAM
area, and then continue run software, but the software will not enter esmLowLevelInterrupt(), it will goto sys_intvecs.asm and run to here:
prefetchEntry
        b   prefetchEntry
 
Why does this happen? and what should do when VIM RAM parity error detectes? and how to test VIM parity error detection? Much thanks.

  • Hi Fumin Li,

    before initializing the VIM table you have to enable the VIM Partiy:

    VIM_PARITY->PARCTL = 0xA;

    /* Initialize VIM table */
        {
            unsigned i;

            for (i = 0; i < 64U; i++)
            {
                vimRAM->ISR[i] = s_vim_init[i];
            }
        }

    For testing the VIM RAM Parity I used following code:

    address = (unsigned *) 0xFFF82054;
    VIM_PARITY->FBPAERR = *address;
                            /** - Enable Parity RAM memory mappring */
                            VIM_PARITY->PARCTL |= 0x100;
                             /** - Corrupt Parity to create Parity error */
                            address = vimMEM + 0x100 + VIM channel;
                             *address ^=1;
                             /** - Read the RAM location which has parity error */
                            address = vimMEM + VIM channel ;
                              *(volatile unsigned *)address;
                     Select for VIM channel the the channel on which you want to test the partiy. Do not use the base address ;-)

    The VIM RAM Partity is an special ESM channel. Before the ESM ISR is called the core runs to the address which is stored in VIM_PARITY->FBPAERR register. The default setting in this register is the prefetch entry address...

    This is done because you can not ensure, that the ESM ISR vector is uncorrupted in case of an VIM RAM parity.

    Set the FBPAERR register on a function where you can check the VIM channels or define another destinationfor the prefetch entry... Afterwards the core executes the ESM interrupt if you enabled them. Nevertheless, the an error pin event should be triggerd immediately.

    Regards,

    Matthias

    Please press verified answer, if this post answers your question!