cancel
Showing results for 
Search instead for 
Did you mean: 

ST-LINK: "Failed to execute MI command" & "Error in initializing ST-LINK device

Naveen12
Associate

We are using STM32CubeIDE to configure the STM32 controller. Previously, flashing the code to the board was working fine. Recently, while trying to debug, the IDE started showing this error: "Failed to execute MI command""Error in initializing ST-LINK device" We tried upgrading the ST-LINK driver, and the controller responded to the host. In STM32 ST-LINK Utility, we could select the External Loader, which means the connection seemed okay.However, when we tried to erase the flash using ST-LINK Utility, we got:
"Target not connected" We tried many solutions in STM32CubeIDE, but we could not identify the root cause. Could anyone please help us understand what might be going wrong?

5 REPLIES 5
Peter BENSCH
ST Employee

Welcome @Naveen12, to the community!

Please add photos of the front and back of your ST-LINK here.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Welcome to the forum.

You need to supply some more details - see: How to write your question to maximize your chances to find a solution.

 

Have you seen:

https://community.st.com/t5/stm32-mcus/how-to-solve-connection-errors-when-connecting-and-programming/tac-p/786977

https://community.st.com/t5/stm32-mcus/how-to-solve-debugger-connection-issues/ta-p/49693

 

Are you using a genuine ST-Link:

https://community.st.com/t5/stm32-mcus/how-to-recognize-a-genuine-st-link-v2-versus-a-cloned-one/ta-p/49471

 

Note that the old ST-Link Utility is long obsolete - have you tried CubeProgrammer ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

image.pngimage (1).pngScreenshot 2025-04-16 181820.png


@Naveen12 wrote:

 Recently, while trying to debug, the IDE started showing this error: 


So what did you change immediately before that started happening?

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Hello,

Please use STM32Cubeprogrammer, ST-Link utility is deprecated:

STM32CubeProgrammer 

The error message "No device found on target" indicates that the STM32H7 is probably not powered, or is in a state where it can't be accessed.

Please download the User Manual , and check the jumpers and solder bridges configuration.