I am using "ti-processor-sdk-rtos-j7200-evm-08_04_00_04/sdl" to test OSPI ECC errors, but fail to get error information.
I use R5_0_0 in the MAIN domain to insert errors into MCU_FSS0_OSPI and retrieve error information.
However, the return value of "SDL_ECC_getErrorInfoAPI" is "SDL_FAIL".
I attached the source code.
Please let me know if there is anything I should check or if there is anything that needs to be fixed.
I refer to the following documents:
SDL API Guide for J7200
Software Diagnostics Library (SDL) - J7200 User Guide
#include <string.h> #include <stddef.h> #include <stdbool.h> #include <soc.h> #include <sdl_types.h> #include <src/sdl/sdl_ecc.h> #include <src/sdl/sdl_esm.h> #include <sdl_exception.h> #include <src/ip/r5/sdl_vim.h> #include "osal_interface.h" #include <src/sdl/ecc/soc/j7200/sdl_ecc_soc.h> /** ------------------------------------------------------------------------------------ * This structure holds the list of Ram Ids for memory subtypes SDL_MCU_FSS0_1 * ------------------------------------------------------------------------------------- */ static SDL_ECC_MemSubType ECC_Test_SDL_MCU_FSS0_1_subMemTypeList[SDL_MCU_FSS0_1_NUM_RAMS] = { SDL_MCU_FSS0_OSPI_OSPI_WRAP_SRAM_RAM_ID, }; static SDL_ECC_InitConfig_t ECC_Test_SDL_MCU_FSS0_1_initConfig = { .numRams = SDL_MCU_FSS0_1_NUM_RAMS, /**< Number of Rams ECC is enabled */ .pMemSubTypeList = &(ECC_Test_SDL_MCU_FSS0_1_subMemTypeList[0]), /**< Sub type list */ }; SDL_ESM_config ECC_Test_esmInitConfig_MCU = { .esmErrorConfig = {0u, 25u}, /* Self test error config */ .enableBitmap = {0xffffffffu, 0x00180003u, 0xffffffffu, }, /**< All events enable: except clkstop events for unused clocks */ .priorityBitmap = {0xffffffffu, 0x00180003u, 0xffffffffu, }, /**< All events high priority: except clkstop events for unused clocks */ .errorpinBitmap = {0xffffffffu, 0x00180003u, 0xffffffffu, }, /**< All events high priority: except clkstop for unused clocks * and selftest error events */ }; void SDL_ECC_applicationCallbackFunction(SDL_ECC_MemType eccMemType, uint32_t errorSrc, uint32_t address, uint32_t ramId, uint64_t bitErrorOffset, uint32_t bitErrorGroup) { int32_t retVal = SDL_PASS; return retVal; } int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInst, SDL_ESM_IntType esmIntrType, uint32_t grpChannel, uint32_t index, uint32_t intSrc, void *arg) { int32_t retVal = SDL_PASS; return retVal; } int32_t InjectTest(void) { SDL_ErrType_t result; int32_t retVal = -1; SDL_ECC_ErrorInfo_t pErrorInfo; SDL_ECC_MemType eccmemtype; SDL_Ecc_AggrIntrSrc eccIntrSrc; SDL_ECC_InjectErrorConfig_t injectErrorConfig; memset(&injectErrorConfig, 0, sizeof(injectErrorConfig)); injectErrorConfig.pErrMem = ((uint32_t *)SDL_ECC_aggrTable[SDL_ECC_MCU_FSS0_1_ECC_AGGR].memConfigTable[0].memStartAddr); injectErrorConfig.flipBitMask = 0x3; injectErrorConfig.chkGrp = 0x0; result = SDL_ECC_injectError(SDL_ECC_MCU_FSS0_1_ECC_AGGR, SDL_MCU_FSS0_OSPI_OSPI_WRAP_SRAM_RAM_ID, SDL_INJECT_ECC_ERROR_FORCING_2BIT_ONCE, &injectErrorConfig); if (result != SDL_PASS) { return retVal; } result = SDL_ECC_getESMErrorInfo(SDL_ESM_INST_MCU_ESM0, SDLR_MCU_ESM0_ESM_LVL_EVENT_MCU_FSS0_OSPI_0_OSPI_ECC_UNCORR_LVL_INTR_0, &eccmemtype, &eccIntrSrc); if (result != SDL_PASS) { return retVal; } result = SDL_ECC_getErrorInfo(eccmemtype, eccIntrSrc, &pErrorInfo); if (result != SDL_PASS) { return retVal; } return SDL_PASS; } int32_t EccTest(void) { int32_t result = SDL_PASS; int32_t retValue = -1; result = SDL_TEST_osalInit(); if (result != SDL_PASS) { return retValue; } /* Initialize MAIN ESM module - ESM config should be aligned with the desired error events */ result = SDL_ESM_init(SDL_ESM_INST_MCU_ESM0, &ECC_Test_esmInitConfig_MCU, SDL_ESM_applicationCallbackFunction, 0U); if (result != SDL_PASS) { return retValue; } /* Initialize ECC */ result = SDL_ECC_init(SDL_ECC_MCU_FSS0_1_ECC_AGGR, &ECC_Test_SDL_MCU_FSS0_1_initConfig); if (result != SDL_PASS) { return retValue; } result = SDL_ECC_initEsm(SDL_ESM_INST_MCU_ESM0); if (result != SDL_PASS) { return retValue; } result = InjectTest(); if (result != SDL_PASS) { return retValue; } return SDL_PASS; }