I'm having problems when I try to update programs in my STM32F407 discovery.

It was working well until I tried to use the PA13 pin as an input in my program. I tried to update the program, it didn't work, and after that I receive the errors:

Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED Error: init mode failed (unable to connect to the target)

When I checked in the manual I saw that port PA13 is named JTMS-SWDIO and i used for JTAG or SW debugging. Is it possible that this assignment set another debug configuration?

If this is right, is it possible to perform a hardware hard reset on the board to delete this new debugging set up?


You tried to drive a line from three different sources:

  1. Programmer
  2. Whatever was connected to PA13
  3. STM32 (very unlikely)

Disconnect whatever you connected to that pin. The programmer tried to drive a line (SWDIO) which was already driven. There are four scenarios possible after you connect that input to a different pin:

  1. Everything works - great, don't do this again.
  2. The programmer does not work - the output of whatever was connected to that line is had higher current capacity and the pin on the programmer burned out due to overcurrent.
  3. Reverse of point 2 - the pin of whatever device was connected there got burned.
  4. PA13 burned.

Looking at your description (USB errors) most probably it's either 1. Or 2., with 4. having very low probability.

Edit: on a board which is not damaged this is a software issue - selecting "program under reset" will allow you to program the device, though debugging with PA13 reprogrammed is not possible.

  • \$\begingroup\$ I tried to flash it again, but it didn't work, is it possible to perform a hard reset and delete this set up? or is there a way to confirm that this pin is burned? I have two stm32f4 dicovery and the two of them have the same issue, in the other I didn't connect anything to the pin, just configure it in the program \$\endgroup\$ – Alejandro Enrique Garcia Navar May 6 at 18:03
  • \$\begingroup\$ @AlejandroEnriqueGarciaNavar select "connect under reset" or similar when programming. \$\endgroup\$ – Jan Dorniak May 6 at 18:21
  • \$\begingroup\$ It works mate, thanks for your help \$\endgroup\$ – Alejandro Enrique Garcia Navar May 6 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.