Hello NXP Expert,
I want use flexcan fifo( id filter with format c ) receive can message,I set id filter in the following code:
uint32_t rxFifoFilter[] = {FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_HIGH(0x433) | \
FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_HIGH(0x512) | \
FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_LOW(0x654) | \
FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_LOW(0x332) \
};
flexcan_rx_fifo_config_t rxFifoConfig;
rxFifoConfig.idFilterTable = rxFifoFilter;
rxFifoConfig.idFilterType = kFLEXCAN_RxFifoFilterTypeC;
rxFifoConfig.idFilterNum = sizeof(rxFifoFilter) / sizeof(rxFifoFilter[0]);
rxFifoConfig.priority = kFLEXCAN_RxFifoPrioHigh;
FLEXCAN_SetRxFifoConfig(FLEXCAN1, &rxFifoConfig, true);
I think the CAN message ID I received should be 0x430~0x437, 0x510~0x517, 0x650~0x657,0x330~0x337, but the CAN Message ID I received is out of this range(0x30~0x37, 0x1F8~0x1FF, 0x230~0x237, 0x330~0x337, 0x3F8~0x3FF, 0x430~0x437, 0x510~0x517, 0x5F8~0x5FF, 0x630~0x637, 0x650~0x657, 0x7F8~0x7FF),
Why did I receive an out-of-range ID?
Can you tell me how Fifo with ID Filter format C matches received ids?
What should I do if I want to use Fifo ID filters together with individmasks?
Thanks
Sophie
Solved! Go to Solution.
I can't see from your code whether you have set the mask, and I didn't find some functions in the standard library, such as FLEXCAN_SetRxFifoConfig().
I can provide you with an example code for your reference ,but this will take a while, I need some time to test it.
BR!
Jim,
Can you try to set only one filter table then test it again, and attach the result.
it is inconvenient to calculate whether the mask setting is correct
I will send you a reference document by private message, you can take a look at the Chapter 3.2
BR!
Jim,
Hi Jim,
Thank you.
I have changed rxFifoFilter to the following code:
uint32_t rxFifoFilter[] = {FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_HIGH(0x433) | \
FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_HIGH(0x433) | \
FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_LOW(0x433) | \
FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_LOW(0x433)};
All ID filters are set to 0x433, It has not set RX FIFO Global Mask and individmasks.Theoretically, I should have received ids in the range 0x430 to 0x437, but this was not the case, I received ids as follows:
0x30~0x37, 0x1F8~0x1FF, 0x230~0x237, 0x3F8~0x3FF, 0x430~0x437, 0x5F8~0x5FF, 0x630~0x637, 0x7F8~0x7FF
I can't find any regularity.
I can't see from your code whether you have set the mask, and I didn't find some functions in the standard library, such as FLEXCAN_SetRxFifoConfig().
I can provide you with an example code for your reference ,but this will take a while, I need some time to test it.
BR!
Jim,