cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with HAL_Delay() and ThreadX

JonConesa
Associate III

Hello everyone,

I am encountering an issue with the HAL_Delay() function and ThreadX in my project. Before initializing ThreadX, HAL_Delay() works as expected. Specifically, the callback function:

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
  /* USER CODE BEGIN Callback 0 */

  /* USER CODE END Callback 0 */
  if (htim->Instance == TIM6)
  {
    HAL_IncTick();
  }
  /* USER CODE BEGIN Callback 1 */
  WR_TIMER_process();
  /* USER CODE END Callback 1 */
}

is triggered correctly, and the uwTick variable increments as intended.

I am using Timer6 for the system ticks on a custom PCB with an STM32H743BIT MCU. However, after calling the MX_ThreadX_Init() function, the uwTick variable stops updating, and the HAL_TIM_PeriodElapsedCallback is no longer triggered.

 

Here is my setup:

  • MCU: STM32H743BIT

  • Compiler: arm-none-eabi-gcc (Arm GNU Toolchain 14.2.Rel1 (Build arm-14.52)) 14.2.1 20241119

  • CubeMX Version: 6.14.0

  • ThreadX Version: 6.4.0
  • Debugger: J-Link 8.32

  • Ozone Version: 3.38g

 

It seems like the initialization of ThreadX might be interfering with the callback mechanism. Has anyone experienced a similar issue, or does anyone know what could cause the callback to stop triggering after initializing ThreadX?

 

Thank you for your help!

 

1 REPLY 1

https://community.st.com/t5/stm32-mcus-embedded-software/f767-freertos-lwip-gt-hal-delay-fails/m-p/799506/highlight/true#M63016

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.