From: batt Date: Fri, 4 Sep 2009 13:14:59 +0000 (+0000) Subject: Add support for stopping debugging/flashing. X-Git-Tag: 2.2.0~88 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=388d3841c38fe298c64cf14dafeb7d9800c774e3;hp=f9dc9733c08efd3594e61ba239afab633d1c1320;p=bertos.git Add support for stopping debugging/flashing. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2880 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cpu/arm/info/at91sam7.common b/bertos/cpu/arm/info/at91sam7.common index 1f3f9cb8..654cb0bc 100644 --- a/bertos/cpu/arm/info/at91sam7.common +++ b/bertos/cpu/arm/info/at91sam7.common @@ -71,7 +71,9 @@ SCRIPT_DIR = CPU_DIR + "arm/scripts/" HW_DIR = CPU_DIR + "arm/hw/" MK_FLASH_SCRIPT = PRG_SCRIPTS_DIR + "arm/flash.sh" +MK_STOPFLASH_SCRIPT = PRG_SCRIPTS_DIR + "arm/stopflash.sh" MK_DEBUG_SCRIPT = PRG_SCRIPTS_DIR + "arm/debug.sh" +MK_STOPDEBUG_SCRIPT = PRG_SCRIPTS_DIR + "arm/stopdebug.sh" GDB_INIT_SCRIPT = PRG_SCRIPTS_DIR + "arm/openocd/gdbinit-sam7" diff --git a/bertos/cpu/avr/info/avr.common b/bertos/cpu/avr/info/avr.common index 1dab8507..41b8d0d2 100644 --- a/bertos/cpu/avr/info/avr.common +++ b/bertos/cpu/avr/info/avr.common @@ -60,7 +60,9 @@ CPU_DEFAULT_FREQ = "8000000UL" SCRIPT_DIR = CPU_DIR + "avr/scripts/" MK_FLASH_SCRIPT = PRG_SCRIPTS_DIR + "avr/flash.sh" +MK_STOPFLASH_SCRIPT = PRG_SCRIPTS_DIR + "avr/stopflash.sh" MK_DEBUG_SCRIPT = PRG_SCRIPTS_DIR + "avr/debug.sh" +MK_STOPDEBUG_SCRIPT = PRG_SCRIPTS_DIR + "avr/stopdebug.sh" # Common GCC flags. MK_CPU_CPPFLAGS = "-Os -fno-strict-aliasing -I" + CPU_DIR + "avr/" diff --git a/bertos/rules.mk b/bertos/rules.mk index 11f8aebb..0bcefe63 100644 --- a/bertos/rules.mk +++ b/bertos/rules.mk @@ -261,6 +261,16 @@ flash_$(1): $(OUTDIR)/$(1).hex flash_$(1)_local .PHONY: flash_$(1)_local flash_$(1)_local: +.PHONY: stopflash_$(1) +stopflash_$(1): + $L "$(1): Stopping target flashing" + $Q if [ ! -f $$($(1)_STOPFLASH_SCRIPT) ] ; then \ + printf "No stopflash script found.\n" ; \ + exit 1 ; \ + fi + $Q $$($(1)_STOPFLASH_SCRIPT) ; + + # Debug target .PHONY: debug_$(1) debug_$(1): $(OUTDIR)/$(1).elf @@ -279,6 +289,15 @@ debug_$(1): $(OUTDIR)/$(1).elf exit 1 ; \ fi +.PHONY: stopdebug_$(1) +stopdebug_$(1): + $L "$(1): Stopping debugger" + $Q if [ ! -f $$($(1)_STOPDEBUG_SCRIPT) ] ; then \ + printf "No stopdebug script found.\n" ; \ + exit 1 ; \ + fi + $Q $$($(1)_STOPDEBUG_SCRIPT) ; + .PHONY: fuses_$(!) fuses_$(1): if [ ! -z "$$($(1)_efuse)" ] ; then \