diff --git a/soc/st/stm32/common/soc_config.c b/soc/st/stm32/common/soc_config.c index 70f270cf494..6e5650850b4 100644 --- a/soc/st/stm32/common/soc_config.c +++ b/soc/st/stm32/common/soc_config.c @@ -30,7 +30,7 @@ static int st_stm32_common_config(void) #if defined(CONFIG_SOC_SERIES_STM32WBX) || defined(CONFIG_SOC_SERIES_STM32H5X) LL_DBGMCU_EnableTraceClock(); #endif -#if !defined(CONFIG_SOC_SERIES_STM32WBX) +#if !defined(CONFIG_SOC_SERIES_STM32WBX) && defined(DBGMCU_CR_TRACE_IOEN) LL_DBGMCU_SetTracePinAssignment(LL_DBGMCU_TRACE_ASYNCH); #endif #endif /* CONFIG_LOG_BACKEND_SWO */