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.

RM46L430: Extreme steps required to get SL_SelfTest_Flash to report passed

Part Number: RM46L430

Hello All,

This is what I had to do to get the ‘SL_SelfTest_Flash’ to report a passed

Insert a wrapper exception handler around the IRQ / FIQ and intercept the ESM high and low priority interrupt handlers, and in the wrapper:

            if test == FLASH_ADDRESS_PARITY_FAULT_INJECT then

                        Set ESM SR2 = 0x00000010

                        Set VIM IRQ INTREQ0 = 0x00000001

                        Restore previous FLASH FPAROVR

Before each call to ‘SL_SelfTest_Flash’:

            Save FLASH FPAROVR

            Save FLASH FDIAGCTRL

After each call to ‘SL_SelfTest_Flash’:

            Set FLASH FEDACSTATUS = 0xFFFFFFFF

            Restore FLASH FDIAGCTRL

            Read to unlock FLASH FUNCERRADD

            Clear ESM SR2 0x00000010

            Clear ESM SR3 0x00000080

            Clear and ERROR pin and reset the key to normal

Not all steps are required for each test, but all are required to get all tests to pass.

This was all done via code inspection and debugging, where is the specification for all of this?

Why do I need to put an extra layer of interrupt handling in just to get the tests to pass when interrupts are enabled?

Regards,

Mark.

  • Hello Mark,

    I just run SL_SelfTest_Flash() for FLASH_ADDRESS_PARITY_FAULT_INJECT, and passed without any code modification.

    The selftest_flash() does backup and restore the registers of FPAROVR, and FDIAGCTRL before and after the test:

    case FLASH_ADDRESS_PARITY_FAULT_INJECT:

    /* Backup registers */

    regBkupFparOvr = sl_flashWREG->FPAROVR;

    regBckupFdiagctrl = sl_flashWREG->FDIAGCTRL;

    ......

    /* Clear the diag mode settings */

    sl_flashWREG->FPAROVR = regBkupFparOvr;

    sl_flashWREG->FDIAGCTRL = regBckupFdiagctrl;

     

    The function also contains the statement to clear the ESM status register which is set by reading 0x20000000:

    /* Clear flash & ESM status registers */

    sl_flashWREG->FEDACSTATUS = F021F_FEDACSTATUS_ADD_PAR_ERR;

    sl_esmREG->SR1[1] = GET_ESM_BIT_NUM(ESM_G2ERR_FMC_UNCORR);

  • Hello Mr. Wang,

    As I said in my original post, not all of the measures are required for each test.

    Did you run this with interrupts enabled or disabled?

    Regards,

    Mark.

  • Hi Mark,

    Yes, the interrupt is enabled.

    The INT enable function (    _enable_interrupt_()) is called in sys_startup.c.

  • QJ Wang said:

    Yes, the interrupt is enabled.

    You only show FIQ & IRQ in the core, what about the VIM initialisation and 'SL_Init_ECCFlash'? There is a lot more than just enabling IRQ/FIQ to getting the interrupt mechanism to function.

    Did you call before or after the whole interrupt chain enabled?

    Did you check to see if the fault injection test actually causes an interrupt handler to be called?

    Do you have a different version of the test that removes the fault injection during the exception handler?

    The version that I have (2.3.1) does not remove the fault inject and as a result the return point of the interrupt handler is the fault injection instruction, which then rases another interrupt. The test will only reports a pass if it the fault injection does not raise an interrupt.