cancel
Showing results for 
Search instead for 
Did you mean: 

Problems encountered when manually porting the latest FreeRTOS to a project generated by CubeMX.

DXinp.1
Associate II

Post updated by a ST moderator:

1- Title translated from Chinese to English.

2- Used </> button for the code.

I am attempting to transplant the latest FreeRTOS kernel program on the basis of the project generated by CubeMX. When FreeRTOS uses HSI, there is no problem and it runs normally. However, when using HSE, an initialization timeout occurs. Without transplanting FreeRTOS, HSE can pass the initialization normally.
My approach was to incorporate the xPortSysTickHandler, xPortPendSVHandler, and vPortSVCHandler required by FreeRTOS into the three functions in the it file. Then, I found that it was the xPortSysTickHandler() within the systick_handler() that was causing the issue. After commenting it out, the HSE could be initialized normally. So, I'm asking on the forum what the reason is and if there's a way to solve it. AI is not reliable.

void SysTick_Handler(void)
{
  /* USER CODE BEGIN SysTick_IRQn 0 */

  /* USER CODE END SysTick_IRQn 0 */
  HAL_IncTick();
  /* USER CODE BEGIN SysTick_IRQn 1 */
xPortSysTickHandler();
  /* USER CODE END SysTick_IRQn 1 */
}
0 REPLIES 0