1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/boards/cc2538dk/Makefile.include
Joakim Gebart 2cb7735ce2 cc2538dk: Add -mno-thumb-interwork.
Cortex-M processors only support Thumb instructions (no ARM mode code).

Signed-off-by: Joakim Gebart <joakim.gebart@eistec.se>
2015-01-28 13:52:53 +01:00

61 lines
2.1 KiB
Makefile

# Define the cpu used by the CC2538DK board:
export CPU = cc2538
export CPU_MODEL ?= cc2538nf53
# Define tools used for building the project:
export PREFIX ?= arm-none-eabi-
export CC = $(PREFIX)gcc
export CXX = $(PREFIX)g++
export AR = $(PREFIX)ar
export AS = $(PREFIX)as
export LINK = $(PREFIX)gcc
export SIZE = $(PREFIX)size
export OBJCOPY = $(PREFIX)objcopy
export OBJDUMP = $(PREFIX)objdump
export TERMPROG ?= $(RIOTBASE)/dist/tools/pyterm/pyterm
export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh
export DEBUGSERVER = JLinkGDBServer -device CC2538SF53
export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh
# Define the flash-tool and default port:
export PROGRAMMER ?= cc2538-bsl
ifeq ($(PROGRAMMER),cc2538-bsl)
export FLASHER = python $(RIOTBOARD)/$(BOARD)/dist/cc2538-bsl.py
export FFLAGS = -p "$(PORT)" -e -w -v $(HEXFILE)
else ifeq ($(PROGRAMMER),jlink)
export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh
export FFLAGS = $(BINDIR) $(HEXFILE)
endif
export PORT ?= /dev/ttyUSB1
# Define build specific options:
export CPU_USAGE = -mcpu=cortex-m3
export ASFLAGS += -ggdb -g3 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian
export CFLAGS += $(ASFLAGS) -std=gnu99 -mthumb -mno-thumb-interwork -nostartfiles -Os -Wall -Wstrict-prototypes -ffunction-sections -fdata-sections -fno-builtin
export LINKFLAGS += $(CFLAGS) -static -lgcc -T$(LINKERSCRIPT) -L$(RIOTCPU)/$(CPU)
export OFLAGS += -O binary --gap-fill 0xff
export HEXFILE = $(ELFFILE:.elf=.bin)
export TERMFLAGS += -p "$(PORT)"
export DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE)
export RESET_FLAGS = $(BINDIR)
export OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb
# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++
export CXXUWFLAGS +=
export CXXEXFLAGS +=
# Use the nano-specs of the NewLib when available:
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
export LINKFLAGS += -specs=nano.specs -lc -lnosys
endif
# Export board specific includes to the global includes-listing:
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include