engine_control/config/make/stm32f4xx.mk

91 lines
1.8 KiB
Makefile
Raw Permalink Normal View History

2016-07-29 06:51:56 +00:00
ARCH ?= arm
CPU ?= stm32f4xx
2016-07-23 05:59:54 +00:00
ifeq ($(ARCH),stm32f4xx)
CFLAGS += -DARCH_STM32F4XX
endif
ifeq ($(BOARD), stm32f4-discovery)
CFLAGS += -DBOARD_STM32F4_DISCOVERY
endif
2016-08-21 11:12:03 +00:00
CROSS_COMPILE ?= arm-none-eabi-
INCLUDES += source/system/stm32f4xx
SUB_FOLDER += source/system/stm32f4xx
2016-07-23 05:59:54 +00:00
2016-07-26 20:35:17 +00:00
INCLUDES += \
2016-08-21 11:12:03 +00:00
/opt/gcc-arm-none-eabi-5_4-2016q2/arm-none-eabi/include \
/opt/gcc-arm-none-eabi-5_4-2016q2/lib/gcc/arm-none-eabi/5.4.1/include
GEN_FLAGS += \
-mcpu=cortex-m4 \
-mthumb \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-O$(OPTIM) \
-fmessage-length=0 \
-fsigned-char \
-ffunction-sections \
-fdata-sections \
-ffreestanding \
-fno-move-loop-invariants \
-Werror \
-Wunused \
-Wuninitialized \
-Wall \
-Wextra \
-Wmissing-declarations \
-Wconversion \
-Wpointer-arith \
-Wpadded \
-Wshadow \
-Wlogical-op \
-Waggregate-return \
-Wfloat-equal
C_FLAGS += \
-DDEBUG \
-DUSE_FULL_ASSERT \
-DTRACE \
-DOS_USE_TRACE_SEMIHOSTING_DEBUG \
-DSTM32F407xx \
-DUSE_HAL_DRIVER \
-DHSE_VALUE=8000000 \
$(addprefix -I, $(INCLUDES)) \
-std=gnu11 \
-Wmissing-prototypes \
-Wstrict-prototypes \
-Wbad-function-cast \
-Wno-bad-function-cast \
-Wno-conversion \
-Wno-sign-conversion \
-Wno-unused-parameter \
-Wno-sign-compare \
-Wno-missing-prototypes \
-Wno-missing-declarations
L_FLAGS := \
-T mem.ld \
-T libs.ld \
-T sections.ld \
-nostartfiles \
-Xlinker --gc-sections \
-L"config/linker" \
--specs=nano.specs
# --specs=nosys.specs
2016-07-23 05:59:54 +00:00
ifeq ($(DEBUG),y)
2016-08-21 11:12:03 +00:00
OPTIM = g
GEN_FLAGS += -g3
2016-07-29 06:51:56 +00:00
DBG_EXT = -dbg
2016-07-23 05:59:54 +00:00
else
OPTIM = s
2016-07-29 06:51:56 +00:00
DBG_EXT =
2016-07-23 05:59:54 +00:00
endif
ARFLAGS=rcs
OOCD_IMAGE=$(BINFILE)
OOCD_CFG_FILE=$(EXE_DIR)/openocd.cfg
PRE_PROGRAM = echo "telnet_port 4444\ninit\nreset halt\nflash write_image erase $(OOCD_IMAGE) 0x08000000 bin\nreset run\n shutdown\n" > $(OOCD_CFG_FILE)
PROGRAM = openocd -f /usr/share/openocd/scripts/board/stm32f4discovery.cfg -f $(OOCD_CFG_FILE)