Skip to main content
PSing.5
Associate II
October 22, 2021
Solved

Is it possible to not have a filter when receiving CAN messages?

  • October 22, 2021
  • 2 replies
  • 2158 views

Is it possible to not have a filter when receiving CAN messages? I want to create a gateway and transfer ALL messages from one CAN bus to another CAN bus. Do I just have to add 1000 messages to my list of allowed messages to ensure everything is accepted?

    This topic has been closed for replies.
    Best answer by Erwan YVIN

    Hello ,

    Assuming , you have a SPC560D device

    You should set your acceptance mask as 0xFFFFFFFF (Cf Below)

    Rx Global Mask (RXGMASK)

    RXGMASK is used as acceptance mask for all Rx MBs, excluding MBs 14–15, which have

    individual mask registers. When the FEN bit in MCR is set (FIFO enabled), the RXGMASK

    also applies to all elements of the ID filter table, except elements 6–7, which have individual

    masks.

    RX14MASK (Rx 14 Mask) and RX15MASK (Rx 15 Mask) have the same structure as the

    RXGMASK.

    For others devices , please refer to the corresponding RM.

    Best regards

    Erwan

    2 replies

    Erwan YVIN
    Erwan YVINBest answer
    ST Employee
    January 19, 2022

    Hello ,

    Assuming , you have a SPC560D device

    You should set your acceptance mask as 0xFFFFFFFF (Cf Below)

    Rx Global Mask (RXGMASK)

    RXGMASK is used as acceptance mask for all Rx MBs, excluding MBs 14–15, which have

    individual mask registers. When the FEN bit in MCR is set (FIFO enabled), the RXGMASK

    also applies to all elements of the ID filter table, except elements 6–7, which have individual

    masks.

    RX14MASK (Rx 14 Mask) and RX15MASK (Rx 15 Mask) have the same structure as the

    RXGMASK.

    For others devices , please refer to the corresponding RM.

    Best regards

    Erwan

    DCARR
    Visitor II
    March 21, 2022

    Hi,

    if your CAN controller is using the global mask, just write zero to the global mask value and every configured filter will accept all incoming frames identifiers (standard or extended on the base of filter configuration).

    To do this please find the RXGMASK initialization and modify it in order to give zero value.

    You should find something like this (maybe in function "can_lld_start" in file "can_lld.c"):

    canp->flexcan->RXGMASK.R = 0x0FFFFFFF;

    and replace it with --> canp->flexcan->RXGMASK.R = 0x00000000;

    Best regards

    Domenico