2015-06-19 18:47:02 -07:00
|
|
|
LOCAL_DIR := $(GET_LOCAL_DIR)
|
|
|
|
|
|
|
|
|
|
MODULE := $(LOCAL_DIR)
|
|
|
|
|
|
|
|
|
|
# ROMBASE, MEMBASE, and MEMSIZE are required for the linker script
|
2015-06-29 13:49:30 -07:00
|
|
|
ROMBASE ?= 0x08000000
|
|
|
|
|
MEMBASE ?= 0x20000000
|
2015-06-19 18:47:02 -07:00
|
|
|
# default memsize, specific STM32_CHIP may override this
|
|
|
|
|
# and target/project may have already overridden
|
|
|
|
|
MEMSIZE ?= 131072
|
|
|
|
|
|
|
|
|
|
ARCH := arm
|
|
|
|
|
ARM_CPU := cortex-m4
|
|
|
|
|
|
|
|
|
|
# TODO: integrate better with platform/stm32f4xx/CMSIS/stm32f4xx.h
|
|
|
|
|
ifeq ($(STM32_CHIP),stm32f407)
|
2022-08-14 19:05:20 -07:00
|
|
|
GLOBAL_COMPILEFLAGS += -DSTM32F40_41xxx=1
|
2015-06-19 18:47:02 -07:00
|
|
|
FOUND_CHIP := true
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(STM32_CHIP),stm32f417)
|
|
|
|
|
FOUND_CHIP := true
|
2022-08-14 19:05:20 -07:00
|
|
|
GLOBAL_COMPILEFLAGS += -DSTM32F40_41xxx=1
|
2015-06-19 18:47:02 -07:00
|
|
|
endif
|
2017-07-02 18:26:52 +08:00
|
|
|
ifeq ($(STM32_CHIP),stm32f429)
|
|
|
|
|
FOUND_CHIP := true
|
2022-08-14 19:05:20 -07:00
|
|
|
GLOBAL_COMPILEFLAGS += -DSTM32F429_439xx=1
|
2017-07-02 18:26:52 +08:00
|
|
|
endif
|
2015-06-19 18:47:02 -07:00
|
|
|
|
|
|
|
|
ifeq ($(FOUND_CHIP),)
|
|
|
|
|
$(error unknown STM32F4xx chip $(STM32_CHIP))
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
GLOBAL_INCLUDES += \
|
2015-07-16 18:20:55 -07:00
|
|
|
$(LOCAL_DIR)/include/dev
|
2015-06-19 18:47:02 -07:00
|
|
|
|
|
|
|
|
MODULE_SRCS += \
|
|
|
|
|
$(LOCAL_DIR)/init.c \
|
|
|
|
|
$(LOCAL_DIR)/vectab.c \
|
|
|
|
|
$(LOCAL_DIR)/gpio.c \
|
|
|
|
|
$(LOCAL_DIR)/timer.c \
|
|
|
|
|
$(LOCAL_DIR)/debug.c \
|
2015-07-16 18:20:55 -07:00
|
|
|
$(LOCAL_DIR)/uart.c \
|
|
|
|
|
$(LOCAL_DIR)/flash.c
|
2015-06-19 18:47:02 -07:00
|
|
|
|
|
|
|
|
# use a two segment memory layout, where all of the read-only sections
|
|
|
|
|
# of the binary reside in rom, and the read/write are in memory. The
|
|
|
|
|
# ROMBASE, MEMBASE, and MEMSIZE make variables are required to be set
|
|
|
|
|
# for the linker script to be generated properly.
|
|
|
|
|
#
|
|
|
|
|
LINKER_SCRIPT += \
|
|
|
|
|
$(BUILDDIR)/system-twosegment.ld
|
|
|
|
|
|
|
|
|
|
MODULE_DEPS += \
|
2016-09-15 13:33:58 -07:00
|
|
|
platform/stm32 \
|
2016-02-17 19:45:38 -08:00
|
|
|
platform/stm32f4xx/STM32F4xx_StdPeriph_Driver \
|
2015-06-19 18:47:02 -07:00
|
|
|
arch/arm/arm-m/systick \
|
2015-07-16 18:20:55 -07:00
|
|
|
lib/cbuf \
|
|
|
|
|
lib/bio
|
2015-06-19 18:47:02 -07:00
|
|
|
|
|
|
|
|
include make/module.mk
|