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.

AWR1642BOOST: Error detection capability of MCAN.

Part Number: AWR1642BOOST

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.

  • Hello Tulasikrishna,

    As I understand you would like to know the configurations that force an error (single bit or double bit) .

    You can try below configuration:
    errType = CANFD_MCANECCErrType_SEC (Single bit error)
    rowNum = 4U.
    bit1 = 4U
    errForce = 1U ->Force Error on any CAN message RAM read.
    errOnce = 1U

    For double bit error errType = CANFD_MCANECCErrType_DED and bit2 = 5

    You can call MCAN_eccForceError() with these params and if you have configuraed the interrupt, you will hit the ISR.

    Thanks,
    Raghu
  • Hi Raghu,

    we tried the above thing but so far we could not achieve it.please see below relevant code snippets.

    Also could you give more information on row and bit1. For all type of error injection row is 4 and bit1 is 4? Could you guide us relevant document for this.

    MCAN Init configuration:

    mcanCfgParams->eccConfig.enable         = 1;
     mcanCfgParams->eccConfig.enableChk      = 1;
     mcanCfgParams->eccConfig.enableRdModWr  = 1;


        mcanCfgParams->errInterruptEnable   = 1U;
        mcanCfgParams->dataInterruptEnable  = 1U;
        mcanCfgParams->appErrCallBack       = MCANAppErrStatusCallback;
        mcanCfgParams->appDataCallBack      = MCANAppCallback;

    Error configuration:

    uint32_t base_var;

    const CANFD_MCANECCErrForceParams eccerrors = {0,4,4,0,1,1}; /* single bit error,row4,bit1:4, bit2:0,errr once 1,error force 1

    int32_t mcanerrorTest()
    {
        CANFD_MCANMsgObjectStats    msgObjStats;
        CANFD_OptionTLV             optionTLV;
        int32_t retVal = 0;
        int32_t errCode = 0;

        MCAN_eccForceError(base_var, &eccerrors);                     /* Control is printing till this above line.It seems it is struck inside this function*/


        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);
        if (retVal < 0)
        {
                System_printf ("Error: CANFD get stats failed [Error code %d]\n", errCode);
                return -1;
        }
        return 1;
    }

    Expected ISR TO BE hit:

     

    static void CANFD_MCANInt1Isr (uintptr_t arg)
    {

       ..................

      /* Call the registered callback. */
        if (ptrCanFdMCB->appErrCallBack != NULL)
        {
            ptrCanFdMCB->appErrCallBack((CANFD_Handle)ptrCanFdMCB, CANFD_Reason_ECC_ERROR, &errStatusResp);    /* Expected to come here.but not coming*/
        }

    .............

    }

  • Hi,

    we are able to induce errors with some corrections.

    In continuation to above post ,we assigned base_var with MCAN base address ,enabled interrupt line 1.

    and eccerrors = {0,4,4,0,1,1} we are able to see bit1 error .

    Could you clarify more on row and bit1 values ? Any document on this would be useful.

    we want to induce all types of possible errors : STUFF,CRC ..etc

    Thanks,

    P Tulasi Krishna.

  • Tulasi Krishna,

    The details are available in the AWR1642 TRM .

    Thanks,

    Raghu