cancel
Showing results for 
Search instead for 
Did you mean: 

Blue-Pill/ST-Link Reports: Debugger connection lost. Shutting down...

PSolw.1
Associate II

I have followed Video "STM32CubeIDE basics - 03 GPIO HAL lab" as closely as possible for my hardware as closely as possible and get the following results in the console:

STMicroelectronics ST-LINK GDB server. Version 5.5.0
Copyright (c) 2019, STMicroelectronics. All rights reserved.
 
Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 1
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Disabled
        SWD Debug                  : Enabled
        InitWhile                  : Enabled
 
Waiting for debugger connection...
Debugger connected
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.4.0                  
      -------------------------------------------------------------------
 
ST-LINK SN  : 9877000132124647524B4E00
ST-LINK FW  : V2J36S7
Voltage     : 3.19V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x410
Device name : STM32F101/F102/F103 Medium-density
Flash size  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M3
 
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a08984.srec
  File          : ST-LINK_GDB_server_a08984.srec
  Size          : 7600 Bytes
  Address       : 0x08000000 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 7]
Download in Progress:
 
File download complete
Time elapsed during download operation: 00:00:01.741
 
Verifying ...
 
Download verified successfully 
 
Debugger connection lost.
Shutting down...

The ST-Link is a third party device . I have tried two different samples of the ST-Link from different suppliers. I have also tried two Blue-Pill devices from this batch.

I have also tried a Blue Pill device from another batch which reports:

Error in initializing ST-LINK device.
Reason: ST-LINK: Could not verify ST device! Abort connection.
 

and I suspect a faulty or fake chip.

Any help would be much appreciated so I can get on with development instead of Tool Chain Tinkering!

1 REPLY 1
PSolw.1
Associate II

Found it. Stupid really. If there isn't a break point in the code, the debugger disconnects and the program keeps on running. J

Just add a break-point to the code.