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 ifdef USB_MSC_STREAMING
CONTIKI_CPU_DIRS += ../common/usb/msc 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 XMLDIRS += $(CONTIKI_CPU_ARM)/common/usb/msc
endif endif

View file

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