Hello,
In order to achieve your requirements you could use classical message buffers (MBs) or the Rx FIFO.
For the classical MBs, you can set a fixed ID using FLEXCAN_DRV_ConfigRxMb function, which means that the respective MB will only receive frames that match the configured ID. There is also an option to mask the configured ID, which allows frames with IDs that respect a pattern to be received in the same MB. This mask can be global (it applies to all configured MBs) or individual (it only applies to a single MB).
- FLEXCAN_DRV_SetRxMaskType - chooses between individual and global masks
- FLEXCAN_DRV_SetRxMbGlobalMask - sets the global mask (except for MB14 and MB15)
- FLEXCAN_DRV_SetRxIndividualMask - sets the individual mask
- FLEXCAN_DRV_SetRxMb14Mask / FLEXCAN_DRV_SetRxMb15Mask - sets the mask for MB14 / MB15
The RxFIFO uses ID filter tables as acceptance criteria for the incoming frames. These filters have 4 formats:
- format A: one full ID (standard or extended) per ID Filter Table element
- format B: two full standard IDs or two partial 14-bit (standard or extended) IDs per ID Filter Table element
- format C: four partial 8-bit Standard IDs per ID Filter Table element
- format D: all frames rejected
Individual masks can be set for a number of N elements from the ID filter table using FLEXCAN_DRV_SetRxIndividualMask. For all the others, only a global mask can be set using FLEXCAN_DRV_SetRxFifoGlobalMask. N = the total number of MBs available for the respective CAN instance.
There is a known bug for the format B and C which results in a wrong matching between the configured ID and the incoming ID. It will be fixed in the next SDK release.
Please let me know if you need more information.
Best regards,
Ana