2025-04-01 9:22 AM - last edited on 2025-04-01 10:47 AM by Peter BENSCH
Hi !
We are using an SR5E1E7 with StellarStudio. But we are struggling with CAN filters.
How to setup the CAN device so it can accept any CAN-ID? Or better, how mask work for the CAN Filters ?
We are using CanOpen and we can't really set every ID we want by hand.
Any info is welcome, whether from StellarStudio configuration or C code using `can_set_filter`.
Currently we only made it to work with one ID:
Could you give an example on how to setup filters for:
- Allowing all ID's
- Allowing all ID's from a mask
Thanks in advance !
Sacha
Solved! Go to Solution.
2025-04-02 1:41 AM
Hi !
It seems to work by using the RX FIFO, Does the CAN MASK is this supposed to work using the DEDICATED BUFFER ?
Using theses filters to enables all ID's (0 is the mask to allow every id's):
`can_set_filter(&can, 0x7FF, 0, CAN_STD_FILTER_TYPE, CAN_FILTER_CLASSIC, CAN_FEC_FIFO0)`
`can_set_filter(&can, 0x1FFFFFF, 0, CAN_XTD_FILTER_TYPE, CAN_FILTER_CLASSIC, CAN_FEC_FIFO0)`
And enabling FIFO buffers:
Sacha
2025-04-02 1:41 AM
Hi !
It seems to work by using the RX FIFO, Does the CAN MASK is this supposed to work using the DEDICATED BUFFER ?
Using theses filters to enables all ID's (0 is the mask to allow every id's):
`can_set_filter(&can, 0x7FF, 0, CAN_STD_FILTER_TYPE, CAN_FILTER_CLASSIC, CAN_FEC_FIFO0)`
`can_set_filter(&can, 0x1FFFFFF, 0, CAN_XTD_FILTER_TYPE, CAN_FILTER_CLASSIC, CAN_FEC_FIFO0)`
And enabling FIFO buffers:
Sacha