OCD unable to launch cfg (SOLVED) Topic is solved

Discussions and support about ChibiStudio, the free development environment for ARM.
Post Reply
duracell
Posts: 24
Joined: Tue Jul 05, 2016 8:55 am
Has thanked: 4 times
Been thanked: 1 time

OCD unable to launch cfg (SOLVED)

Post by duracell »

Hi to all,

I would like to share a solution to a problem.

What happened?
I had launched the .cfg in the OCD and I had the following message:

[spoil]Open On-Chip Debugger 0.10.0-dev-00107-ge4848fe (2015-11-13-11:49)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Warn : Interface already configured, ignoring
Error: already specified hl_layout stlink
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : STLINK v2 JTAG v27 API v2 SWIM v15 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 2.901005
Error: init mode failed (unable to connect to the target)
in procedure 'init'
in procedure 'ocd_bouncer'[/spoil]


I did not know the reason, I tried to modify the .cfg, I tried to reinstall usb drivers, I tried to lauch with different .cfg....but nothing changed and at the end I was very sad as I tought I had broken three discovery boards.


But the microcontrollers were still working, leds were blinking as they were supposed to do, anyway I was unable re-flash them.


The problem was that I used PA13 and PA14 as output pin and those pin were reserved for the JTAG! For this reason the code was working but the microcontrollers were unable to communicate with OCD.

SOLUTION (PROBABLY NOT THE BEST ONE)
Keep the reset button pressed, then lauch the .cfg (the operation will be successful), then try to flash the microcontroller, this operation obviously
will not succed, but the old firmware will be erased and the JTAG pins will be free again.
And then it will be possible to lauch again the .cfg
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: OCD unable to launch cfg (SOLVED)

Post by Giovanni »

Hi,

Another solution is to use the ST-Link Tool, it has an option to freeze the MCU after reset, then you can erase the chip.

Giovanni
Post Reply