Keil MDK ST-LINK connection error on STM32 board

213 views Asked by At

I am trying to run a program in my STM32F769I-DISCO board. When i try and run the program in Keil, the software automatically closes. When I go to options for target->Debug->Settings it again automatically closes sometimes. In other times i see the following:

enter image description here

Now i have tried reinstalling everything over and over, downgraded versions and possibly did everything i can think of. I can flash the device using STMCubeProgrammer but I cannot run it to get specific values without an ide like keil. I also looked at this solution and tried what it suggested. I just want to run my program and get some values.

The following are the drivers i have installed and the device manager view.

enter image description here enter image description here

enter image description here

1

There are 1 answers

0
Steve On

Keil MDK 5.38a is known to have problems with the ST-Link device driver. Version 5.39 seems to have fixed these issues but you have to uninstall the old ST-Link device driver. In the Device Manager, with your board plugged in, switch to Device by Connection view and find the location of the ST-Link Debug device. If the device works properly there is nothing to do here. However, if the ST-Link Debug is not found or found in the Other Devices category, or it is marked with an exclamation sign (and in Device Properties, you find that the device is not working properly because of various reasons), you have to remove the driver manually and also remove its USB Composite Device parent (if visible, where all the drivers from STM are installed like the VCOM or USB storage). With a clean system, unplug the board, and install the latest ST-Link device driver directly from STMicroelectronics (STSW-LINK009.zip) following their instructions. Check the installation by plugging in the board again and see if all the drivers are in order. It is also possible to update the firmware in your STM32F769-DISCO board (the embedded ST-Link probe). In this case, use the firmware update utility from STMicroelectronics (STSW-LINK007.zip) and make sure you have the latest firmware running properly. Only if all the above are in place you can launch uVision again. Now you can check the status of your ST-Link device and see if it is properly detected and the IDCODE displayed. If the problem persists, you may need to reinstall Keil MDK (but I doubt it will help). You may need to check the cables and the board on a known good computer that works with other boards too. I hope the process above can help you. It worked for me as soon as I migrated from a Windows 10 PC to a Windows 11 one (and had similar issues). Honestly, I don't understand why Windows 11 is more sensitive to the device drivers, but using the latest ST-Link drivers and firmware seems to fix the problem on other computers too. Good luck!