STMicroelectronics / STM32CubeF4

STM32Cube MCU Full Package for the STM32F4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
900 stars 424 forks source link

ASSERTION FAILED during RCC initialization with STM32CubeMX + FreeRTOS generated code #18

Closed the78mole closed 4 years ago

the78mole commented 4 years ago

In function HAL_RCC_ClockConfig, which in turn is called by SystemClockConfig and main.c from CubeMX generated code (at least when FreeRTOS is using a timer for systick)

https://github.com/STMicroelectronics/STM32CubeF4/blob/5d01400afd60410f6e049cbd19179a67d44d53fd/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c#L713

here the default value of uwTickPrio is used, which is set (possibly by intention) to an invalid value:

https://github.com/STMicroelectronics/STM32CubeF4/blob/a86ecaa2fb63029596ba7dabadab2d9c2c139560/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c#L95

This results in some unintended assertion.

image

In my config, TIM14 is used as the SysTick source.

My hotfix to this issue is, to set uwTickPrio to a valid value in user code section between HAL_Init and SystemClockConfig.

image

RKOUSTM commented 4 years ago

Hi @the78mole,

Thank you for your contribution. According to our analysis, this issue is rather related to CubeMX, may I ask you to submit it to the ST Community in the dedicated section? There, you will hopefully find people from our CubeMX development teams who will take in charge your request.

Thank you again for your contribution.

With regards,