Ctrl+C Remote communication error

Hi everybody,

since a few weeks, I’m experiencing a strange problem when debugging stm32f1xx and stm32w1xx via OpenOCD.

When I press Ctrl+C in GDB during a debugging session, instead of breaking the program, the following error occurs:

^CRemote communication error. Target disconnected.: Die Verbindung wurde vom Kommunikationspartner zurückgesetzt.

The problem occurs in this setup:

  • OpenOCD rev 0.7.0 and 0.8.0-rc1 using driver FTDI (0.8.0) and FT2232 (0.7.0)

  • JTAG-Adapter Olimex USB-OCD-H (FTDI 2232H)

  • Olimex Protoboard STM32-H107 (STM3232F107)

I’m starting the GDB session like this (OpenOCD 0.8.0-rc1):

openocd -f interface/olimex-arm-usb-ocd-h.cfg -f configs/openocd_target.cfg -c init -c reset arm-none-eabi-gdb

Content of olimex-arm-usb-ocd-h.cfg -------------------------------------------

interface ftdi

ftdi_device_desc “Olimex OpenOCD JTAG ARM-USB-OCD-H”

ftdi_layout_init 0x0508 0x0f1b

ftdi_vid_pid 0x15ba 0x002b


Content of openocd_target.cfg --------------------------------------------------

source [find target/swj-dp.tcl]

if { [info exists CHIPNAME] } {

set _CHIPNAME $CHIPNAME

} else {

set _CHIPNAME stm32f1x

}

if { [info exists ENDIAN] } {

set _ENDIAN $ENDIAN

} else {

set _ENDIAN little

}

if { [info exists WORKAREASIZE] } {

set _WORKAREASIZE $WORKAREASIZE

} else {

set _WORKAREASIZE 0x1000

}

if { [info exists CPUTAPID] } {

set _CPUTAPID $CPUTAPID

} else {

set _CPUTAPID 0x3ba00477

}

swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID

if { [info exists BSTAPID] } {

set _BSTAPID $BSTAPID

} else {

set _BSTAPID1 0x06412041

set _BSTAPID2 0x06410041

set _BSTAPID3 0x16410041

set _BSTAPID4 0x06420041

set _BSTAPID5 0x06414041

set _BSTAPID6 0x06418041

set _BSTAPID7 0x06430041

set _BSTAPID8 0x06420041

set _BSTAPID9 0x06428041

}

if {$using_jtag} {

jtag newtap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID1 \

-expected-id $_BSTAPID2 -expected-id $_BSTAPID3 \

-expected-id $_BSTAPID4 -expected-id $_BSTAPID5 \

-expected-id $_BSTAPID6 -expected-id $_BSTAPID7 \

-expected-id $_BSTAPID8 -expected-id $_BSTAPID9

}

set _TARGETNAME $_CHIPNAME.cpu

target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME

$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0

set _FLASHNAME $_CHIPNAME.flash

flash bank $_FLASHNAME stm32f1x 0x08000000 0 0 0 $_TARGETNAME

adapter_khz 1000

adapter_nsrst_delay 100

if {$using_jtag} {

jtag_ntrst_delay 100

}

cortex_m reset_config sysresetreq


OpenOCD Start Log -----------------------------------------------------------------

openocd -f interface/olimex-arm-usb-ocd-h.cfg -f configs/openocd_target.cfg -c init -c reset arm-none-eabi-gdb

Open On-Chip Debugger 0.8.0-rc1 (2014-04-30-14:09)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.sourceforge.net/doc/doxygen/bugs.html

Info : only one transport option; autoselect ‘jtag’

adapter speed: 1000 kHz

adapter_nsrst_delay: 100

jtag_ntrst_delay: 100

cortex_m reset_config sysresetreq

Info : clock speed 1000 kHz

Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)

Info : JTAG tap: stm32f1x.bs tap/device found: 0x06418041 (mfg: 0x020, part: 0x6418, ver: 0x0)

Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints

Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)

Info : JTAG tap: stm32f1x.bs tap/device found: 0x06418041 (mfg: 0x020, part: 0x6418, ver: 0x0)

_/gdb_server.sh - GDB-Server successfully started. Connect your arm-none-eabi-gdb to 127.0.0.1:3333