forked from auracaster/openocd
Added cc26xx flash driver to support the TI CC26xx and CC13xx microcontrollers. Driver is capable of determining which MCU is connected and configures itself accordingly. Added config files for four specific variants: CC26x0, CC13x0, CC26x2, and CC13x2. Note that the flash loader code is based on the sources used to support flash in Code Composer Studio and Uniflash from TI. Removed cc26xx.cfg file made obsolete by this patch. Change-Id: Ie2b0f74f8af7517a9184704b839677d1c9787862 Signed-off-by: Edward Fewell <efewell@ti.com> Reviewed-on: http://openocd.zylin.com/4358 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Fredrik Hederstierna <fredrik@hederstierna.com>
84 lines
1.9 KiB
Makefile
84 lines
1.9 KiB
Makefile
BIN2C = ../../../../src/helper/bin2char.sh
|
|
|
|
CROSS_COMPILE ?= arm-none-eabi-
|
|
GCC = $(CROSS_COMPILE)gcc
|
|
OBJCOPY = $(CROSS_COMPILE)objcopy
|
|
|
|
FLAGS = -mthumb -Os -ffunction-sections -fdata-sections -g -gdwarf-3
|
|
FLAGS += -gstrict-dwarf -Wall -fno-strict-aliasing --asm
|
|
|
|
CFLAGS = -c -I.
|
|
|
|
CC26X0_CFLAGS = -mcpu=cortex-m3 -DDEVICE_CC26X0
|
|
|
|
CC26X2_CFLAGS = -mcpu=cortex-m4 -DDEVICE_CC26X2
|
|
|
|
CC26X0_OBJS := \
|
|
cc26x0/flashloader.o \
|
|
cc26x0/main.o \
|
|
cc26x0/startup.o \
|
|
cc26x0/flash.o
|
|
|
|
CC26X2_OBJS := \
|
|
cc26x2/flashloader.o \
|
|
cc26x2/main.o \
|
|
cc26x2/startup.o \
|
|
cc26x2/flash.o
|
|
|
|
all: cc26x0_algo.inc cc26x2_algo.inc
|
|
|
|
cc26x0/%.o: %.c
|
|
@echo 'Building file: $<'
|
|
@echo 'Invoking: GNU Compiler'
|
|
$(GCC) $(FLAGS) $(CFLAGS) $(CC26X0_CFLAGS) -o"$@" "$(shell echo $<)"
|
|
@echo 'Finished building: $<'
|
|
@echo ' '
|
|
|
|
cc26x2/%.o: %.c
|
|
@echo 'Building file: $<'
|
|
@echo 'Invoking: GNU Compiler'
|
|
$(GCC) $(FLAGS) $(CFLAGS) $(CC26X2_CFLAGS) -o"$@" "$(shell echo $<)"
|
|
@echo 'Finished building: $<'
|
|
@echo ' '
|
|
|
|
cc26x0_algo.out: $(CC26X0_OBJS)
|
|
@echo 'Building target: $@'
|
|
@echo 'Invoking: GNU Linker'
|
|
$(GCC) $(FLAGS) -o$@ $(CC26X0_OBJS) -Wl,-T"cc26x0/cc26x0r2f.lds"
|
|
@echo 'Finished building target: $@'
|
|
@echo ' '
|
|
|
|
cc26x2_algo.out: $(CC26X2_OBJS)
|
|
@echo 'Building target: $@'
|
|
@echo 'Invoking: GNU Linker'
|
|
$(GCC) $(FLAGS) -o$@ $(CC26X2_OBJS) -Wl,-T"cc26x2/cc26x2r1f.lds"
|
|
@echo 'Finished building target: $@'
|
|
@echo ' '
|
|
|
|
%.bin: %.out
|
|
@echo 'Building target: $@'
|
|
@echo 'Invoking: GNU Objcopy Utility'
|
|
$(OBJCOPY) -Obinary $< $@
|
|
@echo 'Finished building target: $@'
|
|
@echo ' '
|
|
|
|
%.inc: %.bin
|
|
@echo 'Building target: $@'
|
|
@echo 'Invoking Bin2Char Script'
|
|
$(BIN2C) < $< > $@
|
|
rm $< $*.out
|
|
@echo 'Finished building target: $@'
|
|
@echo ' '
|
|
|
|
clean:
|
|
@echo 'Cleaning Targets and Build Artifacts'
|
|
rm -rf *.inc *.bin *.out *.map
|
|
rm -rf cc26x0/*.o cc26x0/*.d
|
|
rm -rf cc26x2/*.o cc26x2/*.d
|
|
@echo 'Finished clean'
|
|
@echo ' '
|
|
|
|
.PRECIOUS: %.bin
|
|
|
|
.PHONY: all clean
|