Skip to main content
Visitor
June 23, 2026
Question

ST-Link/v2 can't connect to MCU

  • June 23, 2026
  • 3 replies
  • 23 views

Hi,

I’m using a NUCLEO-C031C6 64 board.

I successfully setup the tool chain and ran several test from STM32CubeMX templates, directly compile and programming through STM32CubeIDE.

Until this morning, everything was working fine.

But I have lost the connection to the MCU later on.


 

From STM32CudeIDE:

Target unknown error 19

Error in initializing ST-LINK device.

Reason: Unknown. Please check power and cabling to target.

 

Using of STM32CubeProgrammer:

  • Recognized as mass storage
  • On board ST-LINK/V2 is recognized, updated to version V2J47M34 successfully
  • Full chip erase and board recognition works fine on the NUCLEO-G031K8 board

But I have repetitively following messages while I try to connect ():

 

I have tried unsuccessfully:

  • under reset mode 
  • external SWD ST-LINK

 

 

How can I debug futher?

Did I miss something?

Thanks!

 

 

 

3 replies

Andrew Neil
Super User
June 23, 2026

Is your software using low-power modes, and/or reconfiguring the SWD pins ?

Have you enabled any security/protection ?

 

Try connecting from 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.
Visitor
June 23, 2026

 

The program is a basic CubeMX configuration template. I have no low-power mode or security settings.

I played with clock configuration and somehow disabled the “serial wire” debug in one of my tests. Beyond this point, I couldn’t recover the connection with the MCU 

Andrew Neil
Super User
June 24, 2026

Connecting under hardware reset should get you out of that.

Or use the System bootloader.

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.
Associate
June 24, 2026

Until this morning, everything was working fine.

But I have lost the connection to the MCU later on.

 

between this period of time, is there any change on the board or your laptop? looks wired...