HAL GPIO assert fails for GPIO_AF3_TIM10 on STM32F4 devices
Description
Hello,
I am using STM32F411RET and STM32F407ZGT microcontrollers.
Using STM32CubeMX, I configure a PWM output on GPIOB Pin 8 using TIM10 Channel 1.
After code generation, the following GPIO initialization code is produced:
GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF3_TIM10;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
The PWM output works correctly on hardware.
However, when full assertions are enabled by defining USE_FULL_ASSERT, an assertion failure occurs inside HAL_GPIO_Init() at the following check:
assert_param(IS_GPIO_AF(GPIO_Init->Alternate));
After inspecting the IS_GPIO_AF() macro for STM32F4 devices, I noticed that GPIO_AF3_TIM10 is not included in the list of valid alternate functions, even though TIM10 uses AF3 on STM32F4 devices and is correctly generated by STM32CubeMX.
This causes a false assertion failure when using a valid and supported peripheral configuration.
Expected behavior
GPIO_AF3_TIM10 should be included in the IS_GPIO_AF() validation macro for STM32F4 devices (e.g. STM32F407 / STM32F411), or the assertion logic should be updated to avoid rejecting valid alternate functions generated by CubeMX.
Additional notes
The issue occurs only when USE_FULL_ASSERT is enabled.
The generated code and hardware configuration are otherwise correct.
Disabling full assertions or manually extending IS_GPIO_AF() resolves the issue.
