cancel
Showing results for 
Search instead for 
Did you mean: 

[H723]Is it possible to allow only 10 IDs with the CANFD filter type?

june
Associate III

H723ZGT6 Nucleo-144

CubeMX 6.3.0

[ data sheet ]

   H723: DS13313 Rev2

[NOR Flash]

   S25FL256L

[Reference manual]

   H723: RM0488 Rev2

   S25FL256L: 002-00124 Rev. * H

I'm currently doing a CANFD loopback test.

I want to use a filter so that I can communicate with only 10 types of IDs.

However, I feel that the following four types cannot be achieved.

[stm32h7xx_hal_fdcan.h(1021)]​

sFilterConfig.FilterType =

  1. FDCAN_FILTER_RANGE;
  2. FDCAN_FILTER_DUAL;
  3. FDCAN_FILTER_MASK;
  4. FDCAN_FILTER_RANGE_NO_EIDM;

The IDs I wanted to allow in the filter were not consecutive numbers.

for example [0x111, 0x122, 0x069, 0x013, 0x0A0, 0x090, 0x055, 0x0AA, 0x101, 0x003]

So I thought about using multiple FILTER_DUAL, but neither was successful.

 /* Configure Rx filter 1 */

 sFilterConfig.IdType = FDCAN_STANDARD_ID;

 sFilterConfig.FilterIndex = 0;

 sFilterConfig.FilterType = FDCAN_FILTER_DUAL;

 sFilterConfig.FilterConfig = FDCAN_FILTER_TO_RXFIFO0;

 sFilterConfig.FilterID1 = 0x111;

 sFilterConfig.FilterID2 = 0x7FF; 

HAL_FDCAN_ConfigFilter(&hfdcan, &sFilterConfig);

 /* Configure Rx filter 2 */

 sFilterConfig.IdType = FDCAN_STANDARD_ID;

 sFilterConfig.FilterIndex = 1;

 sFilterConfig.FilterType = FDCAN_FILTER_DUAL;

 sFilterConfig.FilterConfig = FDCAN_FILTER_TO_RXFIFO0;

 sFilterConfig.FilterID1 = 0x122;

 sFilterConfig.FilterID2 = 0x7FF; 

HAL_FDCAN_ConfigFilter(&hfdcan, &sFilterConfig);

  1. Do the indexes match in the sense that they specify the number of filters to initialize? ( I don't really understand this filter index either...)
  2. Is it possible to allow 10 different IDs using the filter function here?
1 ACCEPTED SOLUTION

Accepted Solutions
june
Associate III

solved.

It seems that the number of standard filters was not set correctly at the time of initialization.

 hfdcan.Init.StdFiltersNbr = 0; // before

 hfdcan.Init.StdFiltersNbr = 10; // after​0693W00000JMnNxQAL.pngShould have calmed down

View solution in original post

1 REPLY 1
june
Associate III

solved.

It seems that the number of standard filters was not set correctly at the time of initialization.

 hfdcan.Init.StdFiltersNbr = 0; // before

 hfdcan.Init.StdFiltersNbr = 10; // after​0693W00000JMnNxQAL.pngShould have calmed down