2020-05-22 10:04 AM
I am using a Nucleo-F103RB dev board with Cube IDE 1.3.0. I am able to successfully flash the board (which I have tested by making the user LED on the nucleo toggle at different frequencies), but immediately after this is successful, I lose connection to the debugger. I have the SWD pins enabled and the debug mode set to SWD and so on. Here is what the console prints out:
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 : 066AFF575251717867103959
ST-LINK FW : V2J36M26
Voltage : 3.27V
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_a13700.srec
File : ST-LINK_GDB_server_a13700.srec
Size : 12264 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 11]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:01.015
Verifying ...
Download verified successfully
Debugger connection lost.
Shutting down...
The debugger loses connection immediately after the download is completed. Everything after "Debugger connected" prints at the same time.
If I go to debug mode, it says there is a suspension at HAL_Init(), which cannot be the case because I have confirmed the program is successfully running on the board. I have checked other posts with the same problem and they are not relevant to my question as I have always seen that their solution was already the case for me. I have also attached a screenshot of the debugger tab in Cube, but haven't changed anything from the default settings.
2020-05-22 12:06 PM
*don't forget to click debug main.c not run, i was doing that by mistake*
2020-05-22 12:19 PM
It was working fine for me a few weeks ago as well. Didn't change anything to my knowledge.