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.

AWR1642: How to enable CANFD FIFO mode data receiver

Part Number: AWR1642


Hi champion,
     My customer want to use Rx FIFO mode for CANFD message object to receive message. I see in mmwave sdk 3.5.0.4 Canfd.c
In CANFD_createMsgObject, we set Rx object as buffer mode by default.
CANFD_MsgObjHandle CANFD_createMsgObject(CANFD_Handle handle, const CANFD_MCANMsgObjCfgParams* msgObjectParams, int32_t* errCode)
{......

else
{
/* Store the rx to message object handle mapping */
ptrCanFdMCB->rxMapping[i] = ptrCanMsgObj;
ptrCanMsgObj->rxElement = i;

/* Store the message RAM memory access type */
ptrCanMsgObj->memType = MCAN_MemType_BUF;

/* Add the filter to message RAM */
if (ptrCanMsgObj->msgIdType == CANFD_MCANXidType_11_BIT)
{
stdMsgIdFilter.sfid1 = ptrCanMsgObj->startMsgId & STD_MSGID_MASK;
stdMsgIdFilter.sfid2 = i;

/* Store the message in rx buffer */
stdMsgIdFilter.sfec = 0x7U;
stdMsgIdFilter.sft = 0;
MCAN_addStdMsgIDFilter(baseAddr, i, &stdMsgIdFilter);
}

I also found there is a CANFD_processFIFOElements in Canfd.c, but don't know how to use it. May I get your help to see how to switch the Rx object mode to FIFO?

Thanks,
Adam

     
     

  • Hi Adam,

    I see CANFD test application where dataInterruptEnable is being set

    ti\drivers\canfd\test\xwr18xx\main.c --> MCANAppInitParams()

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

    I see that 

        mcanCfgParams->msgRAMConfig.rxFIFO0size             = 64U;  //this should enable RX FIFO mode.

    And in the driver, based on dataInterruptEnable, it sets the CANFD_MCANInt0Isr ISR callback where it calls CANFD_processFIFOElements if it gets MCAN_INTR_SRC_RX_FIFO0_NEW_MSG itnerrupt.

  • Hi Jitendra,
        I think in CANFD_createMsgObject, we set SFEC to 0x7 which implies the receiver message will be store in Rx buffer. If we want to store message in FIFO, we need set SFEC to either 0x5 (FIFO 0) or 0x6 (FIFO 1) instead.
        I think there are also other modifications needed to receive message in FIFO mode. Could you check with the design engineer?

    CANFD_MsgObjHandle CANFD_createMsgObject(CANFD_Handle handle, const CANFD_MCANMsgObjCfgParams* msgObjectParams, int32_t* errCode)
    {......

    else
    {
    /* Store the rx to message object handle mapping */
    ptrCanFdMCB->rxMapping[i] = ptrCanMsgObj;
    ptrCanMsgObj->rxElement = i;

    /* Store the message RAM memory access type */
    ptrCanMsgObj->memType = MCAN_MemType_BUF;

    /* Add the filter to message RAM */
    if (ptrCanMsgObj->msgIdType == CANFD_MCANXidType_11_BIT)
    {
    stdMsgIdFilter.sfid1 = ptrCanMsgObj->startMsgId & STD_MSGID_MASK;
    stdMsgIdFilter.sfid2 = i;

    /* Store the message in rx buffer */
    stdMsgIdFilter.sfec = 0x7U;
    stdMsgIdFilter.sft = 0;
    MCAN_addStdMsgIDFilter(baseAddr, i, &stdMsgIdFilter);
    }

    Thanks,
    Adam

  • Looks like this particular sequence is not being tested from SDK team.

    I need to check this with Design team