Skip to main content
Visitor II
September 4, 2020
Solved

STM32F4 Discovery stops connecting via ST-LINK with my end-of-degree project

  • September 4, 2020
  • 6 replies
  • 6748 views

I'm working on my end-of-degree project using an STM32F407 Discovery board. I have been working with it the last couple of months with no problems, doing the pin configuration with STM32CubeMX and developing the program in ARM Keil uVision 5.

Yesterday, while doing some debugging the board stopped being recognized by the program. When trying to load any program Keil says "No ST-LINK detected", 30 seconds before it worked perfectly.

After looking on the internet this is what I have been able to find.

  • The microcontroller part of the board seems to work correctly, being able to run the last program I loaded. This includes among other things an LCD display, using the micro USB as a COM PORT and reading an ADC showing the reading on both the LCD and the COM PORT. This makes me believe that the problem must with the ST-LINK, while the microcontroller is working correctly and the board is properly powered and voltages at all the pins are ok.
  • Other than that the board shows LEDs LD2 and LD8 lighted ON and COM LD1 lighted up Red.

  • From the computer (Windows 10) I can see the board on the device manager and it is recognized as ST-LINK. If I access the board from windows there is a text document named FAIL.txt that contains the message: "The interface firmware FAILED to reset/halt the target MCU".

  • From ST-LINK Utility I am able to connect with the board for a firmware update, but unable to connect to target afterwards, showing the message: "Can not connect to target! If you're trying to connect to a low freqyency application, please select a lower SWD Frecuency mode from Target->Settings menu." When trying to use Automatic Mode it stops at the message: "Waiting for device Nº 1...".

Any help would be appreciated; I have reached to a blocking point and cannot go on with my project. 

Thanks.

    This topic has been closed for replies.
    Best answer by ReIvAj501

    At this point I give up on fixing the board.

    In retrospective I believe that the cause of the damage might have been a connection I did between one of the GPIOs and one of the power supplies of the project (an ETX power supply). I did that connection to have an interruption to stop the program if that power supply stops working, but I guess it might have broken the board.

    6 replies

    Graduate II
    September 4, 2020

    Try connect under reset first! Did you enable WFI or even deeper sleeps in some recent step or uou now have longer periods of WFI/Sleep?

    ReIvAj501Author
    Visitor II
    September 4, 2020

    I have tried, but I'm not sure if I'm missing something, looking at comments online I wasn't sure of how to do it (I am quite new working with this kind of boards). I selected the connect under reset option in ST-LINK Utiliy (which the program itself suggested) and try to reconnect, including while pressing the reset button and/or having BOOT0 pin connected to GND

    No, the program does not have WFI or sleep.

    Personally, I doubt that the program is the problem, the changes I was doing at the time was activating a pin PB_13 as GPIO_EXT. The program itself is quite simple: 3 timers, 13 inputs set as GPIO_EXT plus the ADC and 12 PWMs as outputs. The LCD and COM PORT are only as a way to show data and error messages to the user.

    ReIvAj501Author
    Visitor II
    September 4, 2020

    Deleted. Sorry, I'm new. I ment to replay, not answer.

    Graduate II
    September 4, 2020

    The BOOT0 High trick will let you connect and erase your code if that is broken.​

    Check you aren't breaking PA13 / PA14 pins, these are used by debugger.​

    C​ould you have shorted or damaged the board? Broken a cable or connector?

    Graduate II
    September 4, 2020

    Clive, all of the problems you talk about should be overcome with connect under reset, as long as the board is not broken.

    Graduate II
    September 4, 2020

    Perhaps, but as that isn't working, I'm willing to repeat alternate approaches, in hopes of gathering more symptoms and responses, so a more definitive conclusion can be drawn.

    Check ST-LINK jumpers.​

    Visitor II
    September 4, 2020

    I just got a rev D (MB997D) Discovery board a couple of days ago. So far it's worked great.

    This morning I used STLinkUpgrade to update the firmware, and immediately after I started having the same problem. In particular:

    • STLinkUpgrade sees the device fine
    • In STM32CubeIDE, in the Run/Debug configurations setup, Debugger tab, I check ST-LINK S/N and hit the scan button and the ST-LINK is recognized
    • Debugging does not connect and gives an error (paraphrased) "No ST-LINK detected"

    It's clear to me that the ST-LINK firmware upgrade has contributed to the problem. Unfortunately I didn't note the shipped version so can't attempt a downgrade.

    I have a workaround: I had the Discovery board connected via a USB hub; moving it to be directly connected has made STM32CubeIDE happy again.

    ReIvAj501Author
    Visitor II
    September 4, 2020

    I'm glad to hear that you found a workaround, but unfortunately that's not my case. I didn't update my firmware recently, maybe in April when I bought it, and I have mine connected directly at the laptop's USB port. I tried connecting it to one of the other ports but it had no effect.

    ReIvAj501AuthorAnswer
    Visitor II
    September 10, 2020

    At this point I give up on fixing the board.

    In retrospective I believe that the cause of the damage might have been a connection I did between one of the GPIOs and one of the power supplies of the project (an ETX power supply). I did that connection to have an interruption to stop the program if that power supply stops working, but I guess it might have broken the board.

    Visitor II
    June 24, 2023

    Hello, I have a very similar problem to yours. I'm also working on an end-of-studies project using a STEVAL-BFA001V2B. When I tried to test it for the first time, I powered up the sensor node with an 18V voltage from a controlled power supply. However, when I configured the terminal to start receiving data from the sensor node, I noticed that there was a disk containing the files FAIL.txt, DETAILS.txt, and GETSTARTED.html, but I couldn't see any current consumption on the power supply screen. Could the issue be an electrical defect with the node or just a software configuration problem?

    Thank you.