1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

OP-439: Simplify further. Abstract most of the OOCD flags into the common

firmware include and delete all the extra foss-jtag config files.  There is now
a legacy file for the revA board a second for AHRS that changes the port
This commit is contained in:
James Cotton 2011-04-24 10:19:00 -05:00
parent ee7179bd53
commit 69d03ca101
20 changed files with 52 additions and 390 deletions

View File

@ -304,43 +304,16 @@ LDFLAGS += -lc -lgcc
# Set linker-script name depending on selected submodel name
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
# ---------------------------------------------------------------------------
# Options for OpenOCD flash-programming
# see openocd.pdf/openocd.texi for further information
#
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
OOCD_EXE=openocd
# debug level
OOCD_CL=-d0
# interface and board/target settings (using the OOCD target-library here)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.ahrs.posix.cfg -f ../Project/OpenOCD/stm32.cfg
else
ifeq ($(UNAME), Linux)
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.ahrs.posix.cfg -f ../Project/OpenOCD/stm32.cfg
else
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.ahrs.win.cfg -f ../Project/OpenOCD/stm32.cfg
endif
endif
# initialize
OOCD_CL+=-c init
# show the targets
OOCD_CL+=-c targets
# commands to prepare flash-write
OOCD_CL+= -c "reset halt"
# flash erase
OOCD_CL+=-c "stm32x mass_erase 0"
# flash-write
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# Program
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
# Verify
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
# reset target
OOCD_CL+=-c "reset run"
# terminate OOCD after programming
# # terminate OOCD after programming
OOCD_CL+=-c shutdown
# ---------------------------------------------------------------------------
# Define programs and commands.
REMOVE = $(REMOVE_CMD) -f

View File

@ -291,35 +291,8 @@ LDFLAGS += -lc -lgcc
# Set linker-script name depending on selected submodel name
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
# ---------------------------------------------------------------------------
# Options for OpenOCD flash-programming
# see openocd.pdf/openocd.texi for further information
#
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
OOCD_EXE=openocd
# debug level
OOCD_CL=-d0
# interface and board/target settings (using the OOCD target-library here)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.ahrs.posix.cfg -f ../../Project/OpenOCD/stm32.cfg
else
ifeq ($(UNAME), Linux)
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.ahrs.posix.cfg -f ../../Project/OpenOCD/stm32.cfg
else
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.ahrs.win.cfg -f ../../Project/OpenOCD/stm32.cfg
endif
endif
# initialize
OOCD_CL+=-c init
# show the targets
OOCD_CL+=-c targets
# commands to prepare flash-write
OOCD_CL+= -c "reset halt"
# flash erase
OOCD_CL+=-c "stm32x mass_erase 0"
# flash-write
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# Program
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
# Verify
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
@ -327,8 +300,6 @@ OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
OOCD_CL+=-c "reset run"
# terminate OOCD after programming
OOCD_CL+=-c shutdown
# ---------------------------------------------------------------------------
# Define programs and commands.
REMOVE = $(REMOVE_CMD) -f

View File

@ -330,45 +330,15 @@ else
quote =
endif
# ---------------------------------------------------------------------------
# Options for OpenOCD flash-programming
# see openocd.pdf/openocd.texi for further information
#
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
OOCD_EXE=openocd
# debug level
OOCD_CL=-d0
# interface and board/target settings (using the OOCD target-library here)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../../Project/OpenOCD/stm32.cfg
else
ifeq ($(UNAME), Linux)
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../../Project/OpenOCD/stm32.cfg
else
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.win.cfg -f ../../Project/OpenOCD/stm32.cfg
endif
endif
# initialize
OOCD_CL+=-c init
# show the targets
OOCD_CL+=-c targets
# commands to prepare flash-write
OOCD_CL+= -c "reset halt"
# flash erase
OOCD_CL+=-c "stm32x mass_erase 0"
# flash-write
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# Program
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
# Verify
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
# reset target
OOCD_CL+=-c "reset run"
# terminate OOCD after programming
OOCD_CL+=-c shutdown
# ---------------------------------------------------------------------------
# Define programs and commands.
CC = $(TCHAIN_PREFIX)gcc

