STM32CubeMX使用重复的C_SOURCES生成Makefile

时间:2018-11-01 14:24:52

标签: makefile stm32 stm32f0 makefile-errors stm32cubemx

我刚刚开始学习STM32开发(在Ubuntu 16.04上)。

我已经使用STM32CubeMX构建了一个基于Makefile的项目。

生成的Makefile在C_SOURCES中有重复的条目,这显然会由于符号重复而导致链接失败。

C_SOURCES =  \
Src/stm32f0xx_it.c \
Src/stm32f0xx_hal_msp.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rtc.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim_ex.c \
Src/stm32f0xx_it.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_uart_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2s.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_dma.c \
Src/usbd_conf.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash.c \
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rtc_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_uart.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c \
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c \
Src/usb_device.c \
Src/usbd_desc.c \
Src/stm32f0xx_hal_msp.c \
Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cec.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_crc.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_gpio.c \
Src/usbd_desc.c \
Src/usbd_conf.c \
Src/system_stm32f0xx.c \
Src/usb_device.c \
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c \
Src/main.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_crc_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c \
Src/main.c  

Src/main.cSrc/stm32f0xx_hal_msp.cSrc/stm32f0xx_it.cSrc/usbd_conf.cSrc/usbd_desc.cSrc/usb_device.c分别在此列表中两次。

如果我从Makefile中删除重复项,则会生成生成的项目。

我做错什么了吗,还是这是STM32CubeMX中的错误?

1 个答案:

答案 0 :(得分:1)

这是一个错误,已经在ST Generated Makefile has duplicated entries for some source files上报告过。

更正应在 CubeMX 4.26.0 版本中进行。