Use .u prefix for uploading to device and PROG variable to select programmer

This commit is contained in:
ksb 2010-02-10 10:08:36 +00:00
parent 1dfcf37ea4
commit 8e7ada96d3
2 changed files with 10 additions and 6 deletions

View file

@ -40,7 +40,7 @@ endif
ifdef USB_MSC_STREAMING
CONTIKI_CPU_DIRS += ../common/usb/msc
USB += usb-msc-bulk.c usb-streaming.c msc-scsi-transparent-descriptors.c msc-streaming-string-descriptors.c
USB += usb-msc-bulk.c usb-streaming.c msc-scsi-streaming-descriptors-consts.c msc-scsi-streaming-descriptors.c
XMLDIRS += $(CONTIKI_CPU_ARM)/common/usb/msc
endif

View file

@ -66,6 +66,9 @@ OPENOCD_CFG = arm7_wig.cfg
SAMIAM=Sam_I_Am
SAMIAM_TTY=/dev/ttyACM0
# Use OpenOCD by default
PROG=openocd
ARCH_FLAGS= -march=armv7-m -mthumb
CFLAGSNO = -I. -I$(CONTIKI)/core -I$(CONTIKI_CPU) -I$(CONTIKI_CPU)/loader \
@ -154,18 +157,19 @@ empty-symbols.c:
upload_ocd_%: %.bin
ifeq ($(PROG),openocd)
%.u: %.bin
# Clear lock bits
$(OPENOCD) -s $(OPENOCD_DIR) -f $(OPENOCD_CFG) -c init -c "reset halt;sleep 250;flash probe 0;stm32x mass_erase 0; sleep 500;flash write_bank 0 $< 0;reset halt;resume;sleep 500;exit"
upload_%: %.ihex
else ifeq ($(PROG),samiam)
%.u: %.ihex
# Clear lock bits
$(SAMIAM) "open $(SAMIAM_TTY) , writew 0xffffff64 5a000004"
$(SAMIAM) "open $(SAMIAM_TTY) , writew 0xffffff64 5a002004"
$(SAMIAM) "open $(SAMIAM_TTY) , flash $< , go"
endif
ocd_reset:
$(OPENOCD) -s $(OPENOCD_DIR) -f $(OPENOCD_CFG) -c init -c "reset halt;resume" -c exit