make flash: overhaul openocd configuration

Instead of OOCD_SERIAL triggering an attempt to use a specific ftdi based
adapter, introduce common target/interface pairs, OOCD_INTERFACE and
OOCD_TARGET, and an override via OOCD_FILE allowing full control.

Further, attempt to connect to a running openocd instance to flash if possible.
This _will not_ work well if you have multiple openocd instances open at once,
but that's a rare use case.

Examples:
OOCD_INTERFACE=stlink-v2
OOCD_TARGET=stm32f0x
 --> openocd ... -f interface/stlink-v2.cfg -f target/stm32f0x.cfg)

OOCD_FILE=board/ek-lm4f120xl.cfg
 --> openocd ... -f $(OOCD_FILE)  (ie, the variable is passed untouched)

As part of implementing this, correct variables that were always wrong, and
update the openocd flashing commands to use current commands.
This commit is contained in:
Karl Palsson
2016-04-18 01:14:19 +00:00
parent b227e1609c
commit bcd7d57c11
20 changed files with 33 additions and 38 deletions

View File

@@ -18,7 +18,7 @@
##
BINARY = miniblink
OOCD_FILE = board/ek-lm4f120xl.cfg
LDSCRIPT = ../ek-lm4f120xl.ld
include ../../Makefile.include

View File

@@ -18,7 +18,7 @@
##
BINARY = uart_echo_interrupt
OOCD_FILE = board/ek-lm4f120xl.cfg
LDSCRIPT = ../ek-lm4f120xl.ld
include ../../Makefile.include

View File

@@ -18,7 +18,7 @@
##
BINARY = uart_echo_simple
OOCD_FILE = board/ek-lm4f120xl.cfg
LDSCRIPT = ../ek-lm4f120xl.ld
include ../../Makefile.include

View File

@@ -18,7 +18,7 @@
##
BINARY = usb_bulk_dev
OOCD_FILE = board/ek-lm4f120xl.cfg
LDSCRIPT = ../ek-lm4f120xl.ld
include ../../Makefile.include

View File

@@ -18,7 +18,7 @@
##
BINARY = usb_to_serial_cdcacm
OOCD_FILE = board/ek-lm4f120xl.cfg
LDSCRIPT = ../ek-lm4f120xl.ld