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: init mode failed (unable to connect to the target) when running openocd #380

Open
Penjo989 opened this issue Oct 17, 2024 · 1 comment

Comments

@Penjo989
Copy link

I got a stm32f4 and wrote some code to it, then tried to run openocd and got this error

C:\Users\eyala\Documents\OpenOCD-20240916-0.12.0\bin>openocd.exe -f openocd.cfg
Open On-Chip Debugger 0.12.0 (2024-09-16) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 d52e355daa09f17ce64819122cb067b8a2ee0d4b
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 2000 kHz
Info : STLINK V0J8S0 (API v0) VID:PID 0000:0000
Error: init mode failed (unable to connect to the target)

my openocd.cfg -

source [find interface/stlink.cfg]

source [find target/stm32f4x.cfg]

I reflashed the stlink a couple of times and changed it to jlink(and then back to stlink) so that might have something to do with it.
also i have a friend that has the same board as i do and openocd works for him(he didn't reflash his stlink)

would very appreciate any help :), i've been stuck on this for a week now

@BartMassey
Copy link
Member

I'm sorry you're having troubles. There's a lot that can go wrong there. I don't have an STLink to replicate your hardware setup. Hopefully someone else can help here.

This edition of the Discovery Book is about to be deprecated; we've kind of moved on to BBC micro::bit v2 plus https://github.com/rust-embedded/discovery-mb2. That said, ping here again if you can't get it in the next few days, and I'll try to figure something out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants