How to configure Flexcan to receive all can id messages

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to configure Flexcan to receive all can id messages

192 次查看
sandeepc
Contributor IV

Hi, community

 

Controller RT1170

I can able to transmit and receive through the configured CAN messages id's but i want to receive all incoming messages .

 

 

working For known CAN id :

status_t CANRxTxconfig(void)

{

/* Create FlexCAN handle structure and set call back function. */

FLEXCAN_TransferCreateHandle(STD_CAN_MODULE, &flexcanHandle, flexcan_callback, NULL);

 

/* Setup Rx Message Buffer. */

 

for(int index=0;index<NUM_OF_RX_MESSAGE;index++)

{

canrxtxconfig[index].rxIdentifier = rxIdentifier[index];

canrxtxconfig[index].rxframe.type= (uint8_t)kFLEXCAN_FrameTypeData;

canrxtxconfig[index].rxframe.length = (uint8_t)DLC;

canrxtxconfig[index].rxframe.format = (uint8_t)rxIdentifier_frametype[index];

 

canrxtxconfig[index].mbConfig.format = rxIdentifier_frametype[index];

canrxtxconfig[index].mbConfig.id = rxIdentifier_idtype[index];

canrxtxconfig[index].mbConfig.type = kFLEXCAN_FrameTypeData;

FLEXCAN_SetRxMbConfig(STD_CAN_MODULE, rx_msgbuff_no[index], &canrxtxconfig[index].mbConfig, true);

 

/* Start receive data through Rx Message Buffer. */

canrxtxconfig[index].rxXfer.mbIdx = (uint8_t)rx_msgbuff_no[index];

canrxtxconfig[index].rxXfer.frame = &canrxtxconfig[index].rxframe;

if(FLEXCAN_TransferReceiveNonBlocking(STD_CAN_MODULE, &flexcanHandle, &canrxtxconfig[index].rxXfer) != kStatus_Success)

{

return kStatus_FLEXCAN_RxBusy;

}

}

for(int index=0;index<NUM_OF_TX_MESSAGE;index++)

{

FLEXCAN_SetTxMbConfig(STD_CAN_MODULE, tx_msgbuff_no[index], true);

 

}

return kStatus_Success;

}

 

how can i receive data from all ECU CAN id's.?

@kerryzhou 

 

i tried as you mention in this link

https://community.nxp.com/t5/i-MX-Processors/About-CAN-RX-ID-filltering-with-RT1170-EVK/m-p/1780664#...

 

Regards,

Sandeep C

 

 

 

0 项奖励
回复
1 回复

177 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sandeepc ,

   Thanks for your interest in the NXP MIMXRT product, I would like to provide service for you.

  Thanks for your trust.

   If you want to use the flexcan receive all ID, you need to know, which one will prevent the CAN ID.

  It is the Receive MASK bits.

kerryzhou_0-1719282959334.png

If you set the related bit to 1, then it will check, whether your receved ID is matched to your set RX ID.

But, if you want ot receve all the ID, just as I mentioned in another post, you already mentioned.

You can set all the mask bit to 0 in your used mask registers, then you can receive all of it.

So, modify your RT1170 code, modify your mask register to 0, then test it again.

If you still have issues about it, please kindly let me know.

 

If your question is solved, please help me to mark the correct answer just to close this case.

Any new issues, welcome to create the new question post, thanks.

Best Regards,

Kerry

 

 

0 项奖励
回复