2017-10-27 01:04:54 +02:00
|
|
|
ifeq (,$(KINETIS_SERIES))
|
|
|
|
# Parse parameters from CPU_MODEL using the kinetis-info.mk script in the same
|
|
|
|
# directory as this Makefile.
|
|
|
|
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/kinetis-info.mk
|
|
|
|
endif
|
|
|
|
|
2015-02-05 15:34:51 +01:00
|
|
|
# Add search path for linker scripts
|
2017-10-27 01:26:26 +02:00
|
|
|
LINKFLAGS += -L$(RIOTCPU)/$(CPU)/ldscripts
|
2015-02-09 13:50:37 +01:00
|
|
|
|
2017-10-27 01:05:33 +02:00
|
|
|
# Use generic linker script for all Kinetis based CPUs
|
|
|
|
LINKER_SCRIPT = kinetis.ld
|
|
|
|
|
|
|
|
ROM_START_ADDR = 0x00000000
|
|
|
|
RAM_BASE_ADDR = 0x20000000
|
|
|
|
RAM_START_ADDR = $$(($(RAM_BASE_ADDR)-($(KINETIS_SRAM_L_SIZE) * 1024)))
|
|
|
|
ROM_LEN = $$(($(KINETIS_ROMSIZE) * 1024))
|
|
|
|
RAM_LEN = $$(($(KINETIS_RAMSIZE) * 1024))
|
|
|
|
|
|
|
|
CFLAGS += \
|
|
|
|
-DKINETIS_CORE_$(KINETIS_CORE) \
|
|
|
|
-DKINETIS_SERIES_$(KINETIS_SERIES) \
|
|
|
|
-DKINETIS_FAMILY=$(KINETIS_FAMILY) \
|
|
|
|
-DKINETIS_SUBFAMILY=$(KINETIS_SUBFAMILY) \
|
|
|
|
-DKINETIS_ROMSIZE=$(KINETIS_ROMSIZE) \
|
|
|
|
#
|
|
|
|
|
|
|
|
LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_rom_start_addr=$(ROM_START_ADDR)
|
|
|
|
LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ram_base_addr=$(RAM_BASE_ADDR)
|
|
|
|
LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ram_start_addr=$(RAM_START_ADDR)
|
|
|
|
LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_rom_length=$(ROM_LEN)
|
|
|
|
LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ram_length=$(RAM_LEN)
|
2017-05-26 16:07:48 +02:00
|
|
|
|
2017-10-27 01:26:26 +02:00
|
|
|
# add the CPU specific flash configuration field for the linker
|
|
|
|
export UNDEF += $(BINDIR)/cpu/fcfield.o
|
2017-10-16 15:53:15 +02:00
|
|
|
|
2017-10-27 01:26:26 +02:00
|
|
|
# include common periph drivers
|
2017-09-09 15:04:37 +02:00
|
|
|
USEMODULE += periph_common
|
2016-02-12 00:46:49 +01:00
|
|
|
|
2017-09-09 15:04:37 +02:00
|
|
|
# select kinetis periph drivers
|
|
|
|
USEMODULE += periph_mcg
|
|
|
|
USEMODULE += periph_wdog
|
2017-01-09 22:55:53 +01:00
|
|
|
|
2015-05-14 19:59:05 +02:00
|
|
|
# Define a recipe to build the watchdog disable binary, used when flashing
|
2017-10-27 01:26:26 +02:00
|
|
|
$(RIOTCPU)/$(CPU)/dist/wdog-disable.bin: $(RIOTCPU)/$(CPU)/dist/wdog-disable.s
|
|
|
|
$(Q)$(MAKE) -C $(RIOTCPU)/$(CPU)/dist/ $(notdir $@)
|
2015-05-14 19:59:05 +02:00
|
|
|
|
2017-10-27 01:26:26 +02:00
|
|
|
include $(RIOTMAKE)/arch/cortexm.inc.mk
|