2018-05-28 11:17:01 +00:00
|
|
|
################################################################################
|
2018-07-25 08:21:54 +00:00
|
|
|
### CC13xx/CC26xx CPU makefile
|
2018-05-28 11:17:01 +00:00
|
|
|
|
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.
|
|
|
|
ifeq ($(CORE_SDK),)
|
|
|
|
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)
|
|
|
|
ifeq ($(CORE_SDK_INIT),)
|
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)
|
|
|
|
ifeq ($(CORE_SDK_VALID),)
|
2018-07-24 15:46:42 +00:00
|
|
|
$(error Supplied CORE_SDK is not a valid path.)
|
|
|
|
endif
|
|
|
|
endif
|
2018-07-25 08:21:54 +00:00
|
|
|
|
2018-07-24 15:46:42 +00:00
|
|
|
# Clean up the path.
|
2018-07-25 08:21:54 +00:00
|
|
|
CORE_SDK := $(realpath $(CORE_SDK))
|
2018-07-24 15:46:42 +00:00
|
|
|
|
2018-07-25 08:21:54 +00:00
|
|
|
# Both ccfg.c and startup_cc13xx_cc26xx_gcc.c is located locally in
|
|
|
|
# the arch/cpu/cc13xx-cc26xx folder.
|
2018-05-28 11:17:01 +00:00
|
|
|
CPU_START_SOURCEFILES += ccfg.c startup_cc13xx_cc26xx_gcc.c
|
|
|
|
|
|
|
|
################################################################################
|
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 he same as its own device family name.
|
2018-05-28 11:17:01 +00:00
|
|
|
else
|
2018-07-24 16:42:00 +00:00
|
|
|
SDK_DEVICES_NAME := $(DEVICE_FAMILY_LC)
|
|
|
|
SDK_LIB_NAME := $(DEVICE_FAMILY_LC)
|
2018-05-28 11:17:01 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
################################################################################
|
2018-07-25 08:21:54 +00:00
|
|
|
### Core SDK paths
|
2018-05-28 11:17:01 +00:00
|
|
|
|
2018-07-25 08:21:54 +00:00
|
|
|
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)
|
2018-05-28 11:17:01 +00:00
|
|
|
|
|
|
|
EXTERNALDIRS += $(SDK_SOURCE)
|
2018-07-25 08:21:54 +00:00
|
|
|
EXTERNALDIRS += $(SDK_NORTOS)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
### CC13xx/CC26xx CPU files
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# RF source files
|
|
|
|
CONTIKI_CPU_SOURCEFILES += sched.c data-queue.c
|
|
|
|
CONTIKI_CPU_SOURCEFILES += ieee-addr.c ble-addr.c
|
2018-07-19 14:44:39 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
# 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)
|
2018-07-19 14:44:39 +00:00
|
|
|
CONTIKI_CPU_DIRS += rf rf-settings rf-settings/$(DEVICE_FAMILY_LC)
|
2018-05-28 11:17:01 +00:00
|
|
|
|
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) $(DEBUG_IO_SOURCEFILES)
|
|
|
|
|
2018-07-25 08:21:54 +00:00
|
|
|
################################################################################
|
|
|
|
### Linker configuration
|
|
|
|
|
|
|
|
# Linker flag
|
2018-05-28 11:17:01 +00:00
|
|
|
LDFLAGS += --entry resetISR
|
|
|
|
LDFLAGS += -static
|
|
|
|
LDFLAGS += --specs=nano.specs
|
|
|
|
|
|
|
|
LDSCRIPT := $(CONTIKI_CPU)/$(SUBFAMILY)/$(SUBFAMILY).lds
|
|
|
|
|
2018-07-25 08:21:54 +00:00
|
|
|
################################################################################
|
|
|
|
### Specialized build targets
|
|
|
|
|
|
|
|
# Always re-build ieee-addr.o in case the command line passes a new NODEID
|
2018-05-28 11:17:01 +00:00
|
|
|
FORCE:
|
|
|
|
|
|
|
|
$(OBJECTDIR)/ieee-addr.o: ieee-addr.c FORCE | $(OBJECTDIR)
|
|
|
|
$(TRACE_CC)
|
|
|
|
$(Q)$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2018-07-25 08:21:54 +00:00
|
|
|
# Always re-build ccfg.c so changes to ccfg-conf.h will apply without having
|
|
|
|
# to make clean first
|
2018-05-28 11:17:01 +00:00
|
|
|
$(OBJECTDIR)/ccfg.o: ccfg.c FORCE | $(OBJECTDIR)
|
|
|
|
$(TRACE_CC)
|
2018-07-25 08:21:54 +00:00
|
|
|
$(Q)$(CC) $(CFLAGS) -c $< -o $@
|
2018-05-28 11:17:01 +00:00
|
|
|
|
2018-07-25 08:21:54 +00:00
|
|
|
# Include the Sub-family specific Makefile
|
2018-05-30 10:21:54 +00:00
|
|
|
include $(CONTIKI_CPU)/$(SUBFAMILY)/Makefile.$(SUBFAMILY)
|