False Positive Acceptance with CAN Rx FIFO?

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

False Positive Acceptance with CAN Rx FIFO?

Jump to solution
1,694 Views
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

1 Solution
1,433 Views
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

View solution in original post

2 Replies
1,434 Views
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,433 Views
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 Kudos
Reply