View File

@ -370,44 +370,15 @@ LDFLAGS += -lc -lgcc
# Set linker-script name depending on selected submodel name
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
# ---------------------------------------------------------------------------
# Options for OpenOCD flash-programming
# see openocd.pdf/openocd.texi for further information
#
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
OOCD_EXE=openocd
# debug level
OOCD_CL=-d0
# interface and board/target settings (using the OOCD target-library here)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../../Project/OpenOCD/stm32.cfg
else
ifeq ($(UNAME), Linux)
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../../Project/OpenOCD/stm32.cfg
else
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.win.cfg -f ../../Project/OpenOCD/stm32.cfg
endif
endif
# initialize
OOCD_CL+=-c init
# show the targets
OOCD_CL+=-c targets
# commands to prepare flash-write
OOCD_CL+= -c "reset halt"
# flash erase
OOCD_CL+=-c "stm32x mass_erase 0"
# flash-write
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# Program
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
# Verify
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
# reset target
OOCD_CL+=-c "reset run"
# terminate OOCD after programming
OOCD_CL+=-c shutdown
# ---------------------------------------------------------------------------
# Define programs and commands.
REMOVE = $(REMOVE_CMD) -f

View File

@ -371,44 +371,15 @@ LDFLAGS += -lc -lgcc
# Set linker-script name depending on selected submodel name
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
# ---------------------------------------------------------------------------
# Options for OpenOCD flash-programming
# see openocd.pdf/openocd.texi for further information
#
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
OOCD_EXE=openocd
# debug level
OOCD_CL=-d0
# interface and board/target settings (using the OOCD target-library here)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../../Project/OpenOCD/stm32.cfg
else
ifeq ($(UNAME), Linux)
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../../Project/OpenOCD/stm32.cfg
else
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.win.cfg -f ../../Project/OpenOCD/stm32.cfg
endif
endif
# initialize
OOCD_CL+=-c init
# show the targets
OOCD_CL+=-c targets
# commands to prepare flash-write
OOCD_CL+= -c "reset halt"
# flash erase
OOCD_CL+=-c "stm32x mass_erase 0"
# flash-write
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# Program
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
# Verify
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
# reset target
OOCD_CL+=-c "reset run"
# terminate OOCD after programming
OOCD_CL+=-c shutdown
# ---------------------------------------------------------------------------
# Define programs and commands.
REMOVE = $(REMOVE_CMD) -f

View File

@ -370,44 +370,15 @@ LDFLAGS += -lc -lgcc
# Set linker-script name depending on selected submodel name
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
# ---------------------------------------------------------------------------
# Options for OpenOCD flash-programming
# see openocd.pdf/openocd.texi for further information
#
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
OOCD_EXE=openocd
# debug level
OOCD_CL=-d0
# interface and board/target settings (using the OOCD target-library here)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../../Project/OpenOCD/stm32.cfg
else
ifeq ($(UNAME), Linux)
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../../Project/OpenOCD/stm32.cfg
else
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.win.cfg -f ../../Project/OpenOCD/stm32.cfg
endif
endif
# initialize
OOCD_CL+=-c init
# show the targets
OOCD_CL+=-c targets
# commands to prepare flash-write
OOCD_CL+= -c "reset halt"
# flash erase
OOCD_CL+=-c "stm32x mass_erase 0"
# flash-write
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# Program
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
# Verify
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
# reset target
OOCD_CL+=-c "reset run"
# terminate OOCD after programming
OOCD_CL+=-c shutdown
# ---------------------------------------------------------------------------
# Define programs and commands.
REMOVE = $(REMOVE_CMD) -f

View File

