cancel
Showing results for 
Search instead for 
Did you mean: 

Application was not running in RELEASE mode by saying "Debugger connection lost. Shutting down..."

HNall.1
Associate III

Hi have a simpler STM32 application which includes below simpler code in main.c file.

#include <stdio.h>
 
int main(){
 
	int a=10, b=20;
	printf("Sum=%d \n", a+b);
	return 0;
}

Later i build the project in RELEASE mode and ran the application then it was throwing below error.

STMicroelectronics ST-LINK GDB server. Version 5.6.0
Copyright (c) 2020, 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.5.0-RC1                  
      -------------------------------------------------------------------
 
ST-LINK SN  : 066DFF535254887767171939
ST-LINK FW  : V2J37M26
Board       : 32F469IDISCOVERY
Voltage     : 3.27V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x434
Revision ID : Rev A
Device name : STM32F469xx/F467xx
Flash size  : 2 MBytes
Device type : MCU
Device CPU  : Cortex-M4
 
 
 
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a02796.srec
  File          : ST-LINK_GDB_server_a02796.srec
  Size          : 4920 Bytes
  Address       : 0x08000000 
 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sector 0
Download in Progress:
 
 
File download complete
Time elapsed during download operation: 00:00:00.382
 
 
 
Verifying ...
 
 
 
 
Download verified successfully 
 
 
Debugger connection lost.
Shutting down...
 

Can anybody help me in resolving this issue?

Thanks,

Hari

5 REPLIES 5
TDK
Guru

> below error.

What error? The program says it was downloaded and successfully verified.

Also, never return from main().

If you feel a post has answered your question, please click "Accept as Solution".
HNall.1
Associate III

Hi @TDK​ ,

I am new to micro-controller programming. Also, I'm not sure why i'm seeing "Debugger connection lost.Shutting down..." at the end.

It would be very helpful if you respond with some explaination/resource.

Also I'm not seeing printf output anywhere in the console. This is the reason I'm feeling Runtime it was not working. How can i see the printf() output.

TDK
Guru

Not real sure. Your question essentially boils down to something not working with little to no additional info. Hard to debug that remotely.

There is no standard way for printf to behave. Some people port it to UART. Some to SWO output. I don't know which configuration you're using.

Where are you getting this example? Have you looked at and ran STM32CubeIDE board examples?

If you feel a post has answered your question, please click "Accept as Solution".
HNall.1
Associate III

Hi @TDK​ ,

Please let me know, What additional iinformation you required to understand this problem.

This is very simpler example to add two numbers.​

I have not taken a look at STM32CUBDEIDE examples.​

MMAUR.1
Associate II

STM32CubeProgrammer v2.5.0-RC1

V2.5.0 doesn't support for STM32F4 . for this please check the STM32CubeProgrammer document .

So, download the STMCube IDE (v 1.1.0 )

STMicroelectronics ST-LINK GDB server. Version 5.3.2

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

Waiting for debugger connection...

Debugger connected

   -------------------------------------------------------------------

            STM32CubeProgrammer v2.2.0          

   -------------------------------------------------------------------

Log output file:  C:\Users\Techno\AppData\Local\Temp\STM32CubeProgrammer_a17472.log

ST-LINK SN : 0669FF545052836687104442

ST-LINK FW : V2J37M26

Voltage   : 2.88V

SWD freq  : 4000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID  : 0x419

Device name : STM32F42xxx/F43xxx

Flash size : 2 MBytes

Device type : MCU

Device CPU : Cortex-M4

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a17472.srec

 File     : ST-LINK_GDB_server_a17472.srec

 Size     : 48836 Bytes

 Address    : 0x08000000 

Erasing memory corresponding to segment 0:

Erasing internal memory sectors [0 2]

Download in Progress:

File download complete

Time elapsed during download operation: 00:00:01.669

Verifying ...