116 lines
3.8 KiB
Makefile
116 lines
3.8 KiB
Makefile
################################################################################
|
|
# CC13xx/CC26xx CPU makefile
|
|
|
|
CC13x2_CC26x2_PRE_RTM ?= 1
|
|
|
|
# Core SDK is placed as a submodule under the arch/cpu/cc13xx-cc26xx/lib.
|
|
# Do a sanity check that Core SDK submodule has been initialized.
|
|
# 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.
|
|
ifeq ($(CORE_SDK),)
|
|
CORE_SDK := $(CONTIKI_CPU)/lib/coresdk_cc13xx_cc26xx
|
|
CORE_SDK_INIT := $(shell [ -f $(CORE_SDK)/.git ]; echo $$?)
|
|
ifeq ($(CORE_SDK_INIT),1)
|
|
$(error The Core SDK submodule is not available. Please run 'git submodule update --init --recursive')
|
|
endif
|
|
else
|
|
# Core SDK was overriden. Do a sanity check the path exists.
|
|
CORE_SDK_VALID := $(shell [ -d $(CORE_SDK) ]; echo $$?)
|
|
ifeq ($(CORE_SDK_VALID),1)
|
|
$(error Supplied CORE_SDK is not a valid path.)
|
|
endif
|
|
endif
|
|
# Clean up the path.
|
|
CORE_SDK := ${realpath $(CORE_SDK)}
|
|
|
|
# ccfg.c comes from the device-specific startp_files folder,
|
|
# and startup_cc13xx_cc26xx_gcc.c comes from NoRTOS startup folder
|
|
CPU_START_SOURCEFILES += ccfg.c startup_cc13xx_cc26xx_gcc.c
|
|
|
|
################################################################################
|
|
# Device Family
|
|
|
|
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
|
|
else
|
|
SDK_DEVICES_NAME := $(DEVICE_FAMILY_LC)
|
|
SDK_LIB_NAME := $(DEVICE_FAMILY_LC)
|
|
endif
|
|
|
|
################################################################################
|
|
# Simplelink SDK paths
|
|
|
|
SDK_KERNEL := $(CORE_SDK)/kernel/nortos
|
|
SDK_SOURCE := $(CORE_SDK)/source
|
|
SDK_BOARDS := $(SDK_SOURCE)/ti/boards
|
|
SDK_DRIVERS := $(SDK_SOURCE)/ti/drivers
|
|
SDK_DEVICE := $(SDK_SOURCE)/ti/devices/$(SDK_DEVICES_NAME)
|
|
|
|
EXTERNALDIRS += $(SDK_SOURCE)
|
|
EXTERNALDIRS += $(SDK_KERNEL)
|
|
EXTERNALDIRS += $(SDK_KERNEL)/startup
|
|
EXTERNALDIRS += $(SDK_DEVICE)
|
|
EXTERNALDIRS += $(SDK_DEVICE)/startup_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
|
|
CONTIKI_CPU_SOURCEFILES += ble-beacond.c
|
|
|
|
ifeq ($(SUPPORTS_PROP_MODE),1)
|
|
CONTIKI_CPU_SOURCEFILES += prop-mode.c prop-settings.c prop-tx-power.c
|
|
endif
|
|
|
|
ifeq ($(SUPPORTS_IEEE_MODE),1)
|
|
CONTIKI_CPU_SOURCEFILES += ieee-mode.c ieee-settings.c ieee-tx-power.c
|
|
endif
|
|
|
|
ifeq ($(SUPPORTS_BLE_BEACON),1)
|
|
CONTIKI_CPU_SOURCEFILES += ble-settings.c ble-tx-power.c
|
|
endif
|
|
|
|
### CPU-dependent debug source files
|
|
MODULES += os/lib/dbg-io
|
|
|
|
### CPU-dependent directories
|
|
CONTIKI_CPU_DIRS += . dev $(SUBFAMILY)
|
|
CONTIKI_CPU_DIRS += rf rf-settings rf-settings/$(DEVICE_FAMILY_LC)
|
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) $(DEBUG_IO_SOURCEFILES)
|
|
|
|
### Linker flag
|
|
LDFLAGS += --entry resetISR
|
|
LDFLAGS += -static
|
|
LDFLAGS += --specs=nano.specs
|
|
|
|
LDSCRIPT := $(CONTIKI_CPU)/$(SUBFAMILY)/$(SUBFAMILY).lds
|
|
|
|
### Always re-build ieee-addr.o in case the command line passes a new NODEID
|
|
FORCE:
|
|
|
|
$(OBJECTDIR)/ieee-addr.o: ieee-addr.c FORCE | $(OBJECTDIR)
|
|
$(TRACE_CC)
|
|
$(Q)$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
### Always re-build ccfg.c so changes to ccfg-conf.h will apply without having
|
|
### to make clean first
|
|
$(OBJECTDIR)/ccfg.o: ccfg.c FORCE | $(OBJECTDIR)
|
|
$(TRACE_CC)
|
|
$(Q)$(CC) $(CFLAGS) -include "ccfg-conf.h" -c $< -o $@
|
|
|
|
include $(CONTIKI_CPU)/$(SUBFAMILY)/Makefile.$(SUBFAMILY)
|