@ -477,35 +477,8 @@ LDFLAGS += -lc -lgcc
# Set linker-script name depending on selected submodel name
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
# ---------------------------------------------------------------------------
# Options for OpenOCD flash-programming
# see openocd.pdf/openocd.texi for further information
#
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
OOCD_EXE=openocd
# debug level
OOCD_CL=-d0
# interface and board/target settings (using the OOCD target-library here)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../Project/OpenOCD/stm32.cfg
else
ifeq ($(UNAME), Linux)
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../Project/OpenOCD/stm32.cfg
else
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.win.cfg -f ../Project/OpenOCD/stm32.cfg
endif
endif
# initialize
OOCD_CL+=-c init
# show the targets
OOCD_CL+=-c targets
# commands to prepare flash-write
OOCD_CL+= -c "reset halt"
# flash erase
OOCD_CL+=-c "stm32x mass_erase 0"
# flash-write
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# Program
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
# Verify
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
@ -513,7 +486,6 @@ OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
OOCD_CL+=-c "reset run"
# terminate OOCD after programming
OOCD_CL+=-c shutdown
# ---------------------------------------------------------------------------
# Define programs and commands.
REMOVE = $(REMOVE_CMD) -f

View File

@ -313,43 +313,15 @@ LDFLAGS += -lc -lgcc
# Set linker-script name depending on selected submodel name
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
# ---------------------------------------------------------------------------
# Options for OpenOCD flash-programming
# see openocd.pdf/openocd.texi for further information
#
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
OOCD_EXE=openocd
# debug level
OOCD_CL=-d0
# interface and board/target settings (using the OOCD target-library here)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../Project/OpenOCD/stm32.cfg
else
ifeq ($(UNAME), Linux)
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../Project/OpenOCD/stm32.cfg
else
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.win.cfg -f ../Project/OpenOCD/stm32.cfg
endif
endif
# initialize
OOCD_CL+=-c init
# show the targets
OOCD_CL+=-c targets
# commands to prepare flash-write
OOCD_CL+= -c "reset halt"
# flash erase
OOCD_CL+=-c "stm32x mass_erase 0"
# flash-write
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# Program
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
# Verify
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
# reset target
OOCD_CL+=-c "reset run"
# terminate OOCD after programming
# # terminate OOCD after programming
OOCD_CL+=-c shutdown
# ---------------------------------------------------------------------------
# Define programs and commands.
REMOVE = $(REMOVE_CMD) -f

View File

@ -459,35 +459,8 @@ LDFLAGS += -lc -lgcc
# Set linker-script name depending on selected submodel name
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
# ---------------------------------------------------------------------------
# Options for OpenOCD flash-programming
# see openocd.pdf/openocd.texi for further information
#
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
OOCD_EXE=openocd
# debug level
OOCD_CL=-d0
# interface and board/target settings (using the OOCD target-library here)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../Project/OpenOCD/stm32.cfg
else
ifeq ($(UNAME), Linux)
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.posix.cfg -f ../Project/OpenOCD/stm32.cfg
else
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.win.cfg -f ../Project/OpenOCD/stm32.cfg
endif
endif
# initialize
OOCD_CL+=-c init
# show the targets
OOCD_CL+=-c targets
# commands to prepare flash-write
OOCD_CL+= -c "reset halt"
# flash erase
OOCD_CL+=-c "stm32x mass_erase 0"
# flash-write
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# Program
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
# Verify
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
@ -495,7 +468,7 @@ OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
OOCD_CL+=-c "reset run"
# terminate OOCD after programming
OOCD_CL+=-c shutdown
# ---------------------------------------------------------------------------
# Define programs and commands.
REMOVE = $(REMOVE_CMD) -f

View File

