From 8de9306342fd1549e90474ad2e103be44b4c593b Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Tue, 25 Aug 2026 13:15:20 +0200 Subject: [PATCH] arch/arm/stm32: Introduce STM32_COMMON_M33 family group Replace the enumerated STM32U3/U5 chip conditions in the common M33 source lists and the RCC dispatch header with a single STM32_COMMON_M33 symbol, following the existing STM32_COMMON_* convention. Signed-off-by: raiden00pl Assisted-by: Claude Code --- arch/arm/src/common/stm32/CMakeLists.txt | 2 +- arch/arm/src/common/stm32/Kconfig | 5 +++++ arch/arm/src/common/stm32/Make.defs | 3 +-- arch/arm/src/common/stm32/stm32_rcc.h | 5 ++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/arm/src/common/stm32/CMakeLists.txt b/arch/arm/src/common/stm32/CMakeLists.txt index 4b1eb9bbb03..cb4bb03fc8f 100644 --- a/arch/arm/src/common/stm32/CMakeLists.txt +++ b/arch/arm/src/common/stm32/CMakeLists.txt @@ -51,7 +51,7 @@ if(CONFIG_STM32_HAVE_IP_EXTI_M33_V1) list(APPEND SRCS stm32_exti_gpio_m33_v1.c) endif() -if(CONFIG_ARCH_CHIP_STM32U3 OR CONFIG_ARCH_CHIP_STM32U5) +if(CONFIG_STM32_COMMON_M33) list(APPEND SRCS stm32_allocateheap_m33_v1.c stm32_irq_m33_v1.c stm32_start_m33_v1.c stm32_timerisr_m33_v1.c) diff --git a/arch/arm/src/common/stm32/Kconfig b/arch/arm/src/common/stm32/Kconfig index 5c58b95d0ab..180fac6aa2d 100644 --- a/arch/arm/src/common/stm32/Kconfig +++ b/arch/arm/src/common/stm32/Kconfig @@ -53,6 +53,11 @@ config STM32_COMMON_L4_H5_L5_U5 default y if STM32_COMMON_L4_L5_U5 default y if ARCH_CHIP_STM32H5 +config STM32_COMMON_M33 + bool + default y if ARCH_CHIP_STM32U3 + default y if ARCH_CHIP_STM32U5 + config STM32_COMMON_FULL_FEATURED bool default y if STM32_COMMON_LEGACY diff --git a/arch/arm/src/common/stm32/Make.defs b/arch/arm/src/common/stm32/Make.defs index e018677a673..729a00f342e 100644 --- a/arch/arm/src/common/stm32/Make.defs +++ b/arch/arm/src/common/stm32/Make.defs @@ -62,8 +62,7 @@ ifeq ($(CONFIG_STM32_HAVE_IP_EXTI_M33_V1),y) CHIP_CSRCS += stm32_exti_gpio_m33_v1.c endif -ifneq ($(filter y,$(CONFIG_ARCH_CHIP_STM32U3) \ - $(CONFIG_ARCH_CHIP_STM32U5)),) +ifeq ($(CONFIG_STM32_COMMON_M33),y) CHIP_CSRCS += stm32_allocateheap_m33_v1.c CHIP_CSRCS += stm32_irq_m33_v1.c CHIP_CSRCS += stm32_start_m33_v1.c diff --git a/arch/arm/src/common/stm32/stm32_rcc.h b/arch/arm/src/common/stm32/stm32_rcc.h index cc54a0079e0..9e29adba639 100644 --- a/arch/arm/src/common/stm32/stm32_rcc.h +++ b/arch/arm/src/common/stm32/stm32_rcc.h @@ -27,8 +27,7 @@ * Included Files ****************************************************************************/ -#if defined(CONFIG_ARCH_CHIP_STM32U3) || \ - defined(CONFIG_ARCH_CHIP_STM32U5) +#ifdef CONFIG_STM32_COMMON_M33 # include "stm32_rcc_m33.h" @@ -231,5 +230,5 @@ void stm32_rcc_disablelsi(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* STM32U3 || STM32U5 */ +#endif /* CONFIG_STM32_COMMON_M33 */ #endif /* __ARCH_ARM_SRC_COMMON_STM32_STM32_RCC_H */