Update Olimex-LPC1766STK scripts to use OpenOCD-0.7.0

This commit is contained in:
Gregory Nutt 2013-05-10 10:37:45 -06:00
parent 316456652f
commit 986d310d83
2 changed files with 31 additions and 8 deletions

View File

@ -38,6 +38,18 @@ if { [info exists CPUTAPID ] } {
set _CPUTAPID 0x4ba00477 set _CPUTAPID 0x4ba00477
} }
if { [info exists CPURAMSIZE] } {
set _CPURAMSIZE $CPURAMSIZE
} else {
set _CPURAMSIZE 0x8000
}
if { [info exists CPUROMSIZE] } {
set _CPUROMSIZE $CPUROMSIZE
} else {
set _CPUROMSIZE 0x40000
}
#delays on reset lines #delays on reset lines
adapter_nsrst_delay 200 adapter_nsrst_delay 200
jtag_ntrst_delay 200 jtag_ntrst_delay 200
@ -49,23 +61,29 @@ reset_config trst_and_srst srst_pulls_trst
jtag newtap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID jtag newtap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
set _TARGETNAME $_CHIPNAME.cpu set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME cortex_m3 -chain-position $_TARGETNAME # openocd-0.4:
# target create $_TARGETNAME cortex_m3 -chain-position $_TARGETNAME
# openocd-0.7:
target create $_TARGETNAME cortex_m -chain-position $_TARGETNAME
# LPC1766 has 32kB of SRAM In the ARMv7-M "Code" area (at 0x10000000) # LPC1766 has 32kB of SRAM In the ARMv7-M "Code" area (at 0x10000000)
# and 32K more on AHB, in the ARMv7-M "SRAM" area, (at 0x2007c000). # and 32K more on AHB, in the ARMv7-M "SRAM" area, (at 0x2007c000).
$_TARGETNAME configure -work-area-phys 0x10000000 -work-area-size 0x8000 $_TARGETNAME configure -work-area-phys 0x10000000 -work-area-size $_CPURAMSIZE
# LPC1766 has 256kB of flash memory, managed by ROM code (including a # LPC1766 has 256kB of flash memory, managed by ROM code (including a
# boot loader which verifies the flash exception table's checksum). # boot loader which verifies the flash exception table's checksum).
# flash bank <name> lpc2000 <base> <size> 0 0 <target#> <variant> <clock> [calc checksum] # flash bank <name> lpc2000 <base> <size> 0 0 <target#> <variant> <clock> [calc checksum]
set _FLASHNAME $_CHIPNAME.flash set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME lpc2000 0x0 0x40000 0 0 $_TARGETNAME \ flash bank $_FLASHNAME lpc2000 0x0 $_CPUROMSIZE 0 0 $_TARGETNAME \
lpc1700 $_CCLK calc_checksum lpc1700 $_CCLK calc_checksum
# Run with *real slow* clock by default since the # Run with *real slow* clock by default since the
# boot rom could have been playing with the PLL, so # boot rom could have been playing with the PLL, so
# we have no idea what clock the target is running at. # we have no idea what clock the target is running at.
jtag_khz 100 # openocd-0.4:
# jtag_khz 100
# openocd-0.7
adapter_khz 100
$_TARGETNAME configure -event reset-init { $_TARGETNAME configure -event reset-init {
# Do not remap 0x0000-0x0020 to anything but the flash (i.e. select # Do not remap 0x0000-0x0020 to anything but the flash (i.e. select
@ -84,3 +102,8 @@ $_TARGETNAME configure -event reset-init {
mww 0x400FC040 0x01 mww 0x400FC040 0x01
} }
# if srst is not fitted use VECTRESET to
# perform a soft reset - SYSRESETREQ is not supported
# openocd-0.7:
cortex_m reset_config vectreset

View File

@ -11,14 +11,14 @@ if [ -z "${TOPDIR}" ]; then
exit 1 exit 1
fi fi
# Assume that OpenOCD was installed and at /usr/local/bin. Uncomment # Assume that OpenOCD was installed and at /usr/local/bin or maybe c:\OpenOCD
# the following to run directly from the build directory #OPENOCD_PATH="/cygdrive/c/OpenOCD/openocd-0.4.0/src"
#OPENOCD_PATH="/home/OpenOCD/openocd/src" #TARGET_PATH="c:\OpenOCD\openocd-0.4.0\tcl"
#TARGET_PATH="/home/OpenOCD/openocd/tcl"
OPENOCD_PATH="/usr/local/bin" OPENOCD_PATH="/usr/local/bin"
TARGET_PATH="/usr/local/share/openocd/scripts" TARGET_PATH="/usr/local/share/openocd/scripts"
OPENOCD_EXE=openocd.exe OPENOCD_EXE=openocd.exe
#OPENOCD_CFG=`cygpath -w "${TOPDIR}/configs/olimex-lpc1766stk/tools/olimex.cfg"`
OPENOCD_CFG="${TOPDIR}/configs/olimex-lpc1766stk/tools/olimex.cfg" OPENOCD_CFG="${TOPDIR}/configs/olimex-lpc1766stk/tools/olimex.cfg"
OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}" OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}"