Update Ubuntu development
[betaflight.git] / make / mcu / STM32F1.mk
blob73abf503b42071527c4a70f8dfa5c75235d47118
2 # F1 Make file include
5 ifeq ($(OPBL),yes)
6 LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f103_$(TARGET_FLASH_SIZE)k_opbl.ld
7 endif
9 MCU_FLASH_SIZE := 128
10 STDPERIPH_DIR = $(ROOT)/lib/main/STM32F1/Drivers/STM32F10x_StdPeriph_Driver
11 STDPERIPH_SRC = $(notdir $(wildcard $(STDPERIPH_DIR)/src/*.c))
12 EXCLUDES = stm32f10x_crc.c \
13 stm32f10x_cec.c \
14 stm32f10x_can.c
15 STARTUP_SRC = startup_stm32f10x_md_gcc.S
16 STDPERIPH_SRC := $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC))
18 # Search path and source files for the CMSIS sources
19 VPATH := $(VPATH):$(CMSIS_DIR)/Core/Include:$(ROOT)/lib/main/STM32F1/Drivers/CMSIS/Device/ST/STM32F10x
20 CMSIS_SRC = $(notdir $(wildcard $(ROOT)/lib/main/STM32F1/Drivers/CMSIS/Device/ST/STM32F10x/*.c))
22 INCLUDE_DIRS := $(INCLUDE_DIRS) \
23 $(STDPERIPH_DIR)/inc \
24 $(CMSIS_DIR)/Core/Include \
25 $(ROOT)/lib/main/STM32F1/Drivers/CMSIS/Device/ST/STM32F10x
27 DEVICE_STDPERIPH_SRC = $(STDPERIPH_SRC)
29 ifneq ($(filter VCP, $(FEATURES)),)
30 INCLUDE_DIRS := $(INCLUDE_DIRS) \
31 $(USBFS_DIR)/inc \
32 $(ROOT)/src/main/vcp
34 VPATH := $(VPATH):$(USBFS_DIR)/src
36 DEVICE_STDPERIPH_SRC := $(DEVICE_STDPERIPH_SRC) \
37 $(USBPERIPH_SRC)
39 endif
41 ifeq ($(LD_SCRIPT),)
42 LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f103_$(TARGET_FLASH_SIZE)k.ld
43 endif
45 ARCH_FLAGS = -mthumb -mcpu=cortex-m3
47 ifeq ($(DEVICE_FLAGS),)
48 DEVICE_FLAGS = -DSTM32F10X_MD
49 endif
50 DEVICE_FLAGS += -DSTM32F10X
52 VCP_SRC = \
53 vcp/hw_config.c \
54 vcp/stm32_it.c \
55 vcp/usb_desc.c \
56 vcp/usb_endp.c \
57 vcp/usb_istr.c \
58 vcp/usb_prop.c \
59 vcp/usb_pwr.c \
60 drivers/serial_usb_vcp.c \
61 drivers/usb_io.c
63 MCU_COMMON_SRC = \
64 drivers/adc_stm32f10x.c \
65 drivers/bus_i2c_stm32f10x.c \
66 drivers/bus_spi_stdperiph.c \
67 drivers/dma.c \
68 drivers/inverter.c \
69 drivers/light_ws2811strip_stdperiph.c \
70 drivers/serial_uart_stdperiph.c \
71 drivers/serial_uart_stm32f10x.c \
72 drivers/system_stm32f10x.c \
73 drivers/timer_stm32f10x.c
75 DSP_LIB :=
77 ifneq ($(DEBUG),GDB)
78 OPTIMISE_DEFAULT := -Os
79 OPTIMISE_SPEED :=
80 OPTIMISE_SIZE :=
82 LTO_FLAGS := $(OPTIMISATION_BASE) $(OPTIMISE_DEFAULT)
83 endif