To increase functional and system reliability, the memories in many device modules and subsystems are protected by Error Correcting Code (ECC), which performs Single Error Correction (SEC) and Double Error Detection (DED). Detected errors are reported via ESM. Single bit errors are corrected, and double bit errors are detected. The ECC Aggregator is connected to these memory and interconnect components which have the ECC. The ECC aggregator provides access to control and monitor the ECC protected memories in a module or subsystem.
SDL provides support for ECC aggregator configuration. Each ECC aggregator instance can be independently configured through the same SDL API by passing a different instance. The safety manual also defines test-for-diagnostics for the various IPs with ECC/parity support. The SDL also provides the support for executing ECC aggregator self-tests, using the error injection feature of the ECC aggregator. The ECC aggregators should be configured at startup, after running BIST.
Features Supported
The SDL provides support for the ECC through:
- ECC Configuration API
- ECC self-test API
- ECC error injection API
- ECC static register readback API
ECC error status APIs
The SDL ECC module requires a mapping of certain aggregator registers into the address space of the R5F Core. In these cases, the ECC module will use the DPL API SDL_DPL_addrTranslate() to get the address. The application must provide the mapped address through this call. This mapping is required for any ECC aggregator that is used which has an address which is not in the 32-bit address space. The mapping is expected to always be valid because it may be needed at runtime to get information about ECC errors that may be encountered.
There are over 8 ECC aggregators on the device each supporting multiple memories and interconnects.
Error Injection for Various RAM ID types
There are two types of ECC aggregator RAM IDs supported on the device (wrapper and interconnect). The wrapper types are used for memories where local computations are performed for particular processing cores in the device, and the interconnect types are utilized for interconnect bus signals between cores or to/from peripherals.
For wrapper RAM ID types, after injecting an error, the memory associated with that RAM ID needs to be accessed in order to trigger the error interrupt event. It is the application's responsibility to trigger the error event through memory access after injecting the error.
SysConfig Features
Features NOT Supported
Important Usage Guidelines
Example Usage of R5F ATCM0
The following shows an example of SDL R5F ECC API usage by the application for Error Injection Tests and Exception handling.
Include the below file to access the APIs
#include <sdl/r5/v0/interrupt.h>
#include "ecc_main.h"
Below are the macros specifies the RAM address, ECC aggregator and ECC aggregator RAMID for inject the ECC error
#define SDL_EXAMPLE_ECC_RAM_ADDR (0x00000510u) // R5F ATCM0 RAM address
#define SDL_EXAMPLE_ECC_AGGR SDL_R5FSS0_CORE0_ECC_AGGR
#define SDL_EXAMPLE_ECC_RAM_ID SDL_R5FSS0_CORE0_ECC_AGGR_PULSAR_SL_ATCM0_BANK0_RAM_ID
ESM callback function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
int32_t retVal;
printf("\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
printf("\r\nTake action \r\n");
printf("\r\nECC Error Call back function called : eccMemType %d, errorSrc 0x%x, " \
"ramId %d, bitErrorOffset 0x%04x%04x, bitErrorGroup %d\r\n",
{
}
else
{
}
esmError = true;
return retVal;
}
This is the list of exception handle and the parameters
{
.udefExptnHandlerArgs = ((void *)0u),
.swiExptnHandlerArgs = ((void *)0u),
.pabtExptnHandlerArgs = ((void *)0u),
.dabtExptnHandlerArgs = ((void *)0u),
.irqExptnHandlerArgs = ((void *)0u),
};
Below are the functions used to print the which exception is occured
void ECC_Test_undefInstructionExptnCallback(void)
{
printf("\r\nUndefined Instruction exception\r\n");
}
void ECC_Test_swIntrExptnCallback(void)
{
printf("\r\nSoftware interrupt exception\r\n");
}
void ECC_Test_prefetchAbortExptnCallback(void)
{
printf("\r\nPrefetch Abort exception\r\n");
}
void ECC_Test_dataAbortExptnCallback(void)
{
printf("\r\nData Abort exception\r\n");
}
void ECC_Test_irqExptnCallback(void)
{
printf("\r\nIrq exception\r\n");
}
void ECC_Test_fiqExptnCallback(void)
{
printf("\r\nFiq exception\r\n");
}
Initilize Exception handler
void ECC_Test_exceptionInit(void)
{
{
.swiExptnCallback = ECC_Test_swIntrExptnCallback,
.pabtExptnCallback = ECC_Test_prefetchAbortExptnCallback,
.dabtExptnCallback = ECC_Test_dataAbortExptnCallback,
.irqExptnCallback = ECC_Test_irqExptnCallback,
.fiqExptnCallback = ECC_Test_fiqExptnCallback,
};
return;
}
This structure defines the elements of ECC Init configuration
static SDL_ECC_MemSubType ECC_Test_R5FSS0_CORE0_subMemTypeList[SDL_R5FSS0_CORE0_MAX_MEM_SECTIONS] =
{
SDL_EXAMPLE_ECC_RAM_ID,
};
{
.
numRams = SDL_R5FSS0_CORE0_MAX_MEM_SECTIONS,
.pMemSubTypeList = &(ECC_Test_R5FSS0_CORE0_subMemTypeList[0]),
};
Event BitMap for ECC ESM callback for MSS
{
{
.errorNumber = SDL_ESMG1_ATCM0_SERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
}
};
Enabling the ECC module
Enabling the Event bus
Initialize ECC memory for the ECC aggregator
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_MSS_ESM, &ECC_TestparamsMSS[u8ParamCount],NULL,NULL);
Writing '000' will ungate the ESM Group3 (0 to 7) errors for dounle bit ATCM
SDL_REG32_WR(SDL_MSS_CTRL_ESM_GATING4, (0x0 << (((SDL_ESMG3_ATCM0_UERR ) % 8)*4)));
Initialize ECC parameters for single and double bit error injection
result =
SDL_ECC_init(SDL_EXAMPLE_ECC_AGGR, &ECC_Test_R5FSS0_CORE0_ECCInitConfig);
Execute ECC R5F ATCM0 single bit inject test
int32_t ECC_Test_run_R5FSS0_CORE0_ATCM0_BANK0_1BitInjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
volatile uint32_t testLocationValue;
DebugP_log(
"\r\nR5FSS0 CORE0 ATCM0 BANK0 Single bit error inject: starting \r\n");
injectErrorConfig.
pErrMem = (uint32_t *)(SDL_EXAMPLE_ECC_RAM_ADDR);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
if (result != SDL_PASS ) {
retVal = -1;
} else {
testLocationValue = injectErrorConfig.
pErrMem[0];
DebugP_log(
"\r\nR5FSS0 CORE0 ATCM0 BANK0 Single bit error inject at pErrMem = 0x%p and the value of pErrMem is 0x%p :test complete\r\n",
injectErrorConfig.
pErrMem, testLocationValue);
}
return retVal;
}
Execute ECC R5F ATCM0 double bit inject test
int32_t ECC_Test_run_R5FSS0_CORE0_ATCM0_BANK0_2BitInjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
volatile uint32_t testLocationValue;
DebugP_log(
"\r\nR5FSS0 CORE0 ATCM0 BANK0 Double bit error inject: starting \r\n");
injectErrorConfig.
pErrMem = (uint32_t *)(SDL_EXAMPLE_ECC_RAM_ADDR);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
if (result != SDL_PASS ) {
retVal = -1;
} else {
testLocationValue = injectErrorConfig.
pErrMem[0];
DebugP_log(
"\r\nR5FSS0 CORE0 ATCM0 BANK0 Double bit error inject: pErrMem fixed location = 0x%p once test complete: the value of pErrMem is 0x%p\r\n",
injectErrorConfig.
pErrMem, testLocationValue);
}
return retVal;
}
Example Usage of R5F BTCM
The following shows an example of SDL R5F ECC API usage by the application for Error Injection Tests and Exception handling.
Include the below file to access the APIs
#include <sdl/r5/v0/interrupt.h>
#include "ecc_main.h"
Below are the macros specifies the RAM address, ECC aggregator and ECC aggregator RAMID for inject the ECC error
#if SDL_B0TCM0_BANK0
#define SDL_R5FSS0_CORE0_MAX_MEM_SECTIONS (1u)
#define SDL_EXAMPLE_ECC_RAM_ADDR (0x00080010u)
#define SDL_EXAMPLE_ECC_AGGR SDL_R5FSS0_CORE0_ECC_AGGR
#define SDL_EXAMPLE_ECC_RAM_ID SDL_R5FSS0_CORE0_ECC_AGGR_PULSAR_SL_B0TCM0_BANK0_RAM_ID
#endif
#if SDL_B0TCM0_BANK1
#define SDL_R5FSS0_CORE0_MAX_MEM_SECTIONS (1u)
#define SDL_EXAMPLE_ECC_RAM_ADDR (0x00081510u)
#define SDL_EXAMPLE_ECC_AGGR SDL_R5FSS0_CORE0_ECC_AGGR
#define SDL_EXAMPLE_ECC_RAM_ID SDL_R5FSS0_CORE0_ECC_AGGR_PULSAR_SL_B0TCM0_BANK1_RAM_ID
#endif
#if SDL_B1TCM0_BANK0
#define SDL_R5FSS0_CORE0_MAX_MEM_SECTIONS (1u)
#define SDL_EXAMPLE_ECC_RAM_ADDR (0x00082510u)
#define SDL_EXAMPLE_ECC_AGGR SDL_R5FSS0_CORE0_ECC_AGGR
#define SDL_EXAMPLE_ECC_RAM_ID SDL_R5FSS0_CORE0_ECC_AGGR_PULSAR_SL_B1TCM0_BANK0_RAM_ID
#endif
#if SDL_B1TCM0_BANK1
#define SDL_R5FSS0_CORE0_MAX_MEM_SECTIONS (1u)
#define SDL_EXAMPLE_ECC_RAM_ADDR (0x00083510u)
#define SDL_EXAMPLE_ECC_AGGR SDL_R5FSS0_CORE0_ECC_AGGR
#define SDL_EXAMPLE_ECC_RAM_ID SDL_R5FSS0_CORE0_ECC_AGGR_PULSAR_SL_B1TCM0_BANK1_RAM_ID
#endif
ESM callback function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
int32_t retVal;
printf("\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
printf("\r\nTake action \r\n");
printf("\r\nECC Error Call back function called : eccMemType %d, errorSrc 0x%x, " \
"ramId %d, bitErrorOffset 0x%04x%04x, bitErrorGroup %d\r\n",
{
}
else
{
}
esmError = true;
return retVal;
}
This is the list of exception handle and the parameters
{
.udefExptnHandlerArgs = ((void *)0u),
.swiExptnHandlerArgs = ((void *)0u),
.pabtExptnHandlerArgs = ((void *)0u),
.dabtExptnHandlerArgs = ((void *)0u),
.irqExptnHandlerArgs = ((void *)0u),
};
Below are the functions used to print the which exception is occured
void ECC_Test_undefInstructionExptnCallback(void)
{
printf("\r\nUndefined Instruction exception\r\n");
}
void ECC_Test_swIntrExptnCallback(void)
{
printf("\r\nSoftware interrupt exception\r\n");
}
void ECC_Test_prefetchAbortExptnCallback(void)
{
printf("\r\nPrefetch Abort exception\r\n");
}
void ECC_Test_dataAbortExptnCallback(void)
{
printf("\r\nData Abort exception\r\n");
}
void ECC_Test_irqExptnCallback(void)
{
printf("\r\nIrq exception\r\n");
}
void ECC_Test_fiqExptnCallback(void)
{
printf("\r\nFiq exception\r\n");
}
Initilize Exception handler
void ECC_Test_exceptionInit(void)
{
{
.swiExptnCallback = ECC_Test_swIntrExptnCallback,
.pabtExptnCallback = ECC_Test_prefetchAbortExptnCallback,
.dabtExptnCallback = ECC_Test_dataAbortExptnCallback,
.irqExptnCallback = ECC_Test_irqExptnCallback,
.fiqExptnCallback = ECC_Test_fiqExptnCallback,
};
return;
}
This structure defines the elements of ECC Init configuration
static SDL_ECC_MemSubType ECC_Test_R5FSS0_CORE0_subMemTypeList[SDL_R5FSS0_CORE0_MAX_MEM_SECTIONS] =
{
SDL_EXAMPLE_ECC_RAM_ID,
};
{
.
numRams = SDL_R5FSS0_CORE0_MAX_MEM_SECTIONS,
.pMemSubTypeList = &(ECC_Test_R5FSS0_CORE0_subMemTypeList[0]),
};
Event BitMap for ECC ESM callback for MSS
{
{
.errorNumber = SDL_ESMG1_B0TCM0_SERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_1,
.errorNumber = SDL_ESMG1_B1TCM0_SERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
}
};
Enabling the ECC module
#if (SDL_B0TCM0_BANK0) || (SDL_B0TCM0_BANK1)
#endif
#if (SDL_B1TCM0_BANK0) || (SDL_B1TCM0_BANK1)
#endif
Enabling the Event bus
Initialize ECC memory for the ECC aggregator
Initialize ESM module
#if (SDL_B0TCM0_BANK0) || (SDL_B0TCM0_BANK1)
result =
SDL_ESM_init(SDL_ESM_INST_MSS_ESM, &ECC_TestparamsMSS[0],NULL,NULL);
SDL_REG32_WR(SDL_MSS_CTRL_ESM_GATING4, (0x0 << (((SDL_ESMG3_B0TCM0_UERR ) % 8)*4)));
#endif
#if (SDL_B1TCM0_BANK0) || (SDL_B1TCM0_BANK1)
result =
SDL_ESM_init(SDL_ESM_INST_MSS_ESM, &ECC_TestparamsMSS[1],NULL,NULL);
SDL_REG32_WR(SDL_MSS_CTRL_ESM_GATING4, (0x0 << (((SDL_ESMG3_B1TCM0_UERR ) % 8)*4)));
#endif
Initialize ECC parameters for single and double bit error injection
result =
SDL_ECC_init(SDL_EXAMPLE_ECC_AGGR, &ECC_Test_R5FSS0_CORE0_ECCInitConfig);
Execute ECC R5F BTCM single bit inject test
int32_t ECC_Test_run_R5FSS0_CORE0_BTCM_1BitInjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
volatile uint32_t testLocationValue;
DebugP_log(
"\r\nR5FSS0 CORE0 BTCM Single bit error inject: starting \r\n");
injectErrorConfig.
pErrMem = (uint32_t *)(SDL_EXAMPLE_ECC_RAM_ADDR);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
if (result != SDL_PASS ) {
retVal = -1;
} else {
testLocationValue = injectErrorConfig.
pErrMem[0];
DebugP_log(
"\r\nR5FSS0 CORE0 BTCM Single bit error inject at pErrMem = 0x%p and the value of pErrMem is 0x%p :test complete\r\n",
injectErrorConfig.
pErrMem, testLocationValue);
}
return retVal;
}
Execute ECC R5F BTCM double bit inject test
int32_t ECC_Test_run_R5FSS0_CORE0_BTCM_2BitInjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
volatile uint32_t testLocationValue;
DebugP_log(
"\r\nR5FSS0 CORE0 BTCM Double bit error inject: starting \r\n");
injectErrorConfig.
pErrMem = (uint32_t *)(SDL_EXAMPLE_ECC_RAM_ADDR);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
if (result != SDL_PASS ) {
retVal = -1;
} else {
testLocationValue = injectErrorConfig.
pErrMem[0];
DebugP_log(
"\r\nR5FSS0 CORE0 BTCM Double bit error inject: pErrMem fixed location = 0x%p once test complete: the value of pErrMem is 0x%p\r\n",
injectErrorConfig.
pErrMem, testLocationValue);
}
return retVal;
}
Example Usage of MSS L2
The following shows an example of SDL MSS L2 API usage by the application for Error Injection Tests and Exception handling.
Include the below file to access the APIs
Below are the macros specifies the RAM address, ECC aggregator and ECC aggregator RAMID for inject the ECC error
#define SDL_EXAMPLE_ECC_RAM_ADDR (0x10280000u)
#define SDL_EXAMPLE_ECC_AGGR SDL_MSS_ECC_AGG_MSS
#define SDL_EXAMPLE_ECC_RAM_ID SDL_MSS_ECC_AGG_MSS_MSS_L2RAMB_ECC_RAM_ID
#define SDL_MSS_L2_MEM_INIT_ADDR (0x02120034u)
#define SDL_MSS_L2_MEM_INIT_DONE_ADDR (0x02120038u)
#define SDL_ECC_AGGR_ERROR_STATUS1_ADDR (0x02F7c020u)
#define SDL_ECC_MSS_L2_BANK_MEM_INIT (0x2u)
ESM callback function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
int32_t retVal;
printf("\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
printf("\r\nTake action \r\n");
printf("\r\nECC Error Call back function called : eccMemType %d, errorSrc 0x%x, " \
"ramId %d, bitErrorOffset 0x%04x%04x, bitErrorGroup %d\r\n",
{
}
else
{
}
esmError = true;
return retVal;
}
This structure defines the elements of ECC Init configuration
{
SDL_EXAMPLE_ECC_RAM_ID,
};
{
.
numRams = SDL_MSS_L2_MAX_MEM_SECTIONS,
.pMemSubTypeList = &(ECC_Test_MSS_L2_subMemTypeList[0]),
};
Event BitMap for ECC ESM callback for MSS
{
{
.errorNumber = SDL_ESMG1_ECCAGGMSS_SERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_1,
.errorNumber = SDL_ESMG1_ECCAGGMSS_UERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_HIGH,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
};
Initialization of MSS L2 memory
SDL_REG32_WR(SDL_MSS_L2_MEM_INIT_ADDR, SDL_ECC_MSS_L2_BANK_MEM_INIT);
while(
SDL_REG32_RD(SDL_MSS_L2_MEM_INIT_DONE_ADDR)!=SDL_ECC_MSS_L2_BANK_MEM_INIT);
SDL_REG32_WR(SDL_MSS_L2_MEM_INIT_DONE_ADDR, SDL_ECC_MSS_L2_BANK_MEM_INIT);
Clearing any old interrupt presented
Initialize ECC memory for the ECC aggregator
Initialize ECC parameters for single and double bit error injection
result =
SDL_ECC_init(SDL_EXAMPLE_ECC_AGGR, &ECC_Test_MSS_ECCInitConfig);
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_MSS_ESM, &ECC_TestparamsMSS[0],NULL,NULL);
esmError = false;
Execute ECC MSS L2 single bit inject test
int32_t ECC_Test_run_MSS_L2RAMB_1BitInjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
volatile uint32_t testLocationValue;
DebugP_log(
"\r\nMSS L2 RAMB Single bit error inject: starting \r\n");
injectErrorConfig.
pErrMem = (uint32_t *)(SDL_EXAMPLE_ECC_RAM_ADDR);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
if (result != SDL_PASS ) {
retVal = -1;
} else {
testLocationValue = injectErrorConfig.
pErrMem[0];
DebugP_log(
"\r\nMSS L2 RAMB Single bit error inject at pErrMem = 0x%p and the value of pErrMem is 0x%p :test complete\r\n",
injectErrorConfig.
pErrMem, testLocationValue);
}
return retVal;
}
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_MSS_ESM, &ECC_TestparamsMSS[1],NULL,NULL);
esmError = false;
Initialization of MSS L2 memory
SDL_REG32_WR(SDL_MSS_L2_MEM_INIT_ADDR, SDL_ECC_MSS_L2_BANK_MEM_INIT);
while(
SDL_REG32_RD(SDL_MSS_L2_MEM_INIT_DONE_ADDR)!=SDL_ECC_MSS_L2_BANK_MEM_INIT);
SDL_REG32_WR(SDL_MSS_L2_MEM_INIT_DONE_ADDR, SDL_ECC_MSS_L2_BANK_MEM_INIT);
Clearing any old interrupt presented
Execute ECC MSS L2 double bit inject test
int32_t ECC_Test_run_MSS_L2RAMB_2BitInjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
volatile uint32_t testLocationValue;
DebugP_log(
"\r\nMSS L2 RAMB Double bit error inject: starting \r\n");
injectErrorConfig.
pErrMem = (uint32_t *)(SDL_EXAMPLE_ECC_RAM_ADDR);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
testLocationValue = injectErrorConfig.
pErrMem[0];
if (result != SDL_PASS ) {
retVal = -1;
} else {
DebugP_log(
"\r\nMSS L2 RAMB Double bit error inject: pErrMem fixed location = 0x%p once test complete: the value of pErrMem is 0x%p\r\n",
injectErrorConfig.
pErrMem, testLocationValue);
}
return retVal;
}
Example Usage of MSS TPTC
The following shows an example of SDL MSS TPTC API usage by the application for Error Injection Tests and Exception handling.
Include the below file to access the APIs
#include "ti_drivers_config.h"
#include "ti_drivers_open_close.h"
#include "ti_board_open_close.h"
#include "ecc_main.h"
Below are the macros specifies the ECC aggregator and ECC aggregator RAMID for inject the ECC error
#define SDL_ESM_MAX_MSS_EXAMPLE_AGGR (2u)
#define SDL_MSS_MAX_MEM_SECTIONS (1u)
#define SDL_INTR_GROUP_NUM_1 (1U)
#define SDL_INTR_PRIORITY_LVL_LOW (0U)
#define SDL_INTR_PRIORITY_LVL_HIGH (1U)
#define SDL_ENABLE_ERR_PIN (1U)
#define SDL_ECC_SEC (1U)
#define SDL_ECC_DED (2U)
#define SDL_EXAMPLE_ECC_AGGR SDL_MSS_ECC_AGG_MSS
#define SDL_EXAMPLE_ECC_RAM_ID SDL_MSS_ECC_AGG_MSS_MSS_TPTC_A0_ECC_RAM_ID
ESM callback function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
int32_t retVal;
printf("\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
printf("\r\nTake action \r\n");
printf("\r\nECC Error Call back function called : eccMemType %d, errorSrc 0x%x, " \
"ramId %d, bitErrorOffset 0x%04x%04x, bitErrorGroup %d\r\n",
{
}
else
{
}
esmError = true;
return retVal;
}
This structure defines the elements of ECC Init configuration
{
SDL_EXAMPLE_ECC_RAM_ID,
};
{
.
numRams = SDL_MSS_MAX_MEM_SECTIONS,
.pMemSubTypeList = &(ECC_Test_MSS_subMemTypeList[0]),
};
Event BitMap for ECC ESM callback for MSS
{
{
.errorNumber = SDL_ESMG1_ECCAGGMSS_SERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_1,
.errorNumber = SDL_ESMG1_ECCAGGMSS_UERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_HIGH,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
};
Initialization of EDMA and ECC injection
Initialize EDMA
EDMA_Init();
DebugP_log(
"\r\n[EDMA] Interrupt Transfer Test Started...\r\n");
dmaCh = channelEvent;
tcc = channelEvent;
param = channelEvent;
Initialize ECC memory for the ECC aggregator
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_MSS_ESM, &ECC_TestparamsMSS[counter],NULL,NULL);
Initialize ECC parameters for single and double bit error injection
result =
SDL_ECC_init(SDL_EXAMPLE_ECC_AGGR, &ECC_Test_MSS_ECCInitConfig);
Execute ECC MSS TPTC single bit inject test
int32_t ECC_Test_run_MSS_TPTC_A0_1Bit_InjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
DebugP_log(
"\n MSS TPTC_A0 Single bit error inject: test starting");
injectErrorConfig.
pErrMem = (uint32_t *)(0x0u);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
if (result != SDL_PASS ) {
DebugP_log(
"\n MSS TPTC_A0 Single bit error inject at pErrMem 0x%p test failed",
retVal = -1;
} else {
DebugP_log(
"\n MSS TPTC_A0 Single bit error inject at pErrMem 0x%p",
}
return retVal;
}
Execute ECC MSS TPTC double bit inject test
int32_t ECC_Test_run_MSS_TPTC_A0_2Bit_InjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
DebugP_log(
"\n MSS TPTC_A0 Double bit error inject: starting");
injectErrorConfig.
pErrMem = (uint32_t *)(0x0u);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
if (result != SDL_PASS ) {
DebugP_log(
"\n MSS TPTC_A0 Double bit error inject: at pErrMem 0x%p: fixed location once test failed",
retVal = -1;
} else {
DebugP_log(
"\n MSS TPTC_A0 Double bit error inject at pErrMem 0x%p ",
}
return retVal;
}
Initialize the source address with a pattern and initialize dst address with zero/another pattern (optional)
srcBuffPtr = (uint8_t *) gEdmaTestSrcBuff;
dstBuffPtr = (uint8_t *) gEdmaTestDstBuff;
for(loopCnt = 0U; loopCnt < EDMA_TEST_BUFFER_SIZE; loopCnt++)
{
srcBuffPtr[loopCnt] = (uint8_t)loopCnt;
dstBuffPtr[loopCnt] = 0;
}
dmaCh, tcc, param, queueType);
edmaParam.aCnt = (uint16_t) EDMA_TEST_A_COUNT;
edmaParam.bCnt = (uint16_t) EDMA_TEST_B_COUNT;
edmaParam.cCnt = (uint16_t) EDMA_TEST_C_COUNT;
edmaParam.bCntReload = (uint16_t) EDMA_TEST_B_COUNT;
edmaParam.srcCIdx = (int16_t) EDMA_TEST_A_COUNT;
edmaParam.destCIdx = (int16_t) EDMA_TEST_A_COUNT;
edmaParam.linkAddr = 0xFFFFU;
edmaParam.opt |=
intrObj.tccNum = tcc;
intrObj.cbFxn = &EDMA_regionIsrFxn;
intrObj.appData = (void *) &gEdmaTestDoneSem;
for(loopCnt = 0; loopCnt < (EDMA_TEST_B_COUNT * EDMA_TEST_C_COUNT); loopCnt++)
{
}
for(loopCnt = 0; loopCnt < EDMA_TEST_BUFFER_SIZE; loopCnt++)
{
if(srcBuffPtr[loopCnt] != dstBuffPtr[loopCnt])
{
DebugP_log(
"Error matching value at src and dst address %d\r\n", loopCnt);
result = SDL_EFAIL;
break;
}
}
{
DebugP_log(
"\r\n[EDMA] Interrupt Transfer Test Completed!!\r\n");
if(esmError == TRUE)
{
esmError = false;
}
else
{
result = SDL_EFAIL;
DebugP_log(
"\r\nESM interrupt is not occurred.... Test is failed!!\r\n");
}
}
else
{
result = SDL_EFAIL;
}
EDMA_Deinit();
Example Usage of DSS MAILBOX
Include the below file to access the APIs
Initialize ECC memory for the ECC aggregator
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_DSS_ESM, &ECC_TestparamsDSS[u8ParamCount],NULL,NULL);
Initialize ECC parameters for single and double bit error injection
result =
SDL_ECC_init(SDL_DSS_ECC_AGG, &ECC_Test_DSSECCInitConfig);
Execute ECC DSS MAILBOX single bit inject test
int32_t ECC_Test_run_DSS_MAILBOX_1BitInjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
uint32_t ecc_ctrl = 0, ecc_sts = 0 ;
volatile uint32_t testLocationValue;
SDL_edc_ctlRegs *pEccAggrRegs = ((SDL_edc_ctlRegs *)((uintptr_t)0x060A0000u));
DebugP_log(
"\n DSS MAILBOX Single bit error inject: test starting");
injectErrorConfig.
pErrMem = (uint32_t *)(0x83100000u);
DebugP_log(
"\n DSS ECC control Register = 0x%p and Status Register = 0x%p values before ECC single bit error injection",
ecc_ctrl, ecc_sts);
SDL_DSS_ECC_AGG_DSS_MAILBOX_ECC_RAM_ID,
&injectErrorConfig);
testLocationValue = injectErrorConfig.
pErrMem[0];
DebugP_log(
"\n DSS ECC control Register = 0x%p and Status Register = 0x%p values after ECC single bit error injection",
ecc_ctrl, ecc_sts);
if (result != SDL_PASS ) {
DebugP_log(
"\n DSS MAILBOX Single bit error inject at pErrMem 0x%p test failed",
retVal = -1;
} else {
DebugP_log(
"\n DSS MAILBOX Single bit error inject at pErrMem 0x%p",
injectErrorConfig.
pErrMem, testLocationValue);
}
return retVal;
}
Execute ECC DSS MAILBOX double bit inject test
int32_t ECC_Test_run_DSS_MAILBOX_2BitInjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
uint32_t ecc_ctrl = 0, ecc_sts = 0;
volatile uint32_t testLocationValue;
SDL_edc_ctlRegs *pEccAggrRegs = ((SDL_edc_ctlRegs *)((uintptr_t)0x060A0000u));
DebugP_log(
"\n DSS MAILBOX Double bit error inject: starting");
injectErrorConfig.
pErrMem = (uint32_t *)(0x83100000u);
DebugP_log(
"\n DSS ECC control Register = 0x%p and Status Register = 0x%p values before ECC double bit error injection",
ecc_ctrl, ecc_sts);
SDL_DSS_ECC_AGG_DSS_MAILBOX_ECC_RAM_ID,
&injectErrorConfig);
testLocationValue = injectErrorConfig.
pErrMem[0];
DebugP_log(
"\n DSS ECC control Register = 0x%p and Status Register = 0x%p values after ECC double bit error injection",
ecc_ctrl, ecc_sts);
if (result != SDL_PASS ) {
DebugP_log(
"\n DSS MAILBOX Double bit error inject: at pErrMem 0x%p: fixed location once test failed",
retVal = -1;
} else {
DebugP_log(
"\n DSS MAILBOX Double bit error inject at pErrMem 0x%p ",
}
return retVal;
}
Example Usage of DSS TPTC
The following shows an example of SDL DSS TPTC API usage by the application for Error Injection Tests and Exception handling.
Include the below file to access the APIs
#include "ti_drivers_config.h"
#include "ti_drivers_open_close.h"
#include "ti_board_open_close.h"
#include "ecc_main.h"
Below are the macros specifies the ECC aggregator and ECC aggregator RAMID for inject the ECC error
#define SDL_ESM_MAX_DSS_EXAMPLE_AGGR (2u)
#define SDL_INTR_GROUP_NUM (1U)
#define SDL_INTR_PRIORITY_LVL_LOW (0U)
#define SDL_INTR_PRIORITY_LVL_HIGH (1U)
#define SDL_ENABLE_ERR_PIN (1U)
#define SDL_ECC_SEC (1U)
#define SDL_ECC_DED (2U)
#define SDL_DSS_MAX_MEM_SECTIONS (1u)
#define SDL_EXAMPLE_ECC_AGGR SDL_DSS_ECC_AGG
#define SDL_EXAMPLE_ECC_RAM_ID SDL_DSS_ECC_AGG_DSS_TPTC_A0_FIFO_ECC_RAM_ID
ESM callback function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
int32_t retVal;
printf("\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
printf("\r\nTake action \r\n");
printf("\r\nECC Error Call back function called : eccMemType %d, errorSrc 0x%x, " \
"ramId %d, bitErrorOffset 0x%04x%04x, bitErrorGroup %d\r\n",
{
}
else
{
}
esmError = true;
return retVal;
}
This structure defines the elements of ECC Init configuration
{
SDL_EXAMPLE_ECC_RAM_ID,
};
{
.
numRams = SDL_DSS_MAX_MEM_SECTIONS,
.pMemSubTypeList = &(ECC_Test_DSSsubMemTypeList[0]),
};
Event BitMap for ECC ESM callback for DSS
{
{
.errorNumber = SDL_DSS_ESMG1_DSS_ECC_AGG_SERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.errorNumber = SDL_DSS_ESMG1_DSS_ECC_AGG_UERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_HIGH,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
};
Initialization of EDMA and ECC injection
Initialize EDMA
EDMA_Init();
DebugP_log(
"\r\n[EDMA] Interrupt Transfer Test Started...\r\n");
dmaCh = channelEvent;
tcc = channelEvent;
param = channelEvent;
Initialize ECC memory for the ECC aggregator
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_DSS_ESM, &ECC_TestparamsDSS[counter],NULL,NULL);
Initialize ECC parameters for single and double bit error injection
result =
SDL_ECC_init(SDL_DSS_ECC_AGG, &ECC_Test_DSSECCInitConfig);
Execute ECC DSS TPTC single bit inject test
int32_t ECC_Test_run_DSS_TPTC_A0_1Bit_InjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
DebugP_log(
"\r\nDSS TPTC_A0 Single bit error inject: test starting\r\n");
injectErrorConfig.
pErrMem = (uint32_t *)(0x0u);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
if (result != SDL_PASS ) {
DebugP_log(
"\r\nDSS TPTC_A0 Single bit error inject at pErrMem 0x%p test failed\r\n",
retVal = -1;
} else {
DebugP_log(
"\r\nDSS TPTC_A0 Single bit error inject at pErrMem 0x%p\r\n",
}
return retVal;
}
Execute ECC DSS TPTC double bit inject test
int32_t ECC_Test_run_DSS_TPTC_A0_2Bit_InjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
DebugP_log(
"\r\nDSS TPTC_A0 Double bit error inject: starting\r\n");
injectErrorConfig.
pErrMem = (uint32_t *)(0x0u);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
if (result != SDL_PASS ) {
DebugP_log(
"\r\nDSS TPTC_A0 Double bit error inject: at pErrMem 0x%p: fixed location once test failed\r\n",
retVal = -1;
} else {
DebugP_log(
"\r\nDSS TPTC_A0 Double bit error inject at pErrMem 0x%p\r\n ",
}
return retVal;
}
Initialize the source address with a pattern and initialize dst address with zero/another pattern (optional)
srcBuffPtr = (uint8_t *) gEdmaTestSrcBuff;
dstBuffPtr = (uint8_t *) gEdmaTestDstBuff;
for(loopCnt = 0U; loopCnt < EDMA_TEST_BUFFER_SIZE; loopCnt++)
{
srcBuffPtr[loopCnt] = (uint8_t)loopCnt;
dstBuffPtr[loopCnt] = 0;
}
dmaCh, tcc, param, queueType);
edmaParam.aCnt = (uint16_t) EDMA_TEST_A_COUNT;
edmaParam.bCnt = (uint16_t) EDMA_TEST_B_COUNT;
edmaParam.cCnt = (uint16_t) EDMA_TEST_C_COUNT;
edmaParam.bCntReload = (uint16_t) EDMA_TEST_B_COUNT;
edmaParam.srcCIdx = (int16_t) EDMA_TEST_A_COUNT;
edmaParam.destCIdx = (int16_t) EDMA_TEST_A_COUNT;
edmaParam.linkAddr = 0xFFFFU;
edmaParam.opt |=
intrObj.tccNum = tcc;
intrObj.cbFxn = &EDMA_regionIsrFxn;
intrObj.appData = (void *) &gEdmaTestDoneSem;
for(loopCnt = 0; loopCnt < (EDMA_TEST_B_COUNT * EDMA_TEST_C_COUNT); loopCnt++)
{
}
for(loopCnt = 0; loopCnt < EDMA_TEST_BUFFER_SIZE; loopCnt++)
{
if(srcBuffPtr[loopCnt] != dstBuffPtr[loopCnt])
{
DebugP_log(
"Error matching value at src and dst address %d\r\n", loopCnt);
result = SDL_EFAIL;
break;
}
}
{
DebugP_log(
"\r\n[EDMA] Interrupt Transfer Test Completed!!\r\n");
if(esmError == TRUE)
{
esmError = false;
}
else
{
result = SDL_EFAIL;
DebugP_log(
"\r\nESM interrupt is not occurred.... Test is failed!!\r\n");
}
}
else
{
result = SDL_EFAIL;
}
EDMA_Deinit();
Example Usage of MCAN
Include the below file to access the APIs
Below are the macros specifies the RAM address, ECC aggregator and ECC aggregator RAMID for inject the ECC error
#define SDL_ESM_MAX_MCANA_EXAMPLE_AGGR (2u)
#define SDL_INTR_GROUP_NUM_1 (1U)
#define SDL_INTR_GROUP_NUM_2 (2U)
#define SDL_INTR_GROUP_NUM_3 (3U)
#define SDL_INTR_PRIORITY_LVL_LOW (0U)
#define SDL_INTR_PRIORITY_LVL_HIGH (1U)
#define SDL_ENABLE_ERR_PIN (1U)
#define SDL_EXAMPLE_ECC_RAM_ADDR (0x02040000u)
#define SDL_EXAMPLE_ECC_AGGR SDL_MSS_MCANA_ECC
#define SDL_EXAMPLE_ECC_RAM_ID SDL_MSS_MCANA_ECC_MSS_MCANA_ECC_RAM_ID
This structure defines the elements of ECC Init configuration
{
SDL_EXAMPLE_ECC_RAM_ID,
};
{
.
numRams = SDL_MCANA_MAX_MEM_SECTIONS,
.pMemSubTypeList = &(ECC_Test_MCANA_subMemTypeList[0]),
};
ESM callback function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
int32_t retVal;
printf("\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
printf("\r\nTake action \n");
printf("\r\nECC Error Call back function called : eccMemType %d, errorSrc 0x%x, " \
"ramId %d, bitErrorOffset 0x%04x%04x, bitErrorGroup %d\r\n",
{
}
else
{
}
esmError = true;
return retVal;
}
Event BitMap for ECC ESM callback for MCAN
{
{
.errorNumber = SDL_ESMG1_MCANA_SERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_1,
.errorNumber = SDL_ESMG1_MCANA_SERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_HIGH,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
};
Initialize ECC memory for the ECC aggregator
Initialize ECC parameters for single and double bit error injection
result =
SDL_ECC_init(SDL_EXAMPLE_ECC_AGGR, &ECC_Test_MCANA_ECCInitConfig);
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_MSS_ESM, &ECC_TestparamsMCANA[0],NULL,NULL);
Write some data to the RAM memory before injecting
for(i=1;i<=num_of_iterations;i++){
wr_data = (i)<<24 | (i)<<16 | (i)<<8 | i;
}
Execute ECC MCAN single bit inject test
int32_t ECC_Test_run_MCANA_1BitInjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
volatile uint32_t testLocationValue;
DebugP_log(
"\r\nMCANA Single bit error inject: starting \r\n");
injectErrorConfig.
pErrMem = (uint32_t *)(SDL_EXAMPLE_ECC_RAM_ADDR);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
if (result != SDL_PASS ) {
retVal = -1;
} else {
testLocationValue = injectErrorConfig.
pErrMem[0];
DebugP_log(
"\r\nMCANA Single bit error inject at pErrMem = 0x%p and the value of pErrMem is 0x%p :test complete\r\n",
injectErrorConfig.
pErrMem, testLocationValue);
}
return retVal;
}
Read data from the RAM memory after injecting
for(i=1;i<=num_of_iterations;i++){
}
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_MSS_ESM, &ECC_TestparamsMCANA[1],NULL,NULL);
Write some data to the RAM memory before injecting
for(i=1;i<=num_of_iterations;i++){
wr_data = (i)<<24 | (i)<<16 | (i)<<8 | i;
}
Execute ECC MCAN double bit inject test
int32_t ECC_Test_run_MCANA_2BitInjectTest(void)
{
SDL_ErrType_t result;
int32_t retVal=0;
volatile uint32_t testLocationValue;
DebugP_log(
"\r\nMCANA double bit error inject: starting \r\n");
injectErrorConfig.
pErrMem = (uint32_t *)(SDL_EXAMPLE_ECC_RAM_ADDR);
SDL_EXAMPLE_ECC_RAM_ID,
&injectErrorConfig);
testLocationValue = injectErrorConfig.
pErrMem[0];
if (result != SDL_PASS ) {
retVal = -1;
} else {
DebugP_log(
"\r\nMCANA Double bit error inject: pErrMem fixed location = 0x%p once test complete: the value of pErrMem is 0x%p\r\n",
injectErrorConfig.
pErrMem, testLocationValue);
}
return retVal;
}
Read data from the RAM memory after injecting
for(i=1;i<=num_of_iterations;i++){
}
Example Usage of TCM Parity
Include the below file to access the APIs
Below are the macros specifies the values need to set for TCM parity Error forcing
#define SDL_ESM_MAX_EXAMPLE (6u)
#define SDL_INTR_GROUP_NUM_2 (2U)
#define SDL_INTR_PRIORITY_LVL_LOW (0U)
#define SDL_INTR_PRIORITY_LVL_HIGH (1U)
#define SDL_ENABLE_ERR_PIN (1U)
#define SDL_ATCM0_MASK (0x7U)
#define SDL_ATCM1_MASK (0x70U)
#define SDL_B0TCM0_MASK (0x700U)
#define SDL_B0TCM1_MASK (0x7000U)
#define SDL_B1TCM0_MASK (0x70000U)
#define SDL_B1TCM1_MASK (0x700000U)
ESM callback function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
printf("\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
printf("\r\nTake action \r\n");
esmError = true;
return 0;
}
Event BitMap for ESM callback for TCM Parity
{
{
.errorNumber = SDL_ESMG2_ATCM0_PARITY_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_2,
.errorNumber = SDL_ESMG2_ATCM1_PARITY_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_HIGH,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_2,
.errorNumber = SDL_ESMG2_B0TCM0_PARITY_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_2,
.errorNumber = SDL_ESMG2_B0TCM1_PARITY_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_HIGH,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_2,
.errorNumber = SDL_ESMG2_B1TCM0_PARITY_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_2,
.errorNumber = SDL_ESMG2_B1TCM1_PARITY_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_HIGH,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
};
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_MSS_ESM, &ECC_TestparamsMSS[0],NULL,NULL);
Execute TCM Parity Error injection for B0TCM0 for R5FSS0 core 0
if (retVal == 0)
{
DebugP_log(
"\r\nMSS TCM PARITY: ATCM0 Started\r\n");
result = SDL_ECC_tcmParity(SDL_TCM_PARITY_ATCM0,\
SDL_ATCM0_MASK);
while(esmError !=true);
esmError = false;
if (result != SDL_PASS)
{
retVal = -1;
}
else{
retVal = 0;
DebugP_log(
"\r\nMSS ATCM0 Parity : Completed\r\n");
}
}
Example Usage of DMA Parity
Include the below file to access the APIs
ESM callback function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
printf("\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
printf("\r\nTake action \r\n");
#if defined(R5F_INPUTS)
#endif
#if defined(C66_INPUTS)
#endif
esmError = true;
return 0;
}
Event BitMap for ESM callback for TCM Parity
{
{
.errorNumber = SDL_ESMG1_MSS_TPCC_A_INTAGG_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_1,
.errorNumber = SDL_ESMG1_MSS_TPCC_B_INTAGG_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_HIGH,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
};
{
{
.errorNumber = SDL_DSS_ESMG1_DSS_TPCC_A_INTAGG_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_1,
.errorNumber = SDL_DSS_ESMG1_DSS_TPCC_B_INTAGG_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_HIGH,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.groupNumber = SDL_INTR_GROUP_NUM_1,
.errorNumber = SDL_DSS_ESMG1_DSS_TPCC_C_INTAGG_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
};
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_MSS_ESM, &ECC_Testparams[0],NULL,NULL);
Execute TPCC Parity Error injection
if (retVal == 0)
{
paramstatus = SDL_ECC_TPCCParity(SDL_TPCC0A, \
0x11);
DebugP_log(
"\r\nParam Register = %x\r\n", paramstatus);
while(esmError !=true);
for (i =0 ; i < 200 ; i = i + 1 );
if(esmError == true)
{
DebugP_log(
"\r\nMSS TPCCA Parity : Completed\r\n");
esmError = false;
}
else{
retVal = -1;
}
}
Example Usage of DSS L2 Parity
Include the below file to access the APIs
Below are the macros specifies the ESM init and DSS DSP parity registers used to inject parity error
#define SDL_ESM_MAX_DSS_EXAMPLE_AGGR (1u)
#define SDL_INTR_GROUP_NUM (1U)
#define SDL_INTR_PRIORITY_LVL_LOW (0U)
#define SDL_INTR_PRIORITY_LVL_HIGH (1U)
#define SDL_ENABLE_ERR_PIN (1U)
#define SDL_INJECT_PARITY (0x01u)
#define SDL_DSS_DSP_L2RAM_PARITY_ERR_STATUS_VB1 (0x06020074u)
#define SDL_INITIAL_VALUE (0x11u)
ESM callback function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
DebugP_log(
"\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
if(esmInstType == 1u){
DebugP_log(
"\r\nHigh Priority Interrupt Executed\r\n");
}
else{
DebugP_log(
"\r\nLow Priority Interrupt Executed\r\n");
}
SDL_REG32_WR(SDL_DSS_DSP_L2RAM_PARITY_CTRL, SDL_ECC_DSS_L2RAM_PARITY_ERROR_CLEAR);
DebugP_log(
"\r\nclearing DSS_CTRL.DSS_DSP_L2RAM_PARITY_CTRL.DSS_DSP_L2RAM_PARITY_CTRL_ENABLE\r\n");
esmError = true;
return 0;
}
Event BitMap for Parity ESM callback for DSS L2 RAM
{
{
.errorNumber = SDL_DSS_ESMG1_DSS_DSP_L2_PARITY_ERR_VB0_EVEN,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
};
Enable the parity
SDL_REG32_WR(SDL_DSS_DSP_L2RAM_PARITY_CTRL, SDL_ECC_DSS_L2RAM_PARITY_ENABLE);
DSS L2 parity init*/
SDL_ECC_dss_l2_parity_init();
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_DSS_ESM, &Parity_TestparamsDSS[counter],NULL,NULL);
On a parity error from a particular bank, reading the register DSS_CTRL.DSS_DSP_L2RAM_PARITY_ERR_STATUS_VBx gives the address location
injectErrAdd =
SDL_REG32_RD(SDL_DSS_DSP_L2RAM_PARITY_ERR_STATUS_VB1);
DSS L2 parity error inject
SDL_ECC_dss_l2_parity_errorInject(SDL_INJECT_PARITY, injectErrAdd, SDL_INITIAL_VALUE);
Waiting for ESM Interrupt
do
{
timeOutCnt += 1;
if (timeOutCnt > maxTimeOutMilliSeconds)
{
result = SDL_EFAIL;
break;
}
} while (esmError == false);
Example Usage of DSS L1 Parity
Include the below file to access the APIs
Below are the macros specifies the ESM init and DSS DSP L1 parity registers used to inject parity error
#define SDL_ESM_MAX_DSS_EXAMPLE_AGGR (1u)
#define SDL_INTR_GROUP_NUM (1U)
#define SDL_INTR_PRIORITY_LVL_LOW (0U)
#define SDL_INTR_PRIORITY_LVL_HIGH (1U)
#define SDL_ENABLE_ERR_PIN (1U)
#define SDL_SEC (0x01u)
#define SDL_DSS_L2_ORIGIN (0x00800000u)
#define SDL_DSS_L1P_ORIGIN (0x00E00000U)
#define SDL_DSS_INTH_INT_ID_IDMAINT1 (14)
#define SDL_DSS_ICFGF_L1PCFG (0x01840020U)
#define SDL_DSS_ICFGF_L1DCFG (0x01840040U)
ESM Callback Function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
printf("\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
printf(" \r\nTake action \r\n");
if(esmInstType == 1u){
printf("\r\nHigh Priority Interrupt Executed\r\n");
}
else{
printf("\r\nLow Priority Interrupt Executed\r\n");
}
esmError = true;
return 0;
}
IDMA Callback Function
int32_t SDL_IDMA1_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
idmaTransferComplete = true;
return 0;
}
Event BitMap for ESM callback for DSP L1 Parity Errors
{
{
.errorNumber = SDL_DSS_ESMG1_DSS_DSP_L1P_PARITY,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
};
Dummy Function
#pragma CODE_SECTION(EDC_dummyFunction, ".func");
int32_t EDC_dummyFunction(void)
{
int32_t a = 0;
int32_t b = 4;
int32_t i;
for (i = 0; i <= 3; i++)
{
b = b + 7;
a = a + b;
}
return a;
}
Disable the L1P and L1D Cache
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_DSS_ESM, &Parity_TestparamsDSS[counter],NULL,NULL);
Configuring the IDMA
intrParams.callbackArg = (uintptr_t)SDL_ESM_INST_DSS_ESM;
intrParams.intNum = SDL_DSS_INTH_INT_ID_IDMAINT1;
Enable L1P EDC command
retVal = SDL_ECC_dss_l1p_edc_CMD_EN();
IDMA transfer
SDL_ECC_IDMA1_transfer(SDL_DSS_L2_ORIGIN, SDL_DSS_L1P_ORIGIN);
Call Dummy function
Suspend L1P EDC command
retVal = SDL_ECC_dss_l1p_CMD_SUSP();
Read and Toggle single bit
rd_data = rd_data ^ SDL_SEC;
IDMA transfer
SDL_ECC_IDMA1_transfer(SDL_DSS_L2_ORIGIN, SDL_DSS_L1P_ORIGIN);
Enable L1P EDC command
retVal = SDL_ECC_dss_l1p_edc_CMD_EN();
IDMA transfer
SDL_ECC_IDMA1_transfer(SDL_DSS_L2_ORIGIN, SDL_DSS_L1P_ORIGIN);
Waiting for ESM Interrupt
do
{
timeOutCnt += 1;
if (timeOutCnt > maxTimeOutMilliSeconds)
{
result = SDL_EFAIL;
break;
}
} while (esmError == false);
Example Usage of DSS L2 EDC
Include the below file to access the APIs
Below are the macros specifies the ESM init and DSS DSP L1 parity registers used to inject parity error
#define SDL_ESM_MAX_DSS_EXAMPLE_AGGR (2u)
#define SDL_INTR_GROUP_NUM (1U)
#define SDL_INTR_PRIORITY_LVL_LOW (0U)
#define SDL_INTR_PRIORITY_LVL_HIGH (1U)
#define SDL_ENABLE_ERR_PIN (1U)
#define SDL_EDC_SEC (0x01u)
#define SDL_EDC_DED (0x03u)
#define SDL_DSS_L2_ORIGIN (0x00800000u)
#define SDL_DSS_INTH_INT_ID_IDMAINT1 (14)
#define SDL_DSS_ICFGF_L1PCFG (0x01840020U)
#define SDL_DSS_ICFGF_L1DCFG (0x01840040U)
ESM Callback Function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
printf("\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
printf(" \r\nTake action \r\n");
if(esmInstType == 1u){
printf("\r\nHigh Priority Interrupt Executed\r\n");
}
else{
printf("\r\nLow Priority Interrupt Executed\r\n");
}
esmError = true;
return 0;
}
IDMA Callback Function
int32_t SDL_IDMA1_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
printf("\r\nIDMA1 call back function called. \r\n");
idmaTransferComplete = true;
return 0;
}
Event BitMap for ESM callback for DSP EDC Errors
{
{
.errorNumber = SDL_DSS_ESMG1_DSS_DSP_L2_SEC_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.errorNumber = SDL_DSS_ESMG1_DSS_DSP_L2_DED_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_HIGH,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
};
Dummy Function
#pragma CODE_SECTION(EDC_dummyFunction, ".func");
int32_t EDC_dummyFunction(void)
{
int32_t a = 0;
int32_t b = 4;
int32_t i;
for (i = 0; i <= 3; i++)
{
b = b + 7;
a = a + b;
}
return a;
}
Disable the L1P and L1D Cache
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_DSS_ESM, &Parity_TestparamsDSS[counter],NULL,NULL);
Configuring the IDMA
intrParams.callbackArg = (uintptr_t)SDL_ESM_INST_DSS_ESM;
intrParams.intNum = SDL_DSS_INTH_INT_ID_IDMAINT1;
Enable L2 EDC command
retVal = SDL_ECC_dss_l2_edc_CMD_EN();
IDMA transfer
SDL_ECC_IDMA1_transfer(SDL_DSS_L2_ORIGIN, SDL_DSS_L2_ORIGIN);
Call Dummy function
Suspend L2 EDC command
retVal = SDL_ECC_dss_l2_CMD_SUSP();
Read and Toggle single bit
rd_data = rd_data ^ SDL_SEC;
Read and Toggle double bit
rd_data = rd_data ^ SDL_EDC_DED;
Enable L2 EDC command
retVal = SDL_ECC_dss_l2_edc_CMD_EN();
Call Dummy function
Waiting for ESM Interrupt
do
{
timeOutCnt += 1;
if (timeOutCnt > maxTimeOutMilliSeconds)
{
result = SDL_EFAIL;
break;
}
} while (esmError == false);
Example Usage of DSS EDC Errors
Include the below file to access the APIs
Below are the macros specifies the ESM init and DSS DSP EDC registers used to inject EDC error
#define SDL_ESM_MAX_DSS_EXAMPLE_AGGR (2u)
#define SDL_INTR_GROUP_NUM (1U)
#define SDL_INTR_PRIORITY_LVL_LOW (0U)
#define SDL_INTR_PRIORITY_LVL_HIGH (1U)
#define SDL_ENABLE_ERR_PIN (1U)
#define SDL_DSS_ECC_NC_ITERRUPT_ID (111)
#define SDL_DSS_ECC_C_ITERRUPT_ID (112)
#define SDL_ENABLE_L1D_DATA_MASK_FLG (0x01u)
#define SDL_ENABLE_L1D_TAG_MASK_FLG (0x02u)
#define SDL_ENABLE_L2_TAG_MASK_FLG (0x04u)
#define SDL_ENABLE_L2_SNOP_MASK_FLG (0x08u)
#define SDL_ENABLE_L2_MPPA_MASK_FLG (0x10u)
#define SDL_ENABLE_L2_LRU_MASK_FLG (0x20u)
#define SDL_ENABLE_L1P_TAG_MASK_FLG (0x40u)
#define SDL_MEMORY_ENABLE SDL_ENABLE_L1D_DATA_MASK_FLG
ESM Callback Function
int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
DebugP_log(
"\r\nESM Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
SDL_REG32_WR(SDL_DSP_ICFG_EDCINTMASK, SDL_DSP_ICFG_DISABLE);
esmError = true;
return 0;
}
ECC DED Callback Function
int32_t SDL_ECC_DED_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
DebugP_log(
"\r\nECC DED Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
SDL_REG32_WR(SDL_DSP_ICFG_EDCINTMASK, SDL_DSP_ICFG_DISABLE);
esmError = true;
return 0;
}
ECC SEC Callback Function
int32_t SDL_ECC_SEC_applicationCallbackFunction(SDL_ESM_Inst esmInstType,
int32_t grpChannel,
int32_t intSrc,
void *arg)
{
DebugP_log(
"\r\nECC SEC Call back function called : instType 0x%x, " \
"grpChannel 0x%x, intSrc 0x%x \r\n",
esmInstType, grpChannel, intSrc);
SDL_REG32_WR(SDL_DSP_ICFG_EDCINTMASK, SDL_DSP_ICFG_DISABLE);
esmError = true;
return 0;
}
Event BitMap for ESM callback for DSP EDC Errors
{
{
.errorNumber = SDL_DSS_ESMG1_DSS_DSP_EDC_SEC_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_LOW,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
{
.errorNumber = SDL_DSS_ESMG1_DSS_DSP_EDC_DED_ERR,
.setIntrPriorityLvl = SDL_INTR_PRIORITY_LVL_HIGH,
.callBackFunction = &SDL_ESM_applicationCallbackFunction,
},
};
Initialize ESM module
result =
SDL_ESM_init(SDL_ESM_INST_DSS_ESM, &EDC_TestparamsDSS[counter],NULL,NULL);
Configuring the ESM
intrParams.callbackArg = (uintptr_t)SDL_ESM_INST_DSS_ESM;
Configuring the ECC DED interrupt, Register call back function for vector Config Interrupt and Enable the DED interrupt
intrParams.intNum = SDL_DSS_ECC_NC_ITERRUPT_ID;
Configuring the ECC SEC interrupt, Register call back function for vector Config Interrupt and Enable the SEC interrupt
intrParams.intNum = SDL_DSS_ECC_C_ITERRUPT_ID;
Write to DSP_ICFG__EDCINTMASK and DSP_ICFG__EDCINTFLG registers to enable and propagate an DSS DSP Memory
SDL_ECC_DSP_Aggregated_EDC_Errors(SDL_MEMORY_ENABLE);
Waiting for ESM Interrupt
do
{
timeOutCnt += 1;
if (timeOutCnt > maxTimeOutMilliSeconds)
{
result = SDL_EFAIL;
break;
}
} while (esmError == false);
Read MASK register value after ESM callback
Read FLG register value after ESM callback
API
APIs for SDL ECC (ECC_AGGR)