nes-proj/arch/cpu/simplelink-cc13xx-cc26xx/Makefile.cc13xx-cc26xx

152 lines
5.3 KiB
Makefile
Raw Normal View History

################################################################################
2018-07-25 08:21:54 +00:00
### CC13xx/CC26xx CPU makefile
2018-07-24 16:42:00 +00:00
CC13x2_CC26x2_PRE_RTM ?= 1
2018-07-24 16:27:49 +00:00
2018-07-25 08:21:54 +00:00
# Core SDK is placed as a submodule under arch/cpu/cc13xx-cc26xx/lib.
2018-07-24 15:46:42 +00:00
# Do a sanity check that Core SDK submodule has been initialized.
ifndef CORE_SDK
2018-07-24 15:46:42 +00:00
CORE_SDK := $(CONTIKI_CPU)/lib/coresdk_cc13xx_cc26xx
2018-07-25 08:21:54 +00:00
CORE_SDK_INIT := $(shell [ -f $(CORE_SDK)/.git ] && echo 1)
ifneq ($(CORE_SDK_INIT),1)
2018-07-24 15:46:42 +00:00
$(error The Core SDK submodule is not available. Please run 'git submodule update --init --recursive')
endif
2018-07-25 08:21:54 +00:00
# Note that Core SDK can be overriden with a user-specified SimpleLink SDK.
# As long as the SimpleLink SDK matches the device in use and is of a reasonable
# newer version, then it should be no different than using Core SDK.
2018-07-24 15:46:42 +00:00
else
2018-07-25 08:21:54 +00:00
# Do a sanity check the path exists.
CORE_SDK_VALID := $(shell [ -d $(CORE_SDK) ] && echo 1)
ifneq ($(CORE_SDK_VALID),1)
$(error User-specified CORE_SDK is not a valid path.)
2018-07-24 15:46:42 +00:00
endif
endif
2018-07-25 08:21:54 +00:00
################################################################################
2018-07-25 08:21:54 +00:00
### Device Family
# CC13x2/CC26x2 has to differentiate both pre-RTM and RTM devices. As of now,
# pre-RTM is suffixed with _v1 while RTM is suffixed with _v2. This will be
# removed when CC13x2/CC26x2 RTMs. For now, provide a switch to choose
# either pre-RTM or RTM.
# Also note that the devices name is cc13x2_cc26x2 for all CC13x2/CC26x2
# devices, while the library name is individual for each device family.
2018-07-24 16:42:00 +00:00
ifeq ($(SUBFAMILY),cc13x2-cc26x2)
ifeq ($(CC13x2_CC26x2_PRE_RTM),1)
SDK_DEVICES_NAME := cc13x2_cc26x2_v1
SDK_LIB_NAME := $(DEVICE_FAMILY_LC)_v1
else
SDK_DEVICES_NAME := cc13x2_cc26x2_v2
SDK_LIB_NAME := $(DEVICE_FAMILY_LC)_v2
endif
2018-07-25 08:21:54 +00:00
# CC13x0/CC26x0 does not have this, with both its devices name and library
# name the same as its own device family name.
else
2018-07-24 16:42:00 +00:00
SDK_DEVICES_NAME := $(DEVICE_FAMILY_LC)
SDK_LIB_NAME := $(DEVICE_FAMILY_LC)
endif
2018-07-25 08:21:54 +00:00
################################################################################
### CC13xx/CC26xx CPU files
2018-08-03 13:34:20 +00:00
# Both ccfg-conf.c and startup_cc13xx_cc26xx_gcc.c is located locally in
# the arch/cpu/cc13xx-cc26xx folder.
CPU_START_SOURCEFILES += ccfg-conf.c startup_cc13xx_cc26xx_gcc.c
2018-07-25 08:21:54 +00:00
# CPU-dependent source files
CONTIKI_CPU_SOURCEFILES += rtimer-arch.c clock-arch.c
CONTIKI_CPU_SOURCEFILES += watchdog-arch.c dbg-arch.c
CONTIKI_CPU_SOURCEFILES += uart0-arch.c slip-arch.c
CONTIKI_CPU_SOURCEFILES += gpio-hal-arch.c int-master-arch.c
CONTIKI_CPU_SOURCEFILES += random.c trng-arch.c
2018-07-25 13:05:08 +00:00
CONTIKI_CPU_SOURCEFILES += spi-arch.c
2018-07-25 08:21:54 +00:00
# RF source files
CONTIKI_CPU_SOURCEFILES += sched.c data-queue.c
CONTIKI_CPU_SOURCEFILES += ieee-addr.c ble-addr.c
CONTIKI_CPU_SOURCEFILES += ble-beacond.c
2018-06-29 17:03:17 +00:00
2018-05-30 10:21:54 +00:00
ifeq ($(SUPPORTS_PROP_MODE),1)
2018-07-24 16:27:49 +00:00
CONTIKI_CPU_SOURCEFILES += prop-mode.c prop-settings.c prop-tx-power.c
2018-05-30 10:21:54 +00:00
endif
ifeq ($(SUPPORTS_IEEE_MODE),1)
2018-07-24 16:27:49 +00:00
CONTIKI_CPU_SOURCEFILES += ieee-mode.c ieee-settings.c ieee-tx-power.c
2018-05-30 10:21:54 +00:00
endif
2018-07-06 16:23:43 +00:00
ifeq ($(SUPPORTS_BLE_BEACON),1)
2018-07-24 16:27:49 +00:00
CONTIKI_CPU_SOURCEFILES += ble-settings.c ble-tx-power.c
2018-07-06 16:23:43 +00:00
endif
2018-07-25 08:21:54 +00:00
################################################################################
### Modules and paths
2018-08-03 13:34:20 +00:00
# Core SDK paths
SDK_NORTOS := $(CORE_SDK)/kernel/nortos
SDK_SOURCE := $(CORE_SDK)/source
SDK_DRIVERS := $(CORE_SDK)/source/ti/drivers
SDK_DEVICES := $(CORE_SDK)/source/ti/devices/$(SDK_DEVICES_NAME)
EXTERNALDIRS += $(SDK_SOURCE) $(SDK_NORTOS)
2018-07-25 08:21:54 +00:00
# CPU-dependent debug source files
2018-07-06 16:23:43 +00:00
MODULES += os/lib/dbg-io
2018-07-25 08:21:54 +00:00
# CPU-dependent directories
2018-07-09 18:13:01 +00:00
CONTIKI_CPU_DIRS += . dev $(SUBFAMILY)
CONTIKI_CPU_DIRS += rf rf-settings rf-settings/$(DEVICE_FAMILY_LC)
CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) $(DEBUG_IO_SOURCEFILES)
2018-08-03 13:34:20 +00:00
################################################################################
### Compiler configuration
# A weird behaviour of GCC garbage collector has been observed, where
# unitialized global variables with global linkage (aka non-static) put in the
# COMMON section weren't analyzed by the garbage collector at all. No idea why.
# The solution is to disable the common section, which subsequently places all
# unitialized global variables with global linkage in the .bss section,
# allowing the GC to analyze the variables. This is especially an issue with
# Board.h files, as they rely heavily on global variables placed in COMMON to
# be garbage collected if unused.
CFLAGS += -fno-common
2018-07-25 08:21:54 +00:00
################################################################################
### Linker configuration
2018-07-25 13:16:45 +00:00
# Linker flags
LDFLAGS += --entry resetISR
LDFLAGS += -static
LDFLAGS += --specs=nano.specs
2018-08-03 13:34:20 +00:00
# Linker script
LDSCRIPT := $(CONTIKI_CPU)/$(SUBFAMILY)/$(SUBFAMILY).lds
2018-08-03 13:34:20 +00:00
# Globally linked libraries
TARGET_LIBFILES += -lc -lgcc -lnosys
2018-07-25 08:21:54 +00:00
################################################################################
### Specialized build targets
2018-07-25 13:16:45 +00:00
.PHONY: FORCE
FORCE:
2018-07-25 13:16:45 +00:00
# Always re-build ieee-addr.o in case the command line passes a new NODEID
$(OBJECTDIR)/ieee-addr.o: ieee-addr.c FORCE | $(OBJECTDIR)
$(TRACE_CC)
$(Q)$(CC) $(CFLAGS) -c $< -o $@
2018-07-25 13:16:45 +00:00
# Always re-build ccfg-conf.c so any changes to CCFG configuration
# always applies
$(OBJECTDIR)/ccfg-conf.o: ccfg-conf.c FORCE | $(OBJECTDIR)
$(TRACE_CC)
2018-07-25 08:21:54 +00:00
$(Q)$(CC) $(CFLAGS) -c $< -o $@
2018-08-03 13:34:20 +00:00
################################################################################
### Sub-family Makefile
# Include the Sub-family Makefile specific for the specified device
2018-05-30 10:21:54 +00:00
include $(CONTIKI_CPU)/$(SUBFAMILY)/Makefile.$(SUBFAMILY)