arch/stm32: Only compile stm32_serial.c when STM32_USART is enabled

When SEMIHOST_SYSLOG is enabled it creates its own up_putc() function
however the stm32_serial.c also creates this same function, even
when all STM32_USARTs are disabled. Fix patch fixes this issue.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit is contained in:
Alan Carvalho de Assis
2025-10-11 16:01:39 -03:00
committed by Matteo Golin
parent 5d784a2abc
commit 744ce66135
2 changed files with 9 additions and 2 deletions
+4 -1
View File
@@ -35,7 +35,6 @@ list(
stm32_flash.c
stm32_irq.c
stm32_lowputc.c
stm32_serial.c
stm32_spi.c
stm32_i2s.c
stm32_sdio.c
@@ -46,6 +45,10 @@ list(
stm32_capture.c
stm32_dfumode.c)
if(CONFIG_STM32_USART)
list(APPEND SRCS stm32_serial.c)
endif()
if(CONFIG_STM32_DMA)
list(APPEND SRCS stm32_dma.c)
endif()
+5 -1
View File
@@ -25,10 +25,14 @@ include armv7-m/Make.defs
CHIP_CSRCS = stm32_allocateheap.c stm32_start.c stm32_rcc.c stm32_lse.c
CHIP_CSRCS += stm32_lsi.c stm32_gpio.c stm32_exti_gpio.c stm32_flash.c
CHIP_CSRCS += stm32_irq.c stm32_lowputc.c
CHIP_CSRCS += stm32_serial.c stm32_spi.c stm32_i2s.c stm32_sdio.c stm32_tim.c
CHIP_CSRCS += stm32_spi.c stm32_i2s.c stm32_sdio.c stm32_tim.c
CHIP_CSRCS += stm32_waste.c stm32_ccm.c stm32_uid.c stm32_capture.c
CHIP_CSRCS += stm32_dfumode.c
ifeq ($(CONFIG_STM32_USART),y)
CHIP_CSRCS += stm32_serial.c
endif
ifeq ($(CONFIG_STM32_DMA),y)
CHIP_CSRCS += stm32_dma.c
endif