Programming Standard Message ID CAN Filters

If space is reserved for Standard Message ID CAN filters in device tree node, then standard filters can be configured using following sys interface:

/sys/devices/c310000.mttcan/net/can0/std_filter
  • Enter echo help(h) to the sys interface to obtain the format for the parameters to be provided in dmesg.
    #echo h > /sys/devices/c310000.mttcan/net/can0/std_filter
    [248701.702670] net can0: Invalid std filter
    [248701.706670] usage:sft=0..3 sfec=0..7 sfid1=ID1h sfid2=ID2h idx=i

    Where:

    • The sfid1 and sfid2 are in HEX.
    • The sft, sfec, and idx are in unsinged integers.
    • The idx field is optional.
    • If index is provided, then the given index filter is updated; otherwise the filters are assigned incrementally.

    For example:

    echo "sft=0 sfec=2 sfid=0x7 sfid2=0x21 idx=0" > /sys/devices/c310000.mttcan/net/can0/std_filter