rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | LOCAL_DIR := $(GET_LOCAL_DIR) |
| 2 | |
| 3 | MODULE := $(LOCAL_DIR) |
| 4 | |
| 5 | # ROMBASE, MEMBASE, and MEMSIZE are required for the linker script |
| 6 | ROMBASE := 0x0 |
| 7 | MEMBASE := 0x20000000 |
| 8 | # can be overridden by target |
| 9 | |
| 10 | ARCH := arm |
| 11 | ARM_CPU := cortex-m3 |
| 12 | |
| 13 | ifeq ($(STM32_CHIP),stm32f107) |
| 14 | GLOBAL_DEFINES += \ |
| 15 | STM32F10X_CL=1 |
| 16 | MEMSIZE ?= 65536 |
| 17 | endif |
| 18 | ifeq ($(STM32_CHIP),stm32f103_xl) |
| 19 | GLOBAL_DEFINES += \ |
| 20 | STM32F10X_XL=1 |
| 21 | MEMSIZE ?= 65536 |
| 22 | endif |
| 23 | ifeq ($(STM32_CHIP),stm32f103_hd) |
| 24 | GLOBAL_DEFINES += \ |
| 25 | STM32F10X_HD=1 |
| 26 | MEMSIZE ?= 65536 |
| 27 | endif |
| 28 | ifeq ($(STM32_CHIP),stm32f103_md) |
| 29 | GLOBAL_DEFINES += \ |
| 30 | STM32F10X_MD=1 |
| 31 | MEMSIZE ?= 20480 |
| 32 | endif |
| 33 | ifeq ($(STM32_CHIP),stm32f103_ld) |
| 34 | GLOBAL_DEFINES += \ |
| 35 | STM32F10X_LD=1 |
| 36 | MEMSIZE ?= 20480 |
| 37 | endif |
| 38 | |
| 39 | GLOBAL_DEFINES += \ |
| 40 | MEMSIZE=$(MEMSIZE) |
| 41 | |
| 42 | MODULE_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 | # |
| 66 | LINKER_SCRIPT += \ |
| 67 | $(BUILDDIR)/system-twosegment.ld |
| 68 | |
| 69 | MODULE_DEPS += \ |
| 70 | arch/arm/arm-m/systick \ |
| 71 | lib/cbuf |
| 72 | |
| 73 | include $(LOCAL_DIR)/STM32F10x_StdPeriph_Driver/rules.mk $(LOCAL_DIR)/CMSIS/rules.mk |
| 74 | |
| 75 | include make/module.mk |