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.

LAUNCHXL2-RM57L: Procedure to perform RAM and FLASH self tests ECC on RM57 board

Part Number: LAUNCHXL2-RM57L

Hi,

We are trying incorporate one and two bit ram and flash tests to run during startup. We have copied these tests over from the safety library 2.4.0. The tests complete, but we are not seeing the expected esm error for any of the tests. We are calling _coreEnableEventBusExport_() in our _c_int00() function.

Here is one of the shorter tests, the ECC two bit flash test. This test checks for the ESM Group 2 Bus Error, which is 0x3U. Any guidance would be much appreciated. 

namespace
{
constexpr auto VimChannelEpcFifoCamFull { 1U << 28U };
constexpr uint32_t EpcErrCamFull { 1U << 2U };
constexpr uint32_t EpcErrCamOverflow { 1U };
constexpr uint32_t EpcFifoFull { 0x1FU };
constexpr uint32_t EpcFifoOverflow { 0x1FU };
constexpr uint32_t EpcCtrlFullEnable { 1U << 24U };
constexpr uint32_t EpcCtrlSErrEnable { 0xAU };
constexpr uint32_t EpcCtrlSErrStart { 0U };
constexpr uint32_t EpcCtrlSErrLength { 4U };

constexpr uint32_t EpcCamContentAddress { 0xFFFFFFF8U };
constexpr uint32_t EpcCamIndexClear { 0x5U };
constexpr uint32_t EpcCamIndexLength { 4U };

uint32_t EpcCamIndexStart(const uint32_t n)
{
return 8*n;
}

constexpr uint32_t FlashBadEcc1 { 0x8U };
constexpr uint32_t FlashBadEcc2 { 0x16U };

constexpr uint32_t F021FFDiagCtrlDiagEnableKey { 0x00050000U };
constexpr uint32_t F021FFDiagCtrlDiagEnableMask { 0xFU << 16U };
constexpr uint32_t F021FFDiagCtrlDModeTestMode { 0x7U };
constexpr uint32_t F021FFDiagCtrlDiagBufSelA { 0U << 8U };
//constexpr uint32_t F021FFDiagCtrlDiagBufSelB { 4U << 8U };
constexpr uint32_t F021FFDiagCtrlDiagEnableStart { 8U };
constexpr uint32_t F021FFDiagCtrlDiagEnableLength { 3U };
constexpr uint32_t F021FFemuEccSyn1BitDataEcc { 0xCEU }; //this corrupts the ecc for data bit 0
constexpr uint32_t F021FFemuEccSyn2BitDataEcc { 0x03U }; //this corrupts the ecc for 2 bit error
constexpr uint32_t F021FFDiagCtrlDiagTrig { 1U << 24U };

constexpr uint32_t EsmG1ErrFMCCorr { 6U }; //ESM Group 1 - F021 Flash Correctable Error (Bus 1 & 2)
constexpr uint32_t EsmG1ErrEpcSerr { 4U }; //ESM Group 1 - EPC - ECC single bit error
constexpr uint32_t EsmG2ErrCr5BusErr { 3U }; //ESM Group 2 - R5 Bus Error
}

bool Rm57ProgramFlash::EccTwoBitTest()
{
Utility::ScopedPrivilegedSection sps {};
auto regBckupFdiagctrl = flashWREG->FDIAGCTRL;

/* Setup the diag mode for 2 bit error */
flashWREG->FDIAGCTRL = F021FFDiagCtrlDiagEnableKey | F021FFDiagCtrlDModeTestMode;

/* Prepare the values of data and ecc to be XORed */
flashWREG->FEMU_DMSW = 0U;
flashWREG->FEMU_DLSW = 0U;
flashWREG->FEMU_ECC = F021FFemuEccSyn2BitDataEcc;
/* Select the right port for reading from */
SetBitField(flashWREG->FDIAGCTRL, F021FFDiagCtrlDiagBufSelA, F021FFDiagCtrlDiagEnableStart, F021FFDiagCtrlDiagEnableLength);

flashWREG->FDIAGCTRL = flashWREG->FDIAGCTRL | F021FFDiagCtrlDiagTrig;

auto flashread = *(volatile uint32 *) FlashBadEcc2;

auto success = false;

if (Bit(EsmG2ErrCr5BusErr) == (esmREG->SSR2 & Bit(EsmG2ErrCr5BusErr))) {
/* Clear nError */
if (esmError() == 0U)
{
esmTriggerErrorPinReset();
}
esmREG->SSR2 = Bit(EsmG2ErrCr5BusErr);

success = true;
}

/* Clear the diag mode settings */
flashWREG->FDIAGCTRL = regBckupFdiagctrl;

return success;
}

  • Hi Phadon,

    The SDL includes an example for RM57Lx device. Please check if you are able to get the ESM error after performing the flash ECC selftest in the example.

    app_main_NoOS.c:

    /* Run 1Bit ECC test on Flash */
    retVal = SL_SelfTest_Flash(FLASH_ECC_TEST_MODE_1BIT, TRUE, &failInfoFlash);
    INCREMENT_PASS_FAIL_COUNTER(failInfoFlash, retVal);

    /* Run 2Bit ECC test on Flash */
    retVal = SL_SelfTest_Flash(FLASH_ECC_TEST_MODE_2BIT, TRUE, &failInfoFlash);
    INCREMENT_PASS_FAIL_COUNTER(failInfoFlash, retVal);

  • /* Run 1Bit ECC test on sRAM */
    retVal = SL_SelfTest_SRAM(SRAM_ECC_ERROR_FORCING_1BIT, TRUE, &failInfoTCMRAM);
    INCREMENT_PASS_FAIL_COUNTER(failInfoTCMRAM, retVal);

    /* Run 2Bit ECC test on sRAM */
    retVal = SL_SelfTest_SRAM(SRAM_ECC_ERROR_FORCING_2BIT, TRUE, &failInfoTCMRAM);
    INCREMENT_PASS_FAIL_COUNTER(failInfoTCMRAM, retVal);