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
Solved! Go to Solution.
Hi,
mask within a RXFGMASK should be shifted left by 1 bit as you can see from Table 53-7
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
Hi,
mask within a RXFGMASK should be shifted left by 1 bit as you can see from Table 53-7
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
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