From b7e9c2ee2a5fe5c227be6bd8c8a4285f092dfb95 Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Sat, 25 Feb 2012 12:35:29 -0500 Subject: [PATCH] build: use board-specific JTAG interface for openocd Removes hard-coding of JTAG interface config in the _program make macros. This allows the use of STLINKv2 for F4 boards while continuing to use the FOSS JTAG revB on F1 boards. --- make/boards/pipxtreme/board-info.mk | 3 +++ make/firmware-defs.mk | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/make/boards/pipxtreme/board-info.mk b/make/boards/pipxtreme/board-info.mk index 045721092..0a3e888c7 100644 --- a/make/boards/pipxtreme/board-info.mk +++ b/make/boards/pipxtreme/board-info.mk @@ -17,6 +17,9 @@ OPENOCD_CONFIG := stm32f1x.cfg OPENOCD_JTAG_CONFIG := foss-jtag.revb.cfg OPENOCD_CONFIG := stm32f1x.cfg +OPENOCD_JTAG_CONFIG := foss-jtag.revb.cfg +OPENOCD_CONFIG := stm32f1x.cfg + # Note: These must match the values in link_$(BOARD)_memory.ld BL_BANK_BASE := 0x08000000 # Start of bootloader flash BL_BANK_SIZE := 0x00003000 # Should include BD_INFO region diff --git a/make/firmware-defs.mk b/make/firmware-defs.mk index 3ead53444..522d2e320 100644 --- a/make/firmware-defs.mk +++ b/make/firmware-defs.mk @@ -210,7 +210,8 @@ endef # $(1) = Name of binary image to write # $(2) = Base of flash region to write/wipe # $(3) = Size of flash region to write/wipe -# $(4) = OpenOCD configuration file to use +# $(4) = OpenOCD JTAG interface configuration file to use +# $(5) = OpenOCD configuration file to use define JTAG_TEMPLATE # --------------------------------------------------------------------------- # Options for OpenOCD flash-programming @@ -223,7 +224,7 @@ OOCD_EXE ?= openocd OOCD_JTAG_SETUP = -d0 # interface and board/target settings (using the OOCD target-library here) OOCD_JTAG_SETUP += -s $(TOP)/flight/Project/OpenOCD -OOCD_JTAG_SETUP += -f foss-jtag.revb.cfg -f $(4) +OOCD_JTAG_SETUP += -f $(4) -f $(5) # initialize OOCD_BOARD_RESET = -c init