Merge pull request #11189 from klutvott123/move-telemetry-displayport-init
[betaflight.git] / make / mcu / STM32F3.mk
blobe1a66cb8fd2ecbdf9d5ec2dbaa8edd75ab300704
2 # F3 Make file include
5 ifeq ($(OPBL),yes)
6 LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f303_$(TARGET_FLASH_SIZE)k_opbl.ld
7 endif
9 MCU_FLASH_SIZE := 256
10 # note that there is no hardfault debugging startup file assembly handler for other platforms
11 ifeq ($(DEBUG_HARDFAULTS),F3)
12 CFLAGS += -DDEBUG_HARDFAULTS
13 MCU_COMMON_SRC = startup_stm32f3_debug_hardfault_handler.S
14 else
15 MCU_COMMON_SRC = startup_stm32f30x_md_gcc.S
16 endif
18 STDPERIPH_DIR = $(ROOT)/lib/main/STM32F3/Drivers/STM32F30x_StdPeriph_Driver
19 STDPERIPH_SRC = $(notdir $(wildcard $(STDPERIPH_DIR)/src/*.c))
20 EXCLUDES = stm32f30x_crc.c \
21 stm32f30x_can.c
22 STARTUP_SRC = startup_stm32f30x_md_gcc.S
24 STDPERIPH_SRC := $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC))
25 DEVICE_STDPERIPH_SRC = $(STDPERIPH_SRC)
27 VPATH := $(VPATH):$(CMSIS_DIR)/Core/Include
28 CMSIS_SRC = $(notdir $(wildcard $(ROOT)/lib/main/STM32F3/Drivers/CMSIS/Device/ST/STM32F30x/*.c))
30 INCLUDE_DIRS := $(INCLUDE_DIRS) \
31 $(STDPERIPH_DIR)/inc \
32 $(CMSIS_DIR)/Core/Include \
33 $(ROOT)/lib/main/STM32F3/Drivers/CMSIS/Device/ST/STM32F30x
35 ifneq ($(filter VCP, $(FEATURES)),)
36 INCLUDE_DIRS := $(INCLUDE_DIRS) \
37 $(USBFS_DIR)/inc \
38 $(ROOT)/src/main/vcp
40 VPATH := $(VPATH):$(USBFS_DIR)/src
42 DEVICE_STDPERIPH_SRC := $(DEVICE_STDPERIPH_SRC)\
43 $(USBPERIPH_SRC)
44 endif
46 ifneq ($(filter SDCARD_SPI, $(FEATURES)),)
47 INCLUDE_DIRS := $(INCLUDE_DIRS) \
48 $(FATFS_DIR) \
50 VPATH := $(VPATH):$(FATFS_DIR)
51 endif
53 ifneq ($(filter SDCARD_SDIO, $(FEATURES)),)
54 INCLUDE_DIRS := $(INCLUDE_DIRS) \
55 $(FATFS_DIR) \
57 VPATH := $(VPATH):$(FATFS_DIR)
58 endif
60 ifeq ($(LD_SCRIPT),)
61 LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f303_$(TARGET_FLASH_SIZE)k.ld
62 endif
64 ARCH_FLAGS = -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wdouble-promotion
65 DEVICE_FLAGS = -DSTM32F303xC -DSTM32F303
67 VCP_SRC = \
68 vcp/hw_config.c \
69 vcp/stm32_it.c \
70 vcp/usb_desc.c \
71 vcp/usb_endp.c \
72 vcp/usb_istr.c \
73 vcp/usb_prop.c \
74 vcp/usb_pwr.c \
75 drivers/serial_usb_vcp.c \
76 drivers/usb_io.c
79 MCU_COMMON_SRC = \
80 startup/system_stm32f30x.c \
81 drivers/adc_stm32f30x.c \
82 drivers/bus_i2c_stm32f30x.c \
83 drivers/bus_i2c_timing.c \
84 drivers/bus_spi_stdperiph.c \
85 drivers/dma.c \
86 drivers/light_ws2811strip_stdperiph.c \
87 drivers/transponder_ir_io_stdperiph.c \
88 drivers/pwm_output_dshot.c \
89 drivers/pwm_output_dshot_shared.c \
90 drivers/serial_uart_stdperiph.c \
91 drivers/serial_uart_stm32f30x.c \
92 drivers/system_stm32f30x.c \
93 drivers/timer_stm32f30x.c
95 DSP_LIB := $(ROOT)/lib/main/CMSIS/DSP
96 DEVICE_FLAGS += -DARM_MATH_MATRIX_CHECK -DARM_MATH_ROUNDING -D__FPU_PRESENT=1 -DUNALIGNED_SUPPORT_DISABLE -DARM_MATH_CM4