The MCAN module is capable to configure two sets of acceptance filters - one set for standard and one set for extended identifiers. These filters can be assigned to an Rx Buffer or to one of the two Rx FIFOs.
The main features of the filter elements are:
- Each filter element can be configured as:
- Range Filter (from - to)
- Filter for specific IDs (for one or two dedicated IDs)
- Classic Bit Mask Filter
- Each filter element can be enabled/disabled individually
- Each filter element can be configured for acceptance or rejection filtering
- Filters are checked sequentially and execution (acceptance filtering procedure) stops at the first matching filter element or when the end of the filter list is reached
Related configuration registers are:
- Global Filter Configuration (MCAN_GFC)
register
- Standard ID Filter Configuration (MCAN_SIDFC)
register
- Extended ID Filter Configuration (MCAN_XIDFC)
register
- Extended ID AND Mask (MCAN_XIDAM) register
Depending on the configuration of the filter element (see SFEC/EFEC in Section 12.4.4.4.10, Message RAM) if filter matches, one of the following actions is performed:
- Received frame is stored in FIFO 0 or FIFO 1
- Received frame is stored in Rx Buffer
- Received frame is stored in Rx Buffer and generation of pulse at filter event pin is performed. This is high level single ICLK pulse. For more information, see Section 12.4.4.4.2.1, DMA Requests.
- Received frame is rejected
- Set High Priority Message interrupt flag
MCAN_IR[8] HPM
- Set High Priority Message interrupt flag
MCAN_IR[8] HPM and store received frame in
FIFO 0
or FIFO 1
Acceptance filtering starts when complete Message ID is received. Acceptance filtering stops at the first matching enabled filter element or when the end of the filter list is reached. If a filter element matches - the Rx Handler starts writing the received message data in portions of 32 bit to the matching Rx Buffer or Rx FIFO. If an error condition occurs (for example: CRC error), this message is rejected with the following impact on the affected Rx Buffer or Rx FIFO:
- Rx Buffer:
New
Data flag (MCAN_NDAT1/MCAN_NDAT2) of matching Rx Buffer is not set, but Rx
Buffer (partly) overwritten with received data (for error type see MCAN_PSR[2-0]
LEC respectively MCAN_PSR[10-8] DLEC fields). - Rx FIFO:
Put index
of matching Rx FIFO is not updated, but related Rx FIFO element (partly)
overwritten with received data (for error type see MCAN_PSR[2-0] LEC
respectively MCAN_PSR[10-8] DLEC fields). If matching Rx FIFO is configured to
operate in overwrite mode, the boundary conditions described in Section 12.4.4.4.7.2.2 have to be considered.