2018-02-05 16:18:08 +00:00
|
|
|
|
2018-02-08 11:56:35 +00:00
|
|
|
MODULES += os/net/mac/framer
|
2018-02-08 10:45:47 +00:00
|
|
|
|
2018-02-05 16:18:08 +00:00
|
|
|
CPU_ABS_PATH = $(CONTIKI)/arch/cpu/simplelink
|
|
|
|
|
|
|
|
SDK_SOURCE := $(SIMPLELINK_SDK)/source
|
|
|
|
# TODO fix switch
|
|
|
|
SDK_DEVICES := $(SDK_SOURCE)/ti/devices
|
|
|
|
SDK_DEVICE := $(shell ls $(SDK_DEVICES) | grep $(SIMPLELINK_DEVICE))
|
|
|
|
SDK_DEVICE_SOURCE := $(SDK_SOURCE)/ti/devices/$(SDK_DEVICE)
|
|
|
|
SDK_DRIVERLIB := $(SDK_DEVICE_SOURCE)/driverlib
|
2018-02-06 11:30:10 +00:00
|
|
|
SDK_DRIVERS := $(SDK_SOURCE)/ti/drivers
|
2018-02-06 14:18:07 +00:00
|
|
|
SDK_KERNEL := $(SIMPLELINK_SDK)/kernel/nortos
|
|
|
|
SDK_BOARDS := $(SDK_SOURCE)/ti/boards
|
2018-02-05 16:18:08 +00:00
|
|
|
SDK_STARTUP := $(SDK_DEVICE_SOURCE)/startup_files
|
2018-02-06 17:05:51 +00:00
|
|
|
SDK_STARTUP_SRCS := ccfg.c
|
2018-02-06 15:46:25 +00:00
|
|
|
|
2018-02-05 16:18:08 +00:00
|
|
|
EXTERNALDIRS += $(SDK_STARTUP)
|
|
|
|
|
2018-02-06 13:30:50 +00:00
|
|
|
|
2018-02-05 16:18:08 +00:00
|
|
|
### MODULES will add some of these to the include path, but we need to add
|
|
|
|
### them earlier to prevent filename clashes with Contiki core files
|
2018-02-06 11:30:10 +00:00
|
|
|
CFLAGS += -I$(CPU_ABS_PATH)
|
2018-02-06 17:05:51 +00:00
|
|
|
CFLAGS += -I$(CPU_ABS_PATH)/source
|
2018-02-05 16:18:08 +00:00
|
|
|
CFLAGS += -I$(SDK_SOURCE)
|
|
|
|
CFLAGS += -I$(SDK_DEVICE_SOURCE)
|
|
|
|
CFLAGS += -I$(SDK_DEVICE_SOURCE)/inc
|
2018-02-06 11:30:10 +00:00
|
|
|
CFLAGS += -I$(SDK_KERNEL)
|
|
|
|
CFLAGS += -I$(SDK_KERNEL)/posix
|
2018-02-05 16:18:08 +00:00
|
|
|
|
2018-02-06 15:22:02 +00:00
|
|
|
LDFLAGS += --entry resetISR
|
|
|
|
LDFLAGS += -static
|
|
|
|
LDFLAGS += --specs=nano.specs
|
2018-02-14 16:56:35 +00:00
|
|
|
# NB! The symbol _stack, pointing to the stack start, is expected,
|
|
|
|
# but should already be defined in the linker script.
|
|
|
|
LDFLAGS += -Wl,--defsym=_stack_origin=__stack_end
|
2018-02-06 17:05:51 +00:00
|
|
|
LDFLAGS += -Wl,--defsym=_heap=__heap_start__
|
|
|
|
LDFLAGS += -Wl,--defsym=_eheap=__heap_end__
|
2018-02-06 15:22:02 +00:00
|
|
|
|
|
|
|
SDK_BOARDS :=
|
|
|
|
|
2018-02-06 13:30:50 +00:00
|
|
|
ifneq ($(SIMPLELINK_BOARD),CUSTOM)
|
2018-02-06 15:22:02 +00:00
|
|
|
SDK_BOARDS := $(SDK_SOURCE)/ti/boards
|
|
|
|
LDSCRIPT = $(SDK_BOARDS)/$(SIMPLELINK_BOARD)/$(SIMPLELINK_BOARD)_NoRTOS.lds
|
2018-02-06 13:30:50 +00:00
|
|
|
CFLAGS += -I$(SDK_BOARDS)/$(SIMPLELINK_BOARD)
|
2018-02-06 15:22:02 +00:00
|
|
|
CONTIKI_SOURCEFILES += $(SIMPLELINK_BOARD).c
|
2018-02-06 15:41:15 +00:00
|
|
|
else
|
|
|
|
ifndef $(LDSCRIPT)
|
|
|
|
$(error You must speficy a custom linker script in LDSCRIPT.)
|
|
|
|
endif
|
2018-02-06 13:30:50 +00:00
|
|
|
endif
|
|
|
|
|
2018-02-05 16:18:08 +00:00
|
|
|
|
|
|
|
### If the user-specified a Node ID, pass a define
|
|
|
|
ifdef NODEID
|
|
|
|
CFLAGS += -DIEEE_ADDR_NODE_ID=$(NODEID)
|
|
|
|
endif
|
|
|
|
|
|
|
|
### CPU-dependent directories
|
|
|
|
CONTIKI_ARM_DIRS += . common/dbg-io
|
|
|
|
CONTIKI_CPU_DIRS += . $(addprefix ../arm/, $(CPU_DIRS))
|
2018-02-08 10:45:47 +00:00
|
|
|
CONTIKI_CPU_DIRS += dev rf-settings
|
2018-02-05 16:18:08 +00:00
|
|
|
|
|
|
|
### CPU-dependent source files
|
2018-02-06 17:05:51 +00:00
|
|
|
CONTIKI_CPU_SOURCEFILES += rtimer-arch.c clock-arch.c
|
2018-02-07 15:58:16 +00:00
|
|
|
CONTIKI_CPU_SOURCEFILES += watchdog-arch.c putchar-arch.c
|
2018-02-08 11:42:06 +00:00
|
|
|
CONTIKI_CPU_SOURCEFILES += uart0-arch.c
|
2018-02-14 16:56:35 +00:00
|
|
|
CONTIKI_CPU_SOURCEFILES += rf-core.c
|
|
|
|
CONTIKI_CPU_SOURCEFILES += rf-prop-mode.c rf-prop-settings.c
|
|
|
|
CONTIKI_CPU_SOURCEFILES += rf-ieee-mode.c rf-ieee-settings.c
|
2018-02-09 11:50:55 +00:00
|
|
|
CONTIKI_CPU_SOURCEFILES += ieee-addr.c
|
2018-02-05 16:18:08 +00:00
|
|
|
|
2018-02-08 11:42:06 +00:00
|
|
|
### CPU-dependent debug source files
|
2018-02-07 15:58:16 +00:00
|
|
|
DEBUG_IO_SOURCEFILES += dbg-printf.c dbg-snprintf.c dbg-sprintf.c strformat.c
|
2018-02-05 16:18:08 +00:00
|
|
|
|
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) $(DEBUG_IO_SOURCEFILES)
|
|
|
|
|
|
|
|
CPU_START_SOURCEFILES += $(SDK_STARTUP_SRCS)
|
|
|
|
|
|
|
|
### 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)
|
2018-02-06 14:18:07 +00:00
|
|
|
$(Q)$(CC) $(CFLAGS) -include "ccfg-conf.h" -c $< -o $@
|
2018-02-05 16:18:08 +00:00
|
|
|
|
2018-02-06 15:41:15 +00:00
|
|
|
$(OBJECTDIR)/$(SIMPLELINK_BOARD).o: $(SDK_BOARDS)/$(SIMPLELINK_BOARD)/$(SIMPLELINK_BOARD).c
|
2018-02-06 15:22:02 +00:00
|
|
|
$(TRACE_CC)
|
|
|
|
$(Q)$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2018-02-05 16:18:08 +00:00
|
|
|
RAM_SIZE = 0x00003E00
|
|
|
|
FLASH_SIZE = 0x0001E000
|
|
|
|
STACK_SIZE = 0
|
|
|
|
%.size: %.$(TARGET)
|
|
|
|
@$(SIZE) -A $< | egrep "data|bss" | awk '{s+=$$2} END {s=s+$(STACK_SIZE); f=$(RAM_SIZE)-s; printf "[RAM] used %6d, free %6d\n",s,f;}'
|
|
|
|
@$(SIZE) -A $< | egrep "text|isr_vector" | awk '{s+=$$2} END {f=$(FLASH_SIZE)-s; printf "[Flash] used %6d, free %6d\n",s,f;}'
|
|
|
|
|
|
|
|
UART_BAUDRATE = 115200
|
|
|
|
|
|
|
|
login:
|
|
|
|
$(SERIALDUMP) -b$(UART_BAUDRATE) $(PORT)
|
|
|
|
|
|
|
|
# TODO fix switch
|
|
|
|
include $(CPU_ABS_PATH)/Makefile.cc26x2_cc13x2
|