Please help: OpenOCD error "Wrong device detected"
Hi!
I’m pretty new in using both System Workbench and Eclipse.
You can also say that I’m pretty new in programming MCU’s using C/C++ (used to write a lot on Keil Assembler for C8051).
I’m trying to migrate existing project from one board version to another. There are a lot of changes in board layout, so I had to redefine almost all GPIO pins. None of location-dependent pins were changed though.
What I did:
- copied existing project to another folder
- edited project name
- edited #defines that were linking GPIO pins to their functions
- edited CubeMX project so it matched current board
Right now project builds with no errors, but if I try to run it on MCU it gives me error: “OpenOCD child process termination. Reason: wrong device detected” with this message in console:
Open On-Chip Debugger 0.10.0-dev-00007-g58350bc-dirty (2018-01-12-12:21)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 8000 kHz
adapter_nsrst_delay: 100
Info : clock speed 8000 kHz
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : vid/pid are not identical: 0x0483/0x374B 0x0483/0x3748
Info : using stlink api v2
Info : Target voltage: 3.234921
Error: init mode failed (unable to connect to the target)
in procedure ‘program’
in procedure ‘init’ called at file “embedded:startup.tcl”, line 485
in procedure ‘ocd_bouncer’
- OpenOCD init failed **
shutdown command invoked
Original project is created, I believe, with CubeMX v.4 and firmware STM32Cube_FW_F1_V1.6.1. New project is edited using CubeMX 5.0.1 and firmware STM32Cube_FW_F1_V1.6.1 and STM32Cube_FW_F1_V1.7.0.
Project settings are seemed OK to me. Linker script seems normal too.