engine_control/config/make/stm32f4xx.mk

60 lines
1.3 KiB
Makefile
Raw Normal View History

2016-07-23 05:59:54 +00:00
ARCH ?= stm32f4xx
ifeq ($(ARCH),stm32f4xx)
CFLAGS += -DARCH_STM32F4XX
endif
ifeq ($(BOARD), stm32f4-discovery)
CFLAGS += -DBOARD_STM32F4_DISCOVERY
endif
CROSS_COMPILE=arm-none-eabi-
2016-07-26 20:35:17 +00:00
INCLUDES += \
/usr/lib/arm-none-eabi/include \
/usr/lib/gcc/arm-none-eabi/4.8/include
2016-07-23 05:59:54 +00:00
ifeq ($(DEBUG),y)
OPTIM = 0
CFLAGS += -g
else
OPTIM = s
LDFLAGS += -s
endif
CFLAGS += \
-mthumb \
2016-07-28 15:01:49 +00:00
-T $(ROOT_DIR)/config/linker/stm32_flash.ld \
2016-07-23 05:59:54 +00:00
-D USE_STDPERIPH_DRIVER\
-D VECT_TAB_FLASH\
-D GCC_ARMCM4\
-D THUMB_INTERWORK\
-D PACK_STRUCT_END=__attribute\(\(packed\)\)\
-D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\)\
-mcpu=cortex-m4 \
-mfpu=fpv4-sp-d16 \
-mfloat-abi=softfp \
-fdata-sections \
-ffunction-sections
# -D inline= -mthumb\
2016-07-26 20:35:17 +00:00
CPPCHECK_FLAGS += \
-D USE_STDPERIPH_DRIVER\
-D VECT_TAB_FLASH\
-D GCC_ARMCM4\
-D THUMB_INTERWORK\
-D PACK_STRUCT_END=__attribute\(\(packed\)\)\
-D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\)\
-D __thumb__ \
--check-config
2016-07-23 05:59:54 +00:00
LDFLAGS=\
-Wl,--gc-sections \
-Xlinker -M > $(MAP_DIR)/$(APP).map
ASFLAGS=-mapcs-32 -g
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)