Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: timed out while waiting for target halted #1

Closed
RickKimball opened this issue Feb 11, 2014 · 12 comments

Comments

Projects
None yet
9 participants
@RickKimball
Copy link

commented Feb 11, 2014

I've got an lpc1114fn28 connected to an stlink-v2 from a discovery board.
CN3 pins connected 1->VDD, 2->SWCLK, 3->GND, 4->SWDIO, 5-> reset, 6 -nc .. power to lpc1114 coming from the 3V pin on the discovery.

When I run it fails at the reset init function, if i remove that line and replace it with a halt, I can then connect via arm-none-eabi-gdb and successfully load and debug.

Do I need to do anything special with the reset pin? I have an external pullup connected and pin 5 from the debug connector on the discovery board.

Thanks,
-rick

$ openocd -s openocd -f debug.cfg 
Open On-Chip Debugger 0.8.0-dev-00331-g1137eae (2014-01-25-15:17)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.sourceforge.net/doc/doxygen/bugs.html
srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
Info : This adapter doesn't support configurable speed
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.898221
Info : lpc1114.cpu: hardware has 4 breakpoints, 2 watchpoints
Error: timed out while waiting for target halted
TARGET: lpc1114.cpu - Not halted

Runtime Error: debug.cfg:9: 
in procedure 'script' 
at file "embedded:startup.tcl", line 58
in procedure 'reset' called at file "debug.cfg", line 9
$ 
@vsergeev

This comment has been minimized.

Copy link
Owner

commented Feb 11, 2014

Is your ST-Link v2's TRST connected to the target reset (pin 3 of CN3)?

I'll have to check when I get home, but I believe I have the ST-Link v2 hooked up to the target via these pins on the CN3:
3 = TRST, 7 = TMS_SWDIO, 9 = TCK_SWCLK, 1 = Target VCC, 20 = GND

@RickKimball

This comment has been minimized.

Copy link
Author

commented Feb 11, 2014

I think my problem was having too small a resistor on the pull up line. I switched to a 10k resistor and now it works great. Thanks for looking at this

@vsergeev

This comment has been minimized.

Copy link
Owner

commented Feb 16, 2014

SRST*

@RickKimball

This comment has been minimized.

Copy link
Author

commented Feb 16, 2014

seems the simplest way to deal with this is to just use

reset_config none separate

Then the reset is done internally over the SWD channel with no pins used.

@vsergeev

This comment has been minimized.

Copy link
Owner

commented Feb 16, 2014

Makes me wonder what the stlinkv2 is sending in that case -- maybe it assumes SYSRESETREQ in AIRCR exists and uses it. PaulFertser was telling me over IRC that it's more accurate to think of the stlinkv2 as an integrated GDB server than a low-level JTAG interface, which is why it gets instantiated as a high level adapter target.

@nathantsoi

This comment has been minimized.

Copy link

commented Jul 6, 2015

@RickKimball, you're my hero.

@qywx

This comment has been minimized.

Copy link

commented Mar 24, 2016

Thank you, @RickKimball!

@mquade

This comment has been minimized.

Copy link

commented Oct 28, 2016

@RickKimball man of the day!

@vishal-android-freak

This comment has been minimized.

Copy link

commented Feb 11, 2017

@RickKimball Thanks for the tip! :)

@DieHertz

This comment has been minimized.

Copy link

commented Apr 1, 2017

I have to use the reset_config none separate with my STLink v2 from BangGood, STM32F3Discovery as STLink works just fine with default reset_config :-( Why?

@FarisAlsaad

This comment has been minimized.

Copy link

commented Dec 19, 2018

@RickKimball THANK YOU!! The reset_config none separate works! But I had to go the the Debug Configurations -> Debugger tab -> Configuration Script and changed it to User Defined. When I added the line you recommended it did not work because when I press debug it overwrites the cfg file and puts back the original configuration that did not work. BTW I have the STM32F407VET6

@adadurov

This comment has been minimized.

Copy link

commented May 10, 2019

Based on the comment from @FarisAlsaad , the following worked for me and will hopefully work for other GUI users -- without the need to switch to 'user defined' configuration script.
Go to Debug Configurations -> Debugger tab -> Configuration Script -> Show generation options... -> Reset Mode ==> change to 'Software System Reset'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.