blob: 0a1d63e30500e8e78a46170a7a07ceea762d566d [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 := 0x0
7MEMBASE := 0x20000000
8# can be overridden by target
9
10ARCH := arm
11ARM_CPU := cortex-m3
12
13ifeq ($(STM32_CHIP),stm32f107)
14GLOBAL_DEFINES += \
15 STM32F10X_CL=1
16MEMSIZE ?= 65536
17endif
18ifeq ($(STM32_CHIP),stm32f103_xl)
19GLOBAL_DEFINES += \
20 STM32F10X_XL=1
21MEMSIZE ?= 65536
22endif
23ifeq ($(STM32_CHIP),stm32f103_hd)
24GLOBAL_DEFINES += \
25 STM32F10X_HD=1
26MEMSIZE ?= 65536
27endif
28ifeq ($(STM32_CHIP),stm32f103_md)
29GLOBAL_DEFINES += \
30 STM32F10X_MD=1
31MEMSIZE ?= 20480
32endif
33ifeq ($(STM32_CHIP),stm32f103_ld)
34GLOBAL_DEFINES += \
35 STM32F10X_LD=1
36MEMSIZE ?= 20480
37endif
38
39GLOBAL_DEFINES += \
40 MEMSIZE=$(MEMSIZE)
41
42MODULE_SRCS += \
43 $(LOCAL_DIR)/init.c \
44 $(LOCAL_DIR)/debug.c \
45 $(LOCAL_DIR)/uart.c \
46 $(LOCAL_DIR)/timer.c \
47 $(LOCAL_DIR)/vectab.c \
48 $(LOCAL_DIR)/gpio.c \
49 $(LOCAL_DIR)/flash_nor.c \
50
51# $(LOCAL_DIR)/debug.c \
52 $(LOCAL_DIR)/interrupts.c \
53 $(LOCAL_DIR)/platform_early.c \
54 $(LOCAL_DIR)/platform.c \
55 $(LOCAL_DIR)/timer.c \
56 $(LOCAL_DIR)/init_clock.c \
57 $(LOCAL_DIR)/init_clock_48mhz.c \
58 $(LOCAL_DIR)/mux.c \
59 $(LOCAL_DIR)/emac_dev.c
60
61# use a two segment memory layout, where all of the read-only sections
62# of the binary reside in rom, and the read/write are in memory. The
63# ROMBASE, MEMBASE, and MEMSIZE make variables are required to be set
64# for the linker script to be generated properly.
65#
66LINKER_SCRIPT += \
67 $(BUILDDIR)/system-twosegment.ld
68
69MODULE_DEPS += \
70 arch/arm/arm-m/systick \
71 lib/cbuf
72
73include $(LOCAL_DIR)/STM32F10x_StdPeriph_Driver/rules.mk $(LOCAL_DIR)/CMSIS/rules.mk
74
75include make/module.mk