AnsweredAssumed Answered

STM32F4 Cube and FreeRTOS Don't Cooperate

Question asked by r.gary on Jun 16, 2014
Latest reply on Jul 21, 2014 by STM32Cube-T
Hi,

I'm having a very difficult time getting FreeRTOS v8 to run with CUBE/HAL. I started out using CUBE to generate a basic example for an ADC input configuration, and a timer that will count up (or down) and execute an interrupt handler.

I can seem to get that to work, but when I add in FreeRTOS, it will not run. As soon as the Timer Init function is run, it will not allow the FreeRTOS scheduler to operate. In addition, when CUBE generates the "void SystemClock_Config(void)
" function, it has this assignment:
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;

If the first type (RCC_CLOCKTYPE_HCLK) is not removed, the timer interrupt will not function or initialize at all.

To get FreeRTOS to  run, I must comment out the Timer Init (in other words, don't run it at all) FreeRTOS operates with no problem. In addition, after creating the example in CUBE and adding FreeRTOS (what it calls "middlewares") it generates the file "FreeRTOSConfig.h". At the bottom of the file there is a commented out define for the FreeRTOS xSystickHandler. It warns to NOT un-comment it as it will break the HAL systick.

I'm hoping someone can shed some light on these mysteries please?

Could anyone in this forum provide a working example of how to configure when using both HAL and FreeRTOS?

Thank you...









Outcomes