53.5.4.1 Acceptance Filtering

The MCAN offers the possibility to configure two sets of acceptance filters, one for standard identifiers and one for extended identifiers. These filters can be assigned to an Rx Buffer or to Rx FIFO 0,1. For acceptance filtering each list of filters is executed from element #0 until the first matching element. Acceptance filtering stops at the first matching element. The following filter elements are not evaluated for this message.

The main features are:

  • Each filter element can be configured as
    • range filter (from - to)
    • filter for one or two dedicated IDs
    • classic bit mask filter
  • Each filter element is configurable for acceptance or rejection filtering
  • Each filter element can be enabled / disabled individually
  • Filters are checked sequentially, execution stops with the first matching filter element

Related configuration registers are:

  • Global Filter Configuration (MCAN_GFC)
  • Standard ID Filter Configuration (MCAN_SIDFC)
  • Extended ID Filter Configuration (MCAN_XIDFC)
  • Extended ID and Mask (MCAN_XIDAM)

Depending on the configuration of the filter element (SFEC/EFEC) a match triggers one of the following actions:

  • Store received frame in FIFO 0 or FIFO 1
  • Store received frame in Rx Buffer
  • Store received frame in Rx Buffer and generate pulse at filter event pin
  • Reject received frame
  • Set High Priority Message interrupt flag (MCAN_IR.HPM)
  • Set High Priority Message interrupt flag (MCAN_IR.HPM) and store received frame in FIFO 0 or FIFO 1

Acceptance filtering is started after the complete identifier has been received. After acceptance filtering has completed, and if a matching Rx Buffer or Rx FIFO has been found, the Message Handler starts writing the received message data in portions of 32 bit to the matching Rx Buffer or Rx FIFO. If the CAN protocol controller has detected an error condition (for example, CRC error), this message is discarded with the following impact on the effected Rx Buffer or Rx FIFO:

  • Rx Buffer
New Data flag of matching Rx Buffer is not set, but Rx Buffer (partly) overwritten with received data. For error type, see MCAN_PSR.LEC and MCAN_PSR.DLEC.
  • 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.LEC and MCAN_PSR.DLEC. In case the matching Rx FIFO is operated in Overwrite mode, the boundary conditions described in Rx FIFO Overwrite Mode have to be considered.
Note: When an accepted message is written to one of the two Rx FIFOs, or into an Rx Buffer, the unmodified received identifier is stored independent of the filter(s) used. The result of the acceptance filter process is strongly depending on the sequence of configured filter elements.