@ -349,44 +349,15 @@ LDFLAGS += -lc -lgcc
# Set linker-script name depending on selected submodel name
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
# ---------------------------------------------------------------------------
# Options for OpenOCD flash-programming
# see openocd.pdf/openocd.texi for further information
#
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
OOCD_EXE=openocd
# debug level
OOCD_CL=-d0
# interface and board/target settings (using the OOCD target-library here)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.pipxtreme.posix.cfg -f ../Project/OpenOCD/stm32.cfg
else
ifeq ($(UNAME), Linux)
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.pipxtreme.posix.cfg -f ../Project/OpenOCD/stm32.cfg
else
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.pipxtreme.win.cfg -f ../Project/OpenOCD/stm32.cfg
endif
endif
# initialize
OOCD_CL+=-c init
# show the targets
OOCD_CL+=-c targets
# commands to prepare flash-write
OOCD_CL+= -c "reset halt"
# flash erase
OOCD_CL+=-c "stm32x mass_erase 0"
# flash-write
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# Program
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
# Verify
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
# reset target
OOCD_CL+=-c "reset run"
# terminate OOCD after programming
OOCD_CL+=-c shutdown
# ---------------------------------------------------------------------------
# Define programs and commands.
REMOVE = $(REMOVE_CMD) -f

View File

@ -1,15 +0,0 @@
#
# Floss JTAG for AHRS
#
interface ft2232
ft2232_vid_pid 0x0403 0x6010
ft2232_device_desc "Dual RS232-HS"
#ft2232_bus_addr "002:103"
#ft2232_serial "1234567890"
ft2232_layout "usbjtag"
ft2232_latency 2
gdb_port 3334
tcl_port 6667
telnet_port 4445

View File

@ -1,15 +0,0 @@
#
# Floss JTAG OpenPilot
#
interface ft2232
ft2232_vid_pid 0x0403 0x6010
#ft2232_device_desc "Dual RS232-HS"
#ft2232_bus_addr "002:088"
#ft2232_serial "1234567890"
ft2232_layout "usbjtag"
ft2232_latency 2
gdb_port 3333
tcl_port 6666
telnet_port 4444

View File

@ -1,15 +0,0 @@
#
# Floss JTAG OpenPilot
#
interface ft2232
ft2232_vid_pid 0x0403 0x6010
ft2232_device_desc "Dual RS232-HS"
#ft2232_bus_addr "002:088"
#ft2232_serial "1234567890"
ft2232_layout "usbjtag"
ft2232_latency 2
gdb_port 3333
tcl_port 6666
telnet_port 4444

View File

@ -1,15 +0,0 @@
#
# Floss JTAG OpenPilot
#
interface ft2232
ft2232_vid_pid 0x0403 0x6010
#ft2232_device_desc "Dual RS232-HS"
#ft2232_bus_addr "002:088"
#ft2232_serial "1234567890"
ft2232_layout "usbjtag"
ft2232_latency 2
gdb_port 3334
tcl_port 6666
telnet_port 4444

View File

@ -1,15 +0,0 @@
#
# Floss JTAG for AHRS
#
interface ft2232
ft2232_vid_pid 0x0403 0x6010
ft2232_device_desc "Dual RS232-HS"
#ft2232_bus_addr "002:103"
#ft2232_serial "1234567890"
ft2232_layout "usbjtag"
ft2232_latency 2
gdb_port 3334
tcl_port 6667
telnet_port 4445

View File

@ -1,5 +1,5 @@
define connect
target remote localhost:3334
target remote localhost:3333
monitor cortex_m3 vector_catch all
file ./Build/PipXtreme.elf
end

View File

@ -143,3 +143,25 @@ $($(1):.c=.s) : %.s : %.c
$(V1) $(CC) -S $$(CFLAGS) $$(CONLYFLAGS) $$< -o $$@
endef
# ---------------------------------------------------------------------------
# # Options for OpenOCD flash-programming
# see openocd.pdf/openocd.texi for further information
# #
# OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
OOCD_EXE=openocd
# debug level
OOCD_CL=-d0
# interface and board/target settings (using the OOCD target-library here)
OOCD_CL+=-s $(TOP)/flight/Project/OpenOCD
OOCD_CL+=-f foss-jtag.revb.cfg -f stm32.cfg
# initialize
OOCD_CL+=-c init
# show the targets
OOCD_CL+=-c targets
# commands to prepare flash-write
OOCD_CL+= -c "reset halt"
# flash erase
OOCD_CL+=-c "stm32x mass_erase 0"
# flash-write