From 2a056c082780554ffae09cd6332d97ce769e2055 Mon Sep 17 00:00:00 2001 From: Tobias Pisani Date: Sun, 1 Dec 2024 14:43:15 +0100 Subject: [PATCH] drivers: udc: stm32: add kconfig dependency on !USB_DC_STM32 If both new and old stm32 usb drivers are enabled, the HAL callbacks will raise multiple definition linker errors. By adding this kconfig dependency, this will be reported as a kconfig warning that should be easier to understand. This will happen when trying to run samples with -DCONF_FILE=usbd_next_prj.conf for boards that automatically enable the legacy usb stack (e.g. arduino_portenta/stm32h747xx/m7). Signed-off-by: Tobias Pisani --- drivers/usb/udc/Kconfig.stm32 | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/udc/Kconfig.stm32 b/drivers/usb/udc/Kconfig.stm32 index 44feca68ff811d7..c2fbac5f0455d2b 100644 --- a/drivers/usb/udc/Kconfig.stm32 +++ b/drivers/usb/udc/Kconfig.stm32 @@ -6,6 +6,7 @@ config UDC_STM32 depends on DT_HAS_ST_STM32_OTGFS_ENABLED \ || DT_HAS_ST_STM32_OTGHS_ENABLED \ || DT_HAS_ST_STM32_USB_ENABLED + depends on !USB_DC_STM32 select USE_STM32_LL_USB select USE_STM32_HAL_PCD select USE_STM32_HAL_PCD_EX