Skip to main content
Visitor II
June 10, 2026
Question

ITM Debug issue in STM32G474VET6

  • June 10, 2026
  • 0 replies
  • 42 views

I am working with an STM32G474 and trying to enable ITM/SWV trace using STM32CubeIDE and ST-LINK.

Configuration

  • MCU: STM32G474
  • STM32CubeMX
  • Debug Mode: Trace Asynchronous SW (SYS → Debug)
  • Default HAL initialization generated by CubeMX

i have atteched the .ioc file .

Issue

After changing the debug configuration from Serial Wire to Trace Asynchronous SW, the application gets stuck inside:

HAL_Delay(500);

The program never returns from HAL_Delay().

Observations

SysTick_Handler() is present and contains:

void SysTick_Handler(void)
{
HAL_IncTick();
}

However, when debugging, it appears that the HAL tick is not progressing, causing HAL_Delay() to wait indefinitely.

I found several discussions mentioning:

  • Moving the HAL time base from SysTick to TIM6/TIM7
  • Checking the TIM6 interrupt priority
  • Ensuring the correct HAL_InitTick() implementation is used

Questions

  1. Is there any known issue or required configuration when enabling Trace Asynchronous SW (ITM/SWV) on STM32G474?
  2. Can enabling SWV trace affect the HAL tick source or SysTick operation?
  3. Is it recommended to switch the HAL time base to TIM6 when using ITM/SWV?
  4. What is the recommended CubeMX configuration for using ITM trace while keeping HAL_Delay() functional?

Any suggestions on how to diagnose why the HAL tick stops after enabling SWV trace would be greatly appreciated.

Thank you.