False Positive Acceptance with CAN Rx FIFO?

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

False Positive Acceptance with CAN Rx FIFO?

跳至解决方案
1,592 次查看
gbrowne
Contributor II

Hello.

One of our QA engineers picked up on false positives in the CAN message acceptance today.

We set a FLEXCAN_MSG_ID_STD global mask to 0x7FF (i.e. exact match) using FLEXCAN_DRV_SetRxFifoGlobalMask() - I can verify that the value of CAN0->RXFGMASK is properly set to 0x1FFC0000.

Then the filter is set to 0x51C using FLEXCAN_DRV_ConfigRxFifo() with FLEXCAN_RX_FIFO_ID_FORMAT_A format.

However, messages with a CAN ID of 0x11C are being accepted using FLEXCAN_DRV_RxFifoBlocking().  So it looks like only part of the mask is working (potentially)...

Any ideas what I may be missing?

Thanks,

-Greg

标记 (2)
1 解答
1,331 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

mask within a RXFGMASK should be shifted left by 1 bit as you can see from Table 53-7

pastedImage_1.png

so, to have exact match you need to set RXFGMASK = 0x3FF80000.

Most probably the driver function does not shift the value properly.

With the RXFGMASK = 0x1FFC0000  the MSB of the ID is don't care, that's the reason you received ID 0x11C too.

BR, Petr

在原帖中查看解决方案

2 回复数
1,332 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

mask within a RXFGMASK should be shifted left by 1 bit as you can see from Table 53-7

pastedImage_1.png

so, to have exact match you need to set RXFGMASK = 0x3FF80000.

Most probably the driver function does not shift the value properly.

With the RXFGMASK = 0x1FFC0000  the MSB of the ID is don't care, that's the reason you received ID 0x11C too.

BR, Petr

1,331 次查看
gbrowne
Contributor II

Hi Petr.

Yes!  Looks like you nailed it - the FLEXCAN_HAL_SetRxFifoGlobalStdMask() and FLEXCAN_HAL_SetRxFifoGlobalExtMask() methods under the FLEXCAN_DRV_SetRxFifoGlobalMask() method are not implemented properly (shifting and masking).

Great catch.  Fixing that solved my issue - thanks a lot!

-Greg

0 项奖励
回复