Build the board file and add all libraries from the SDK
This commit is contained in:
parent
12c9056cec
commit
a40e5bc314
@ -7,6 +7,9 @@ LDFLAGS += -T $(LDSCRIPT)
|
||||
LDFLAGS += -Wl,--gc-sections,--sort-section=alignment
|
||||
LDFLAGS += -Wl,-Map=$(@:.elf=-$(TARGET).map),--cref,--no-warn-mismatch
|
||||
|
||||
TARGET_LIBFLAGS := ${addprefix -l:,$(TARGET_LIBFILES)}
|
||||
TARGET_LIBFLAGS += -gcc -lm -lnosys -lc
|
||||
|
||||
OBJCOPY_FLAGS += --gap-fill 0xff
|
||||
|
||||
### Build syscalls for newlib
|
||||
@ -19,8 +22,8 @@ CUSTOM_RULE_LINK = 1
|
||||
|
||||
.SECONDEXPANSION:
|
||||
|
||||
%.elf: $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(TARGET_LIBS) $(CONTIKI_NG_TARGET_LIB)
|
||||
%.elf: $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES)
|
||||
$(TRACE_LD)
|
||||
$(Q)$(LD) $(LDFLAGS) ${filter %.o %.a,$^} $(TARGET_LIBS) -o $@
|
||||
$(Q)$(LD) $(LDFLAGS) ${filter %.o %.a,$^} -Wl,--start-group $(TARGET_LIBFLAGS) -Wl,--end-group -o $@
|
||||
|
||||
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m
|
||||
|
@ -8,10 +8,11 @@ endif
|
||||
CFLAGS += -I$(CPU_ABS_PATH)/cc26x2_cc13x2
|
||||
CFLAGS += -I$(SDK_KERNEL)
|
||||
|
||||
TARGET_LIBFILES += $(SDK_DRIVERLIB)/bin/gcc/driverlib.lib
|
||||
TARGET_LIBFILES += $(SDK_DRIVERS)/rf/lib/rf_multiMode_cc13x2.am4fg
|
||||
TARGET_LIBFILES += $(SDK_DRIVERS)/lib/drivers_cc13x2.am4fg
|
||||
TARGET_LIBFILES += $(SDK_DRIVERS)/lib/rf_multiMode_cc13x2.am4fg
|
||||
TARGET_LIBFILES += $(SDK_KERNEL)/lib/nortos_cc13x2.am4fg
|
||||
TARGET_LIBFILES += $(SDK_DRIVERLIB)/bin/gcc/driverlib.lib
|
||||
|
||||
|
||||
|
||||
include $(CONTIKI)/arch/cpu/arm/cortex-m/cm4/Makefile.cm4
|
||||
|
@ -11,13 +11,9 @@ SDK_DRIVERS := $(SDK_SOURCE)/ti/drivers
|
||||
SDK_KERNEL := $(SIMPLELINK_SDK)/kernel/nortos
|
||||
SDK_BOARDS := $(SDK_SOURCE)/ti/boards
|
||||
SDK_STARTUP := $(SDK_DEVICE_SOURCE)/startup_files
|
||||
SDK_STARTUP_SRCS = ccfg.c startup_gcc.c
|
||||
SDK_STARTUP_SRCS = ccfg.c
|
||||
EXTERNALDIRS += $(SDK_STARTUP)
|
||||
|
||||
ifneq ($(SIMPLELINK_BOARD),CUSTOM)
|
||||
SDK_BOARDS := $(SDK_SOURCE)/ti/boards
|
||||
LDSCRIPT = $(SDK_BOARDS)/$(SIMPLELINK_BOARD)/$(SIMPLELINK_BOARD)_NoRTOS.lds
|
||||
endif
|
||||
|
||||
### 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
|
||||
@ -28,8 +24,17 @@ CFLAGS += -I$(SDK_DEVICE_SOURCE)/inc
|
||||
CFLAGS += -I$(SDK_KERNEL)
|
||||
CFLAGS += -I$(SDK_KERNEL)/posix
|
||||
|
||||
LDFLAGS += --entry resetISR
|
||||
LDFLAGS += -static
|
||||
LDFLAGS += --specs=nano.specs
|
||||
|
||||
SDK_BOARDS :=
|
||||
|
||||
ifneq ($(SIMPLELINK_BOARD),CUSTOM)
|
||||
SDK_BOARDS := $(SDK_SOURCE)/ti/boards
|
||||
LDSCRIPT = $(SDK_BOARDS)/$(SIMPLELINK_BOARD)/$(SIMPLELINK_BOARD)_NoRTOS.lds
|
||||
CFLAGS += -I$(SDK_BOARDS)/$(SIMPLELINK_BOARD)
|
||||
CONTIKI_SOURCEFILES += $(SIMPLELINK_BOARD).c
|
||||
endif
|
||||
|
||||
|
||||
@ -70,6 +75,10 @@ $(OBJECTDIR)/ccfg.o: ccfg.c FORCE | $(OBJECTDIR)
|
||||
$(TRACE_CC)
|
||||
$(Q)$(CC) $(CFLAGS) -include "ccfg-conf.h" -c $< -o $@
|
||||
|
||||
$(OBJECTDIR)/$(SIMPLELINK_BOARD).o: $(SDK_SOURCE)/ti/boards/$(SIMPLELINK_BOARD)/$(SIMPLELINK_BOARD).c
|
||||
$(TRACE_CC)
|
||||
$(Q)$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
RAM_SIZE = 0x00003E00
|
||||
FLASH_SIZE = 0x0001E000
|
||||
STACK_SIZE = 0
|
||||
|
@ -8,7 +8,7 @@ ifndef SIMPLELINK_SDK
|
||||
$(error SIMPLELINK_SDK not defined! You must specify where the SimpleLink SDK resides!)
|
||||
endif
|
||||
|
||||
AVAILABLE_BOARDS := $(shell ls $(SIMPLELINK_SDK)/source/ti/boards/)
|
||||
AVAILABLE_BOARDS := $(shell ls $(SIMPLELINK_SDK)/source/ti/boards)
|
||||
AVAILABLE_BOARDS += CUSTOM # Allows an own board file in the application project
|
||||
|
||||
ifndef SIMPLELINK_BOARD
|
||||
|
@ -50,6 +50,7 @@
|
||||
#include <Board.h>
|
||||
#include <ti/drivers/GPIO.h>
|
||||
#include <ti/drivers/Power.h>
|
||||
#include <NoRTOS.h>
|
||||
|
||||
|
||||
//#include "leds.h"
|
||||
@ -131,6 +132,8 @@ platform_init_stage_one()
|
||||
{
|
||||
Board_initGeneral();
|
||||
GPIO_init();
|
||||
NoRTOS_start();
|
||||
|
||||
GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);
|
||||
GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_OFF);
|
||||
// /* Enable flash cache and prefetch. */
|
||||
|
Loading…
Reference in New Issue
Block a user