cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter more than 16 CAN IDs in STM32U5 FDCAN hardware filters?

Furkan2
Associate II

Hello,

I am working on STM32U5G7VJT6 with FDCAN1 peripheral.
In CubeMX I configured 8 Extended Filters, and in my code I set them as dual filters. That gives me a total of 16 CAN IDs that can be allowed by hardware.

Now my application requires filtering of around 50 unique Extended IDs. Since the hardware allows only 8 filters (dual = 16 IDs), I am not sure how to configure this efficiently for 50 IDs.

My questions are

  1. Is there a way to extend the number of hardware filters beyond 8 (e.g., using extended, or any advanced setting)?

  2. If not, what is the recommended approach for applications needing more than 16 IDs? Should I:

    • Use a broader mask in hardware filters (to accept a group of IDs), and then filter the exact IDs in software?

    • Or is there another technique for optimizing FDCAN filters for larger ID sets?

Any suggestions or example implementations would be really helpful.

Thanks in advance!

1 REPLY 1
mƎALLEm
ST Employee

Hello,

First, in next time please don't post screenshots for your code, but copy paste it in the discussion using </> button.

Second, Try to find a common bits having the same values between these IDs and use Mask ID instead. That will decrease considerably the number of filters used.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.