aboutsummaryrefslogtreecommitdiff
path: root/ports/stm32f4/makefile
blob: df447d1cfdfe6517198635f9b5dc9d884031d4cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Makefile for the STM32F4 port

PREFIX = arm-none-eabi-

# These variables are dependent on the target MCU
LDSCRIPT=STM32F405RGTx_FLASH.ld
ASM_FILE=startup_stm32f405xx.s
C_DEFS += \
-DSTM32F405xx

LDFLAGS = $(MCU) -specs=nosys.specs -specs=nano.specs -u _printf_float -T$(PORT_DIR)/$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections

FLOAT-ABI = -mfloat-abi=hard
CPU = -mcpu=cortex-m4
FPU = -mfpu=fpv4-sp-d16
MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)

# Library files common to all F4 MCUs
C_SOURCES += \
lib/f4/stm32f4xx_hal_i2c.c \
lib/f4/stm32f4xx_hal_i2c_ex.c \
lib/f4/stm32f4xx_hal_rcc.c \
lib/f4/stm32f4xx_hal_rcc_ex.c \
lib/f4/stm32f4xx_hal_flash.c \
lib/f4/stm32f4xx_hal_flash_ex.c \
lib/f4/stm32f4xx_hal_flash_ramfunc.c \
lib/f4/stm32f4xx_hal_gpio.c \
lib/f4/stm32f4xx_hal_dma_ex.c \
lib/f4/stm32f4xx_hal_dma.c \
lib/f4/stm32f4xx_hal_pwr.c \
lib/f4/stm32f4xx_hal_pwr_ex.c \
lib/f4/stm32f4xx_hal_cortex.c \
lib/f4/stm32f4xx_hal.c \
lib/f4/stm32f4xx_hal_exti.c \
lib/f4/stm32f4xx_hal_tim.c \
lib/f4/stm32f4xx_hal_tim_ex.c \
lib/f4/stm32f4xx_hal_uart.c \
ports/stm32f4/src/stm32f4xx_it.c \
ports/stm32f4/src/stm32f4xx_hal_msp.c \
ports/stm32f4/src/system_stm32f4xx.c \
ports/stm32f4/src/stream_i2c.c

C_INCLUDES += \
-Ilib/f4 \
-Ilib/f4/Legacy \
-Ilib/cmsis/f4 \
-Iports/stm32f4/src