STM32CubeMX bug causing crash when using stm32h7xx_hal_timebase_tim for STM32H7
Hi. I'm using STM32CubeMX Code Generation for the STM32H745-DISCO (STM32H745XIHx chip). with firmware STM32Cube_FW_H7 V1.5.0.
When a timer is set as the timebase source for the M7 core, an assert is triggered in the call to 'HAL_NVIC_SetPriority(...)' in stm32h7xx_hal_timebase_tim.c's implementation of HAL_InitTick(...).
This is because HAL_InitTick is called with a TickPriority value of 16, which is invalid.
The default HAL implementation of HAL_InitTick sets the 'uwTickPrio' variable to its parameter 'TickPriority', while the stm32h7xx_hal_timebase_tim implementation does not. This was not a problem with previous firmwares (F7, at least) because the HAL_InitTick function was only called with TICK_INT_PRIORITY as a parameter. With the H7 implementation HAL_InitTick is inexplicably called with uwTickPrio as a parameter in HAL_RCC_ClockConfig(...). Since uwTickPrio is never set, HAL_InitTick is called with an invalid parameter.
A quick workaround is to manually set uwTickPrio to TICK_INT_PRIORITY in main.c.
Attached is a minimal example that demonstrates the problem.
