1LOCAL_DIR := $(GET_LOCAL_DIR)
2
3MODULE := $(LOCAL_DIR)
4
5# ROMBASE, MEMBASE, and MEMSIZE are required for the linker script
6ROMBASE ?= 0x08000000
7MEMBASE ?= 0x20000000
8# default memsize, specific STM32_CHIP may override this
9# and target/project may have already overridden
10MEMSIZE ?= 131072
11
12ARCH := arm
13ARM_CPU := cortex-m4
14
15# TODO: integrate better with platform/stm32f4xx/CMSIS/stm32f4xx.h
16ifeq ($(STM32_CHIP),stm32f407)
17GLOBAL_DEFINES += STM32F40_41xxx
18FOUND_CHIP := true
19endif
20ifeq ($(STM32_CHIP),stm32f417)
21FOUND_CHIP := true
22GLOBAL_DEFINES += STM32F40_41xxx
23endif
24ifeq ($(STM32_CHIP),stm32f429)
25FOUND_CHIP := true
26GLOBAL_DEFINES += STM32F429_439xx
27endif
28
29ifeq ($(FOUND_CHIP),)
30$(error unknown STM32F4xx chip $(STM32_CHIP))
31endif
32
33GLOBAL_INCLUDES += \
34	$(LOCAL_DIR)/include/dev
35
36MODULE_SRCS += \
37	$(LOCAL_DIR)/init.c \
38	$(LOCAL_DIR)/vectab.c \
39	$(LOCAL_DIR)/gpio.c \
40	$(LOCAL_DIR)/timer.c \
41	$(LOCAL_DIR)/debug.c \
42	$(LOCAL_DIR)/uart.c \
43	$(LOCAL_DIR)/flash.c
44
45# use a two segment memory layout, where all of the read-only sections
46# of the binary reside in rom, and the read/write are in memory. The
47# ROMBASE, MEMBASE, and MEMSIZE make variables are required to be set
48# for the linker script to be generated properly.
49#
50LINKER_SCRIPT += \
51	$(BUILDDIR)/system-twosegment.ld
52
53MODULE_DEPS += \
54	platform/stm32 \
55	platform/stm32f4xx/STM32F4xx_StdPeriph_Driver \
56	arch/arm/arm-m/systick \
57	lib/cbuf \
58	lib/bio
59
60include make/module.mk
61