CAN Communication: Multiple Filters At Once
Hello,
I am trying to work with the CAN filters and I am experimenting with various techniques. One thing I would like to do is have more than one filter on the same bus. For example, I would like to have the following message IDs be possible:
0x10 and 0x20
AND
0x111 to 0x555
So I would like to do two filters:
sFilterConfig.IdType = FDCAN_STANDARD_ID;
sFilterConfig.FilterIndex = 0;
sFilterConfig.FilterType = FDCAN_FILTER_DUAL;
sFilterConfig.FilterConfig = FDCAN_FILTER_TO_RXBUFFER;
sFilterConfig.FilterID1 = 0x10;
sFilterConfig.FilterID2 = 0x20;
sFilterConfig.RxBufferIndex = 0;
HAL_FDCAN_ConfigFilter(&hfdcan, &sFilterConfig);
sFilterConfig.IdType = FDCAN_STANDARD_ID;
sFilterConfig.FilterIndex = 0;
sFilterConfig.FilterType = FDCAN_FILTER_RANGE;
sFilterConfig.FilterConfig = FDCAN_FILTER_TO_RXBUFFER;
sFilterConfig.FilterID1 = 0x111;
sFilterConfig.FilterID2 = 0x555;
sFilterConfig.RxBufferIndex = 0;
HAL_FDCAN_ConfigFilter(&hfdcan, &sFilterConfig);
I know the code above would not work since the second configuration would overwrite the first. I would like to know what I have to do to make what I explained above possible.
For my testing, I am using an STM32H7B3I-EVAL board.
