1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

makefile: update to released openocd 0.6.1

This commit is contained in:
Stacey Sheldon 2012-11-17 19:16:31 -05:00 committed by Oleg Semyonov
parent 2f93d983b0
commit 0fda8035c2
3 changed files with 59 additions and 15 deletions

View File

@ -228,8 +228,8 @@ OPENOCD_BUILD_DIR := $(DL_DIR)/openocd-build
.PHONY: openocd_install
openocd_install: | $(DL_DIR) $(TOOLS_DIR)
openocd_install: OPENOCD_URL := http://sourceforge.net/projects/openocd/files/openocd/0.5.0/openocd-0.5.0.tar.bz2/download
openocd_install: OPENOCD_FILE := openocd-0.5.0.tar.bz2
openocd_install: OPENOCD_URL := http://sourceforge.net/projects/openocd/files/openocd/0.6.1/openocd-0.6.1.tar.bz2/download
openocd_install: OPENOCD_FILE := openocd-0.6.1.tar.bz2
openocd_install: openocd_clean
# download the source only if it's newer than what we already have
$(V1) wget -N -P "$(DL_DIR)" --trust-server-name "$(OPENOCD_URL)"
@ -239,11 +239,19 @@ openocd_install: openocd_clean
$(V1) mkdir -p "$(OPENOCD_BUILD_DIR)"
$(V1) tar -C $(OPENOCD_BUILD_DIR) -xjf "$(DL_DIR)/$(OPENOCD_FILE)"
# apply patches
$(V0) @echo " PATCH $(OPENOCD_DIR)"
$(V1) ( \
cd $(OPENOCD_BUILD_DIR)/openocd-0.6.1 ; \
patch -p1 < $(ROOT_DIR)/flight/Project/OpenOCD/0001-armv7m-remove-dummy-FP-regs-for-new-gdb.patch ; \
patch -p1 < $(ROOT_DIR)/flight/Project/OpenOCD/0002-rtos-add-stm32_stlink-to-FreeRTOS-targets.patch ; \
)
# build and install
$(V1) mkdir -p "$(OPENOCD_DIR)"
$(V1) ( \
cd $(OPENOCD_BUILD_DIR)/openocd-0.5.0 ; \
./configure --prefix="$(OPENOCD_DIR)" --enable-ft2232_libftdi ; \
cd $(OPENOCD_BUILD_DIR)/openocd-0.6.1 ; \
./configure --prefix="$(OPENOCD_DIR)" --enable-ft2232_libftdi --enable-stlink ; \
$(MAKE) --silent ; \
$(MAKE) --silent install ; \
)

View File

@ -6,11 +6,12 @@ interface stlink
stlink_layout usb
stlink_device_desc "ST-LINK/V2"
stlink_vid_pid 0x0483 0x3748
#
# dummy values, not really needed
#
adapter_khz 1
reset_config trst_and_srst
# unused but set to disable warnings
adapter_khz 1000
#reset_config trst_and_srst
reset_config srst_only srst_nogate
gdb_port 3333
tcl_port 6666

View File

@ -1,27 +1,60 @@
#
# STM32f4x stlink pseudo target
#
if { [info exists CHIPNAME] == 0 } {
set CHIPNAME stm32f4x
}
if { [info exists CPUTAPID] == 0 } {
set CPUTAPID 0x2ba01477
}
if { [info exists WORKAREASIZE] == 0 } {
set WORKAREASIZE 0x10000
}
#
# stm32 stlink pseudo target
#
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME stm32f4x
set _CHIPNAME stm32f1x
}
# Work-area is a space in RAM used for flash programming
# By default use 64kB
# By default use 16kB
if { [info exists WORKAREASIZE] } {
set _WORKAREASIZE $WORKAREASIZE
} else {
set _WORKAREASIZE 0x10000
set _WORKAREASIZE 0x4000
}
if { [info exists CPUTAPID] } {
set _CPUTAPID $CPUTAPID
} else {
set _CPUTAPID 0x2ba01477
# this is the SW-DP tap id not the jtag tap id
set _CPUTAPID 0x1ba01477
}
transport select stlink_swd
if { [info exists TRANSPORT] } {
set _TRANSPORT $TRANSPORT
if { $TRANSPORT == "stlink_jtag" } {
if { [info exists CPUTAPID] == 0 } {
# jtag requires us to use the jtag tap id
set _CPUTAPID 0x3ba00477
}
}
} else {
set _TRANSPORT stlink_swd
}
#
# possibles value are stlink_swd or stlink_jtag
#
transport select $_TRANSPORT
stlink newtap $_CHIPNAME cpu -expected-id $_CPUTAPID
@ -30,5 +63,7 @@ target create $_TARGETNAME stm32_stlink -chain-position $_TARGETNAME -rtos auto
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
# stm32f4x family uses stm32f2x driver
set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME stm32f2x 0x08000000 0 0 0 $_TARGETNAME
flash bank $_FLASHNAME stm32f2x 0 0 0 0 $_TARGETNAME