Skip to main content
CTapp.1
Senior III
July 14, 2026
Solved

FDCAN HAL API uses a confusing name

  • July 14, 2026
  • 2 replies
  • 52 views

The FDCAN_RxHeaderTypeDef typedef (for the STM32G4) includes:

uint32_t IsFilterMatchingFrame; /*!< Specifies whether the accepted frame did not match any Rx filter.
Acceptance of non-matching frames may be enabled via
HAL_FDCAN_ConfigGlobalFilter().
This parameter takes 0 if the frame matched an Rx filter or
1 if it did not match any Rx filter */

From the code, this member is loaded with the ANMF bit of an RX FIFO element. The documentation for this shows that ANMF is an abbreviation for “Accepted non-matching frame” - so the comment is correct (‘1’ → did not match a filter). Which means the member name should be something like ‘IsNotFilterMatchingFrame’.

Code completion within CubeIDE does not show the comment:

which means it is easy to get the state wrong if the name is interpreted semantically!

Probably not a lot that can be done about this now, but it’s one to watch out for.

Best answer by Saket_Om

Hello ​@CTapp.1 

Thank your feedback. You are absolutely right that the IsFilterMatchingFrame field name can be misleading with respect to the actual meaning of the ANMF bit. This point has been revisited in the newer HAL2 implementation (notably for STM32C5), where the naming/handling has been improved to reduce this ambiguity. However, for the existing STM32G4 HAL, we do not plan to change it, as doing so would introduce a compatibility break for existing user code.

2 replies

Saket_OmBest answer
ST Technical Moderator
July 15, 2026

Hello ​@CTapp.1 

Thank your feedback. You are absolutely right that the IsFilterMatchingFrame field name can be misleading with respect to the actual meaning of the ANMF bit. This point has been revisited in the newer HAL2 implementation (notably for STM32C5), where the naming/handling has been improved to reduce this ambiguity. However, for the existing STM32G4 HAL, we do not plan to change it, as doing so would introduce a compatibility break for existing user code.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
CTapp.1
CTapp.1Author
Senior III
July 15, 2026

Yeah, I though compatibility would be an issue ;-)

All posts are made in a personal capacity. MISRA C++ Chair, MISRA C WG Member, Director The MISRA Consortium Limited (TMCL)