avoid target reset during openocd initialization

Hi,

I’m using openocd 0.7 (built from sources) to connect to an STM32F2 using a flyswatter2 JTAG. My toolchain comes from the latest of CodeSourcery; and I’m developing on Ubuntu.

I’m able to program and reset the target using OpenOCD; and remote GDB. My only problem is that my target board resets everytime I launch OpenOCD for debugging. I can ofcourse always launch my application through OpenOCD control; but I’d prefer to be able to connect through OpenOCD only in the case an error manifests itself.

Is there a way to avoid a reset upon connection? I’ve been reading the OpenOCD documentation, but I haven’t managed to find an answer. I was previously using an Olimex JTAG; and it would not reset the target upon connection through OpenOCD. It was a very desirable feature; but I can’t get to replicate it with a flyswatter2 or even a Jlink.

I’ll continue my research; but I’d appreciate if there is an easy answer to this.

thanks,

post your config used.

Cheers

Spen

I’ve built OpenOCD from the following state: v0.7.0-57-g74b1392

Command used to run OpenOCD:

sudo ../../openocd-code/src/openocd -f ../../openocd-code/tcl/interface/flyswatter2.cfg -f ../../openocd-code/tcl/target/stm32f2x.cfg -f ../OpenOCD/stm32_gdb.cfg

stm32_gdb.cfg contains:

adapter_khz 20
reset_config trst_only
init

thanks.

That looks ok, and should not touch the srst line.

it could be the driver code for that interface, hard to say as i do no have one to test.

I would recommend you use the newer ftdi driver that uses libusb-1.0. It may also help with your issue.

To use build OpenOCD with --enable-ftdi and use the updated cfg.

add ftdi to interface path, eg.

interface/flyswatter2.cfg

new patch

interface/ftdi/flyswatter2.cfg

Cheers

Spen

Spen,

Recompiling with --enable-ftdi and changing to the following helped:

ntfreak:
interface/ftdi/flyswatter2.cfg

Do you know why this would be?

Thanks.

What do you mean by helped?

This is using the new ftdi driver, perhaps reset handling is better - it is hard to say without running tests.

Cheers

Spen

Recompiling with --enable-ftdi and changing to interface/ftdi/flyswatter2.cfg now means that my target doesn’t reset upon starting OpenOCD. So I can connect to the target using OpenOCD only if there is an error.

thanks Spen!

That’s good news then. You should also notice the new driver is faster- quite a bit for reads.

Spen