2021-06-13 04:15 PM
Hello all,
I'm new to ST and Cube.
I'm trying to do a "blinky" program on a nucleo-F439ZI board. Everything seems to build and load to the board ok, but when I run it I get this message...
"Debugger connection lost.
Shutting down..."
What am I doing wrong?
Thanks George
2021-06-13 11:38 PM
Such things usually happen when you reconfigure the debug pins (SWD/JTAG) to GPIO functionality at runtime.
Or, in rarer cases, when the target supply voltage collapses due to the increased consumption at runtime.
I would try to start single-step debugging from the reset vector - not from main.
2021-06-14 03:27 AM
Hello @gdori.1 ,
It may be the cause of this problem is on the configuration setting as said by @Ozone.
Also, try to upgrade the STLink Firmware and make sure to follow this article on how to make sure the STM32 board works properly: Why my STM32 doesn't start?.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Imen
2021-06-18 05:42 AM
Hi @gdori.1 ,
Did the solution shared solve your problem?
I'm waiting for your update on your issue.
When your question is answered, please close this topic by choosing "Select as Best".
Imen
2021-08-08 12:44 AM
Same issue here:
Debugger connection lost.
Shutting down...
=============================
Linux Mint 20.2
STM32CubeIDE 1.7.0
last firmware on Nucleo-32 STM32L412KB
all forum hints tested including "monitor flash mass_erase" etc...
=============================
LOG-FILE:
(...)
File download complete
Time elapsed during download operation: 00:00:00.465
Verifying ...
Read progress:
[39;49m[39;49m[39;49m[39;49m[39;49m[00;32m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[00;32m[========= ] 19%
[39;49m[39;49m[39;49m[00;32m[=================== ] 38%
[39;49m[39;49m[39;49m[00;32m[============================ ] 57%
[39;49m[39;49m[39;49m[00;32m[====================================== ] 76%
[39;49m[39;49m[39;49m[00;32m[=============================================== ] 95%
[39;49m[39;49m[39;49m[00;32m[==================================================] 100%
[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m
Download verified successfully
[39;49m[39;49m[00;32m[39;49m[39;49m[39;49m[39;49m ------ Switching context -----
COM frequency = 4000 kHz
Target connection mode: Under reset
Reading ROM table for AP 0 @0xe00fffd0
Hardware watchpoint supported by the target
ST-LINK Firmware version : V2J38M27
Device ID: 0x464
PC: 0x8000874
ST-LINK detects target voltage = 3.26 V
ST-LINK device status: HALT_MODE
ST-LINK device initialization OK
handle_vCont_c, continue thread
Debugger connection lost.
Shutting down...
Stopping port 61235
Received stop for port 61235, not accepting new connections.
===============================
Without "Log to file:"
STMicroelectronics ST-LINK GDB server. Version 5.9.1
Copyright (c) 2021, 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.8.0
-------------------------------------------------------------------
ST-LINK SN : 066BFF3530384E5043154541
ST-LINK FW : V2J38M27
Board : NUCLEO-L412KB
Voltage : 3,27V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x464
Revision ID : Rev A
Device name : STM32L41x
Flash size : 128 KBytes
Device type : MCU
Device CPU : Cortex-M4
BL Version : 0x__
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_FaHS9p.srec
File : ST-LINK_GDB_server_FaHS9p.srec
Size : 10744 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 5]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:00.459
Verifying ...
Download verified successfully
Debugger connection lost.
Shutting down...
=================================
Thanx for Your support, Peter
2021-08-08 07:55 AM
some more hints:
1.) I installed StlinkRulesFilesForLinux, see
hence:
===
user@pc:~$ ls -l /etc/udev/rules.d/
insgesamt 40
-rw-r--r-- 1 root root 245 Jun 11 17:57 49-stlinkv1.rules
-rw-r--r-- 1 root root 439 Jun 11 17:57 49-stlinkv2-1.rules
-rw-r--r-- 1 root root 253 Jun 11 17:57 49-stlinkv2.rules
-rw-r--r-- 1 root root 1368 Jun 11 17:57 49-stlinkv3.rules
-rw-r--r-- 1 root root 21179 Jul 15 08:36 99-jlink.rules
===
==========================
2.) in the Linux logs like /var/log/dmesg and /var/log/syslog there are no hints for a malfunction of the ST-LINK/V 2.1
==========================
3.) lsusb -v
Bus 001 Device 024: ID 0483:3752 STMicroelectronics ST-LINK/V2.1
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x0483 STMicroelectronics
idProduct 0x3752 ST-LINK/V2.1
bcdDevice 1.00
iManufacturer 1 STMicroelectronics
iProduct 2 STM32 STLink
iSerial 3 066BFF3530384E5043154541
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0069
bNumInterfaces 3
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 300mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 4 ST-Link Debug
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 0
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 1
bInterfaceCount 2
bFunctionClass 2 Communications
bFunctionSubClass 2 Abstract (modem)
bFunctionProtocol 1 AT-commands (v.25ter)
iFunction 6 ST-Link VCP Ctrl
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
(etc ...)
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0000
(Bus Powered)
2021-08-11 05:22 AM
This happens after clicking the button "Run <project> Debug". When hitting the button "Debug <project> Debug", then debugging works. Now on a freshly installed Linux Mint 20.2. mate, after installing STM32CubeIDE 1.7.0, there is no need to additionally install /etc/udev/rules.d