blob: 54fc5a52701420f9a56c266d8c694bf112db0f35 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001LOCAL_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
24
25ifeq ($(FOUND_CHIP),)
26$(error unknown STM32F4xx chip $(STM32_CHIP))
27endif
28
29GLOBAL_INCLUDES += \
30 $(LOCAL_DIR)/include/dev
31
32MODULE_SRCS += \
33 $(LOCAL_DIR)/init.c \
34 $(LOCAL_DIR)/vectab.c \
35 $(LOCAL_DIR)/gpio.c \
36 $(LOCAL_DIR)/timer.c \
37 $(LOCAL_DIR)/debug.c \
38 $(LOCAL_DIR)/uart.c \
39 $(LOCAL_DIR)/flash.c
40
41# use a two segment memory layout, where all of the read-only sections
42# of the binary reside in rom, and the read/write are in memory. The
43# ROMBASE, MEMBASE, and MEMSIZE make variables are required to be set
44# for the linker script to be generated properly.
45#
46LINKER_SCRIPT += \
47 $(BUILDDIR)/system-twosegment.ld
48
49MODULE_DEPS += \
50 arch/arm/arm-m/systick \
51 lib/cbuf \
52 lib/bio
53
54include $(LOCAL_DIR)/STM32F4xx_StdPeriph_Driver/rules.mk $(LOCAL_DIR)/CMSIS/rules.mk
55
56include make/module.mk