How to configure CAN in MPC5746 to filter useless id frame

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to configure CAN in MPC5746 to filter useless id frame

811 Views
gaoxu
Contributor I

"Here's my code, but it doesn't filter messages"

while (FLEXCAN_DRV_Init(INST_CANCOM1, &canCom1_State, &canCom1_InitConfig0)!= STATUS_SUCCESS) ;
flexcan_id_table_t stfilter[] ={{0,0,0x111},{0,0,0x222},{0,0,0x333},{0,0,0x444},{0,0,0x555},{0,0,0x666},{0,0,0x777},{0,0,0x888}};
FLEXCAN_DRV_SetRxMaskType(0, FLEXCAN_RX_MASK_GLOBAL);
FLEXCAN_DRV_ConfigRxFifo(0,FLEXCAN_RX_FIFO_ID_FORMAT_B,stfilter);
FLEXCAN_DRV_SetRxFifoGlobalMask(0,FLEXCAN_MSG_ID_STD,0xffffffff);

Labels (1)
0 Kudos
4 Replies

617 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

which SDK version are you using? In RTM 1.0.0 the FLEXCAN_DRV_SetRxFifoGlobalMask() and similar functions was updated to reflect ID format too, however still the mask setting is not correct for format other that FORMAT_A.

BTW, for FORMAT_B you need 16 items in stfilter array to fill ID Table completely, assuming default 8 table elements.

BR, Petr 

0 Kudos

618 Views
gaoxu
Contributor I

hi

i used 1.0.0 SDK。I have modified the SDK api ,so the FORMAT_B also can be filtered.

fill all the id_filter mask bits ,the FORMAT_B can work 

0 Kudos

618 Views
gaoxu
Contributor I

这个问题我自己已经解决了,发现是sdk  api对于掩码配置有bug,导致的报文过滤不完全,所以出现过滤不好使,不要过分相信sdk !!!

0 Kudos

618 Views
gaoxu
Contributor I

这个问题我自己已经解决了,发现是sdk  api对于掩码配置有bug,导致的报文过滤不完全,所以出现过滤不好使,不要过分相信sdk !!!

0 Kudos