blob: c11dc06953d2f1922322102be83ddcb5406bba64 [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-m3
14
15ifeq ($(STM32_CHIP),stm32f207)
16GLOBAL_DEFINES += \
17 STM32F207=1 \
18 STM32F2XX=1
19FOUND_CHIP := true
20endif
21ifeq ($(STM32_CHIP),stm32f407)
22GLOBAL_DEFINES += \
23 STM32F407=1 \
24 STM32F4XX=1
25FOUND_CHIP := true
26ARM_CPU := cortex-m4
27endif
28
29ifeq ($(FOUND_CHIP),)
30$(error unknown STM32F2xx chip $(STM32_CHIP))
31endif
32
33GLOBAL_DEFINES += \
34 MEMSIZE=$(MEMSIZE)
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
44# $(LOCAL_DIR)/flash_nor.c \
45 $(LOCAL_DIR)/interrupts.c \
46 $(LOCAL_DIR)/platform_early.c \
47 $(LOCAL_DIR)/platform.c \
48 $(LOCAL_DIR)/timer.c \
49 $(LOCAL_DIR)/init_clock.c \
50 $(LOCAL_DIR)/init_clock_48mhz.c \
51 $(LOCAL_DIR)/mux.c \
52 $(LOCAL_DIR)/emac_dev.c
53
54# use a two segment memory layout, where all of the read-only sections
55# of the binary reside in rom, and the read/write are in memory. The
56# ROMBASE, MEMBASE, and MEMSIZE make variables are required to be set
57# for the linker script to be generated properly.
58#
59LINKER_SCRIPT += \
60 $(BUILDDIR)/system-twosegment.ld
61
62MODULE_DEPS += \
63 arch/arm/arm-m/systick \
64 lib/cbuf
65
66include $(LOCAL_DIR)/STM32F2xx_StdPeriph_Driver/rules.mk $(LOCAL_DIR)/CMSIS/rules.mk
67
68include make/module.mk