update credits
[librepilot.git] / flight / pios / stm32f30x / library.mk
blobeea30af0b1e37e5aa04cfde2e88dd3c5cef2651c
2 # Rules to (help) build the F30x device support.
5 # Directory containing this makefile
6 PIOS_DEVLIB := $(dir $(lastword $(MAKEFILE_LIST)))
8 MCU := cortex-m4
10 USE_USB ?= YES
12 LDSRC = $(PIOS_DEVLIB)link_memory.lds $(PIOS_DEVLIB)link_sections.lds
14 CDEFS += -D$(CHIP) -DSTM32F3
15 CDEFS += -DHSE_VALUE=$(OSCILLATOR_FREQ)
16 CDEFS += -DUSE_STDPERIPH_DRIVER
17 CDEFS += -DARM_MATH_CM4 -D__FPU_PRESENT=1
18 CDEFS += -DPIOS_TARGET_PROVIDES_FAST_HEAP
20 ARCHFLAGS += -mcpu=cortex-m4 -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard
22 # PIOS device library source and includes
23 PIOS_DEVLIB_SRC = $(sort $(wildcard $(PIOS_DEVLIB)*.c))
25 ifeq ($(PIOS_OMITS_USB),YES)
26 SRC += $(filter-out $(wildcard $(PIOS_DEVLIB)pios_usb*.c), $(PIOS_DEVLIB_SRC))
27 else
28 SRC += $(PIOS_DEVLIB_SRC)
29 endif
31 EXTRAINCDIRS += $(PIOS_DEVLIB)inc
33 # CMSIS for the F3
34 include $(PIOSCOMMON)/libraries/CMSIS/library.mk
35 CMSIS_DEVICEDIR := $(PIOS_DEVLIB)libraries/CMSIS3/Device/ST/STM32F30x
36 EXTRAINCDIRS += $(CMSIS_DEVICEDIR)/Include
38 # ST Peripheral library
39 PERIPHLIB = $(PIOS_DEVLIB)libraries/STM32F30x_StdPeriph_Driver
40 ALL_SPL_SOURCES = $(sort $(wildcard $(PERIPHLIB)/src/*.c))
41 SPL_SOURCES = $(filter-out %stm32f30x_can.c, $(ALL_SPL_SOURCES))
42 SRC += $(SPL_SOURCES)
43 EXTRAINCDIRS += $(PERIPHLIB)/inc
45 ifneq ($(PIOS_OMITS_USB),YES)
46 # ST USB Device library
47 USBDEVLIB = $(PIOS_DEVLIB)/libraries/STM32_USB-FS-Device_Driver
48 SRC += $(sort $(wildcard $(USBDEVLIB)/src/*.c))
49 EXTRAINCDIRS += $(USBDEVLIB)/inc
50 endif
53 # FreeRTOS
55 # If the application has included the generic FreeRTOS support, then add in
56 # the device-specific pieces of the code.
58 ifneq ($(FREERTOS_DIR),)
59 FREERTOS_PORTDIR := $(FREERTOS_DIR)
60 SRC += $(sort $(wildcard $(FREERTOS_PORTDIR)/portable/GCC/ARM_CM4F/*.c))
61 EXTRAINCDIRS += $(FREERTOS_PORTDIR)/portable/GCC/ARM_CM4F
62 include $(PIOSCOMMON)/libraries/msheap/library.mk
63 endif