Hi,
we want to test MCAN for different error scenarios like form error,stuff error,bit error ..etc
In Test code we want to transmit 8 bytes of test data and inject force error and read mcan protocol status's last error code value as shown below.
we understand that the following parameter values need to be set to achieve this.
a)please clarify below enum values
b)Any Additional things needed before calling MCAN_eccForceError()? since in DCAN parity test,MSGRAM is corrupted by setting some RDA mode.Any such thing is needed before calling MCAN_eccForceError() with proper arguments?
code snippets:
typedef struct CANFD_MCANECCErrForceParams_t
{
/*! Error type to be forced
* Refer enum #CANFD_MCANECCErrType.
*/
uint32_t errType; --- clear
/*! Row address where error needs to be applied. */
uint32_t rowNum; -- How to know the supported values for this?
/*! Column/Data bit that needs to be flipped when
* force_sec or force_ded is set
*/
uint32_t bit1; -- How to know the supported values for this?
/*! Data bit that needs to be flipped when force_ded is set */
uint32_t bit2; -- How to know the supported values for this?
/*! Force Error once
* 1: The error will inject an error to the specified row only once
*/
uint32_t errOnce; -- clear,probably we will pass value 1
/*! Force error on the next RAM read */
uint32_t errForce; -- supported values?
}CANFD_MCANECCErrForceParams;
TEST code:
MCAN_eccForceError();
MCAN_Errortest();
int32_t MCAN_Errortest()
{
CANFD_MCANMsgObjectStats msgObjStats;
CANFD_OptionTLV optionTLV;
int32_t retVal = 0;
int32_t errCode = 0;
msgObjStats.handle = rxMsgObjHandle;
optionTLV.type = CANFD_Option_MCAN_PROTOCOL_STATUS;
optionTLV.length = sizeof(CANFD_MCANProtocolStatus);
optionTLV.value = (void*) &msgObjStats;
retVal = CANFD_getOptions(canHandle, &optionTLV, &errCode);
print CANFD_MCANProtocolStatus ->lastErrCode ;
return 1;
}
Thanks,
P Tulasi Krishna.