Question
Help with FD-CAN filter
Hello,
I work with STM32G484, with FDCAN. I want to create filter so only messages with my own CAN_ID will reach HAL_FDCAN_RxFifo0Callback.
I started by define the filter:
filter.IdType = FDCAN_STANDARD_ID;
filter.FilterIndex = 0;
filter.FilterType = FDCAN_FILTER_MASK;
filter.FilterConfig = FDCAN_FILTER_TO_RXFIFO0;
filter.FilterID1 = CAN_ID;
filter.FilterID2 = 0x1FFFFFFF;
HAL_FDCAN_ConfigFilter(&hfdcan1, &filter);
At this point the filter not realy doing anything, and I still getting other nodes ID in the callback.
I tried to add a global filter with:
HAL_FDCAN_ConfigGlobalFilter(&hfdcan1, FDCAN_REJECT, FDCAN_REJECT, FDCAN_REJECT_REMOTE, FDCAN_REJECT_REMOTE);
HAL_FDCAN_ConfigGlobalFilter(&hfdcan1, FDCAN_REJECT, FDCAN_REJECT, FDCAN_REJECT_REMOTE, FDCAN_REJECT_REMOTE);
but now i reject also my own ID.
What I miss here? what is the correct way to define the filter?
Thanks in advance,
Amit Prigozin
Amit Prigozin
