[bug] Issue generating code for freeRTOS using CubeMX 6 (I think)
I think there is a bug in the new CubeMX 6.0 when generating code using freeRTOS. It may just be when migrating from an older CubeMX project to a newer one, I'm not sure.
I updated a project that was built using CubeMX 5.3 to CubeMX 6 and rebuilt all the files. While there was an issue with the Call to HAL handlers being unchecked under the NVIC controls so that all the interrupt handlers no longer called the HAL files, that was at least easily fixable. However, I did notice a change to the SysTick interrupt with regards to freeRTOS
Below is the code generated by CubeMX 5.3
void SysTick_Handler(void)
{
/* USER CODE BEGIN SysTick_IRQn 0 */
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
#if (INCLUDE_xTaskGetSchedulerState == 1 )
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
{
#endif /* INCLUDE_xTaskGetSchedulerState */
xPortSysTickHandler();
#if (INCLUDE_xTaskGetSchedulerState == 1 )
}
#endif /* INCLUDE_xTaskGetSchedulerState */
/* USER CODE BEGIN SysTick_IRQn 1 */
/* USER CODE END SysTick_IRQn 1 */
}When it was generated with CubeMX 6, the freeRTOS part was missing:
#if (INCLUDE_xTaskGetSchedulerState == 1 )
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
{
#endif /* INCLUDE_xTaskGetSchedulerState */
xPortSysTickHandler();
#if (INCLUDE_xTaskGetSchedulerState == 1 )
}
#endif /* INCLUDE_xTaskGetSchedulerState */INCLUDE_xTaskGetSchedulerState is still being defined as 1, but more importantly that call to xPortSysTickHandler() is no longer being generated. That's used for incrementing the tick within freeRTOS and deciding if context switch needs to take place based upon that. I can't figure out why this wouldn't be including when generating code. I've searched through CubeMX and did a diff between the old .ioc file and the new .ioc file and don't see any changes related to freeRTOS. If I'm including freeRTOS, this seems like a necessary call for it to work.
