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.

RTOS/AWR1642: How to receive multi-ID using MCAN?

Part Number: AWR1642

Tool/software: TI-RTOS

I see the SWRU520A.

In page.2072, it says Range filter from EFID1 to EFID2(EFID2>EFID1) when EFT = 0x0.

I see the CANFD_createMsgObject of canfd.c(Line:835).And change to below:

extMsgIdFilter.efid1 = ptrCanMsgObj->msgId & XTD_MSGID_MASK;
extMsgIdFilter.efid2 = ( ptrCanMsgObj->msgId + 0xFFFF ) & XTD_MSGID_MASK;
extMsgIdFilter.efec = 0x7U;
extMsgIdFilter.eft = 0;
MCAN_addExtMsgIDFilter(baseAddr, i, &extMsgIdFilter);

But it's error.

Regards,

Jui Yang

  • Please provide us more information about sw versions used

    thank you
    Cesar
  • Hi Cesar,

    I use the CANFD with SDK1.1.0.2

    This is my config:

    mcanCfgParams->fdMode = 0x1U;
    mcanCfgParams->brsEnable = 0x1U;
    mcanCfgParams->txpEnable = 0x0U;
    mcanCfgParams->efbi = 0x0U;
    mcanCfgParams->pxhddisable = 0x0U;
    mcanCfgParams->darEnable = 0x0U;
    mcanCfgParams->wkupReqEnable = 0x1U;
    mcanCfgParams->autoWkupEnable = 0x1U;
    mcanCfgParams->emulationEnable = 0x0U;
    mcanCfgParams->emulationFAck = 0x0U;
    mcanCfgParams->clkStopFAck = 0x0U;
    mcanCfgParams->wdcPreload = 0x0U;
    mcanCfgParams->tdcEnable = 0x1U;
    mcanCfgParams->tdcConfig.tdcf = 0U;
    mcanCfgParams->tdcConfig.tdco = 8U; //For 5Mhz
    mcanCfgParams->monEnable = 0x0U;
    mcanCfgParams->asmEnable = 0x0U;
    mcanCfgParams->tsPrescalar = 0x0U;
    mcanCfgParams->tsSelect = 0x0U;
    mcanCfgParams->timeoutSelect = CANFD_MCANTimeOutSelect_CONT;
    mcanCfgParams->timeoutPreload = 0x0U;
    mcanCfgParams->timeoutCntEnable= 0x0U;
    mcanCfgParams->filterConfig.rrfe = 0x1U;
    mcanCfgParams->filterConfig.rrfs = 0x1U;
    mcanCfgParams->filterConfig.anfe = 0x1U;
    mcanCfgParams->filterConfig.anfs = 0x1U;
    mcanCfgParams->msgRAMConfig.lss = 127U;
    mcanCfgParams->msgRAMConfig.lse = 64U;
    mcanCfgParams->msgRAMConfig.txBufNum = 32U;
    mcanCfgParams->msgRAMConfig.txFIFOSize = 0U;
    mcanCfgParams->msgRAMConfig.txBufMode = 0U;
    mcanCfgParams->msgRAMConfig.txEventFIFOSize = 0U;
    mcanCfgParams->msgRAMConfig.txEventFIFOWaterMark = 0U;
    mcanCfgParams->msgRAMConfig.rxFIFO0size = 0U;
    mcanCfgParams->msgRAMConfig.rxFIFO0OpMode = 0U;
    mcanCfgParams->msgRAMConfig.rxFIFO0waterMark = 0U;
    mcanCfgParams->msgRAMConfig.rxFIFO1size = 64U;
    mcanCfgParams->msgRAMConfig.rxFIFO1waterMark = 64U;
    mcanCfgParams->msgRAMConfig.rxFIFO1OpMode = 64U;
    mcanCfgParams->eccConfig.enable = 1;
    mcanCfgParams->eccConfig.enableChk = 1;
    mcanCfgParams->eccConfig.enableRdModWr = 1;
    mcanCfgParams->errInterruptEnable = 1U;
    mcanCfgParams->dataInterruptEnable = 1U;
    mcanCfgParams->appErrCallBack = MCANAppErrStatusCallback;
    mcanCfgParams->appDataCallBack = MCANAppCallback;

    I want to use Range filter for Identifier of rx.

    Regards,

    Jui Yang

  • Jui Yang,

    The issue is in setting the "extMsgIdFilter.efec = 0x7U". If you set the EFEC :0x07, then the configuration of the "EFT[1:0]" is ignored . You cannot use the buffer to store the range filtered messages.

    You can set the EFEC so that the received message is stored in the FIFO.

    Please make the changes to EFEC to resolve your issue.

    Thanks,
    Raghu
  • Hi Raghu,

    I try change extMsgIdFilter.efec =0x2U.
    But the CAN-FD can't receive message when ID=(msgId) or =(msgId+0x100) .
    Do other lines need to change?

    Regards,
    Jui Yang
  • Hello JuiYang,

    Could you please post all the code changes done by you in this thread? I would like to review your changes once.

    Thanks,

    Raghu

  • Hi,

    This is my change below:

    In main.c, change mcanCfgParams->msgRAMConfig.rxFIFO0sizemcanCfgParams->msgRAMConfig.rxFIFO0OpMode and mcanCfgParams->msgRAMConfig.rxFIFO0waterMark .

    In canfd.c, change extMsgIdFilter.efid2, extMsgIdFilter.efec and extMsgIdFilter.eft .

    Regards,

    Jui Yang

  • Hello Jui Yang,

    I did check the changes and see that the "Range filter " does not seem to be working. Will debug this further and provide you the solution asap.

    Thanks for your patience.

    -Raghu
  • hi,
    Do you have a solution?
    Thanks
    -Yaowei
  • hi,
    Do you solve this problem?
    I had the same problem,but i recive the message as the standard message
    Thanks,