cancel
Showing results for 
Search instead for 
Did you mean: 

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

ReIvAj501
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
ReIvAj501
Associate II

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.

View solution in original post

12 REPLIES 12
Uwe Bonnes
Principal II

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?

ReIvAj501
Associate II

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

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.

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?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..

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

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.​

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
  • I don't think I have tried connecting BOOT0 to high jet, I'll check and tell you if it lets me connect.

  • I don't use PA13 or PA14 in the program.

  • What should I check abaout the ST-LINK jumpers?

There is no change when connecting BOOT0 to high.

ST-LINK jumpers I have had them all time on. I have never touched them since I received the board.

The board doesn't have external scratches or marks that may suggest that it is damaged. I guess that it might have gotten shorted at some point, but if so I'm wasn't aware of it. Power seems to work properly, 3v pins and VDD pins supply 2.9v when checked with a polymeter and 5v pins supply 4.56v.

SMacD.1
Associate II

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.