mcu_base/libs/stm32f4xx.mk

49 lines
1.9 KiB
Makefile

# The processor!
MCU_CORE=cm4
# Set up include paths
MCU_INCLUDE += -I$(LIBDIR)/CMSIS/Device/ST/STM32F4xx/Include
MCU_INCLUDE += -I$(LIBDIR)/STM32F4xx_StdPeriph_Driver/inc
# Set up CFLAGS
MATH_CPPFLAGS += -D__FPU_PRESENT=1
MCU_CPPFLAGS += -D$(shell echo -n $(MCU_SUBTYPE) | tr a-z A-Z | tr X x )
MCU_CPPFLAGS += -D"assert_param(expr)=((void)0)"
MCU_CFLAGS += -mcpu=cortex-m4 -mthumb -Wa,-mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard
# CMSIS
STARTUP_OBJS = $(LIBDIR)/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.o $(LIBDIR)/startup_$(MCU_SUBTYPE).o
# Standard Peripheral Library
STM32F4xx_OBJSR = misc.o stm32f4xx_dma.o stm32f4xx_rcc.o stm32f4xx_adc.o \
stm32f4xx_exti.o stm32f4xx_rng.o stm32f4xx_can.o stm32f4xx_flash.o \
stm32f4xx_rtc.o stm32f4xx_crc.o stm32f4xx_sdio.o \
stm32f4xx_cryp_aes.o stm32f4xx_gpio.o stm32f4xx_spi.o \
stm32f4xx_cryp.o stm32f4xx_hash.o stm32f4xx_syscfg.o \
stm32f4xx_cryp_des.o stm32f4xx_hash_md5.o stm32f4xx_tim.o \
stm32f4xx_cryp_tdes.o stm32f4xx_hash_sha1.o stm32f4xx_usart.o \
stm32f4xx_dac.o stm32f4xx_i2c.o stm32f4xx_wwdg.o stm32f4xx_dbgmcu.o \
stm32f4xx_iwdg.o stm32f4xx_dcmi.o stm32f4xx_pwr.o \
stm32f4xx_sai.o stm32f4xx_ltdc.o stm32f4xx_dma2d.o \
stm32f4xx_cec.o stm32f4xx_fmpi2c.o stm32f4xx_qspi.o \
stm32f4xx_spdifrx.o stm32f4xx_flash_ramfunc.o
ifeq ($(MCU_SUBTYPE),stm32f40_41xx)
STM32F4xx_OBJSR += stm32f4xx_fsmc.o
endif
ifeq ($(MCU_SUBTYPE),stm32f427_437xx)
STM32F4xx_OBJSR += stm32f4xx_fmc.o
endif
ifeq ($(MCU_SUBTYPE),stm32f429_439xx)
STM32F4xx_OBJSR += stm32f4xx_fmc.o # 427x/437x/429x/439x
endif
STM32F4xx_OBJS += $(addprefix $(LIBDIR)/STM32F4xx_StdPeriph_Driver/src/,$(STM32F4xx_OBJSR))
# Bookkeeping
MCU_LIBS_OBJS += $(STM32F4xx_OBJS)
# Build Rules
$(LIBDIR)/startup_$(MCU_SUBTYPE).o: $(LIBDIR)/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_$(MCU_SUBTYPE).s
@$(E) " AS " $@
$(Q)$(AS) -c -o $@ $<