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 := 0x08000000 |
| 7 | MEMBASE := 0x20000000 |
| 8 | # default memsize, specific STM32_CHIP may override this |
| 9 | # and target/project may have already overridden |
| 10 | MEMSIZE ?= 131072 |
| 11 | |
| 12 | ARCH := arm |
| 13 | ARM_CPU := cortex-m3 |
| 14 | |
| 15 | ifeq ($(STM32_CHIP),stm32f207) |
| 16 | GLOBAL_DEFINES += \ |
| 17 | STM32F207=1 \ |
| 18 | STM32F2XX=1 |
| 19 | FOUND_CHIP := true |
| 20 | endif |
| 21 | ifeq ($(STM32_CHIP),stm32f407) |
| 22 | GLOBAL_DEFINES += \ |
| 23 | STM32F407=1 \ |
| 24 | STM32F4XX=1 |
| 25 | FOUND_CHIP := true |
| 26 | ARM_CPU := cortex-m4 |
| 27 | endif |
| 28 | |
| 29 | ifeq ($(FOUND_CHIP),) |
| 30 | $(error unknown STM32F2xx chip $(STM32_CHIP)) |
| 31 | endif |
| 32 | |
| 33 | GLOBAL_DEFINES += \ |
| 34 | MEMSIZE=$(MEMSIZE) |
| 35 | |
| 36 | MODULE_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 | # |
| 59 | LINKER_SCRIPT += \ |
| 60 | $(BUILDDIR)/system-twosegment.ld |
| 61 | |
| 62 | MODULE_DEPS += \ |
| 63 | arch/arm/arm-m/systick \ |
| 64 | lib/cbuf |
| 65 | |
| 66 | include $(LOCAL_DIR)/STM32F2xx_StdPeriph_Driver/rules.mk $(LOCAL_DIR)/CMSIS/rules.mk |
| 67 | |
| 68 | include make/module.mk |