I tried posting this on the OpenOCD forum but received no responses. I probably should have posted it here first.
I’m attempting to communicate with an Olimex STM32-H103 with an Olimex ARM-USB-TINY.
I’m powering the H103 via USB and I’m using OpenOCD version 0.4.0 (2010-06-18-22:40) that I downloaded and compiled. I use this setup for another project, also an STM32 project, without any problems.
I placed all my OpenOCD configurations in a file called stm32.cfg (see below) to simplify debugging. I compiled this configuration file from a number of sources and believe it is correct. In fact using the same programmer and configuration file with the [Leaf Maple I have no problems. However whenever I attempt to communicate with the H103 I receive the following error:
$ sudo openocd -d0 -f target/stm32.cfg
Open On-Chip Debugger 0.4.0 (2010-06-18-22:40)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
debug_level: 0
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
1000 kHz
jtag_nsrst_delay: 100
jtag_ntrst_delay: 100
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
At this point the daemon does run and as such I can connect to it via telnet. However as you can see it acts as though there is no target. Has anyone encountered this problem? Or can anyone help me resolve it?
TIA,
Dustin
#daemon configuration
telnet_port 4444
gdb_port 3333
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG TINY"
ft2232_layout olimex-jtag
ft2232_vid_pid 0x15ba 0x0004
#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config trst_and_srst
# script for stm32
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME stm32
}
if { [info exists ENDIAN] } {
set _ENDIAN $ENDIAN
} else {
set _ENDIAN little
}
# Work-area is a space in RAM used for flash programming
# By default use 16kB
if { [info exists WORKAREASIZE] } {
set _WORKAREASIZE $WORKAREASIZE
} else {
set _WORKAREASIZE 0x4000
}
# JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz
jtag_khz 1000
jtag_nsrst_delay 100
jtag_ntrst_delay 100
#jtag scan chain
if { [info exists CPUTAPID ] } {
set _CPUTAPID $CPUTAPID
} else {
# See STM Document RM0008
# Section 26.6.3
set _CPUTAPID 0x3ba00477
}
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
if { [info exists BSTAPID ] } {
# FIXME this never gets used to override defaults...
set _BSTAPID $BSTAPID
} else {
# See STM Document RM0008
# Section 29.6.2
# Low density devices, Rev A
set _BSTAPID1 0x06412041
# Medium density devices, Rev A
set _BSTAPID2 0x06410041
# Medium density devices, Rev B and Rev Z
set _BSTAPID3 0x16410041
# High density devices, Rev A
set _BSTAPID4 0x06414041
# Connectivity line devices, Rev A and Rev Z
set _BSTAPID5 0x06418041
}
jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID1 \
-expected-id $_BSTAPID2 -expected-id $_BSTAPID3 \
-expected-id $_BSTAPID4 -expected-id $_BSTAPID5
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME
$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
set _FLASHNAME $_CHIPNAME.flash
#flash bank $_FLASHNAME stm32x 0 0 0 0 $_TARGETNAME
flash bank $_FLASHNAME stm32x 0x08000000 0x00010000 0 0 $_TARGETNAME
# For more information about the configuration files, take a look at:
# openocd.texi