Connection closed by the GDB server

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Connection closed by the GDB server

Jump to solution
14,322 Views
coopertrooper
Contributor III

Hello everyone,

 

I was working on my project just fine this morning, and all of a sudden I am no longer able to debug and download code into my FRDM-K22F device.

Looking at the console, I get the following messages:

 

From JLinkGDBServerCL console:

 

SEGGER J-Link GDB Server V4.96a Command Line Version  JLinkARM.dll V4.96a (DLL compiled Jan 14 2015 09:32:38)  -----GDB Server start settings----- GDBInit file:                  none GDB Server Listening port:     2331 SWO raw output listening port: 2332 Terminal I/O port:             2333 Accept remote connection:      localhost only Generate logfile:              off Verify download:               on Init regs on start:            on Silent mode:                   off Single run mode:               on Target connection timeout:     0 ms ------J-Link related settings------ J-Link Host interface:         USB J-Link script:                 none J-Link settings file:          none ------Target related settings------ Target device:                 MK22FN512xxx12 Target interface:              SWD Target interface speed:        1000kHz Target endian:                 little  Connecting to J-Link... J-Link is connected. Firmware: J-Link OpenSDA 2 compiled Nov 28 2014 10:35:51 Hardware: V1.00 S/N: 621000000 Checking target voltage... Target voltage: 3.30 V Listening on TCP/IP port 2331 Connecting to target...Connected to target Waiting for GDB connection...Connected to 127.0.0.1 Reading all registers Read 4 bytes @ address 0x00000000 (Data = 0x20010000) Target interface speed set to 1000 kHz Resetting target Halting target CPU... ...Target halted (PC = 0x00000530) R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000 R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000 R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000 R12= 00000000, R13= 20010000, MSP= 20010000, PSP= 00000000 R14(LR) = FFFFFFFF, R15(PC) = 00000530 XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000 CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00 Reading all registers Select auto target interface speed (1429 kHz) Flash breakpoints enabled Semi-hosting enabled (VectorAddr = 0x08) Semihosting I/O set to TELNET Client Downloading 1024 bytes @ address 0x00000000 - Verified OK Downloading 16 bytes @ address 0x00000400 - Verified OK Downloading 16080 bytes @ address 0x00000410 - Verified OK Downloading 1124 bytes @ address 0x000042E0 - Verified OK Downloading 4 bytes @ address 0x00004744 - Verified OK Downloading 4 bytes @ address 0x00004748 - Verified OK Downloading 680 bytes @ address 0x0000474C - Verified OK Read 4 bytes @ address 0x00000530 (Data = 0x480AB672) Read 2 bytes @ address 0x0000176C (Data = 0xF000) Read 2 bytes @ address 0x0000176C (Data = 0xF000) Read 2 bytes @ address 0x00000000 (Data = 0x0000) Read 2 bytes @ address 0x00000002 (Data = 0x2001) Read 2 bytes @ address 0x00000004 (Data = 0x0531) Read 2 bytes @ address 0x00000006 (Data = 0x0000) Read 2 bytes @ address 0x00000008 (Data = 0x0569) Read 2 bytes @ address 0x0000000A (Data = 0x0000) Read 2 bytes @ address 0x0000000C (Data = 0x0569) Read 2 bytes @ address 0x0000000E (Data = 0x0000) Read 2 bytes @ address 0x00000010 (Data = 0x0569) Read 2 bytes @ address 0x00000012 (Data = 0x0000) Read 2 bytes @ address 0x00000014 (Data = 0x0569) Read 2 bytes @ address 0x00000016 (Data = 0x0000) Read 2 bytes @ address 0x00000018 (Data = 0x0569) Read 2 bytes @ address 0x0000001A (Data = 0x0000) Read 2 bytes @ address 0x0000001C (Data = 0x0000) Read 2 bytes @ address 0x0000001E (Data = 0x0000) Read 2 bytes @ address 0x00000020 (Data = 0x0000) Read 2 bytes @ address 0x00000022 (Data = 0x0000) Read 2 bytes @ address 0x00000024 (Data = 0x0000) Read 2 bytes @ address 0x00000026 (Data = 0x0000) Read 2 bytes @ address 0x00000028 (Data = 0x0000) Read 2 bytes @ address 0x0000002A (Data = 0x0000) Read 2 bytes @ address 0x0000002C (Data = 0x0569) Read 2 bytes @ address 0x0000002E (Data = 0x0000) Read 2 bytes @ address 0x00000030 (Data = 0x0569) Read 2 bytes @ address 0x00000032 (Data = 0x0000) Read 2 bytes @ address 0x00000034 (Data = 0x0000) Read 2 bytes @ address 0x00000036 (Data = 0x0000) Read 2 bytes @ address 0x00000038 (Data = 0x0569) Read 2 bytes @ address 0x0000003A (Data = 0x0000) Read 2 bytes @ address 0x0000003C (Data = 0x0569) Read 2 bytes @ address 0x0000003E (Data = 0x0000) GDB closed TCP/IP connection

 

 

From the arm-none-eabi-gdb console:

monitor clrbp monitor reset monitor halt monitor regs flushreg Register cache flushed. monitor semihosting enable Warning: the current language does not match this frame. The target endianness is set automatically (currently little endian) No source file named C:\\Freescale\\workspaces\\SPI_Master_test\\Sources\\SPI_Master.c. No source file named C:\\Freescale\\workspaces\\SPI_Slave_test\\Sources\\SPI_Slave.c. No source file named C:\\Freescale\\workspaces\\SPI_Master_v2\\Sources\\SPI_M_v2.c.

 

It was working fine a couple hours ago, and it just started giving me this error.

When I try loading another project, the other project loads well, leading me to believe there is something wrong with this particular project. I am attaching the project

Original Attachment has been moved to: hello_world_frdmk22f.zip

Labels (1)
Tags (3)
0 Kudos
1 Solution
7,527 Views
BlackNight
NXP Employee
NXP Employee

Hi Christian,

the messages are not matching when I had such a problem (Failed to Debug with GDB: Breakpoints or Expressions on non-existing Locations | MCU on Eclipse), but it might be worthwile to remove/delete all breakpoints/watchpoints?

The GDB used in KDS has an issue in this area.

I hope this helps,

Erich

View solution in original post

0 Kudos
6 Replies
7,527 Views
Mockingbird
Contributor I

I have the same problem.  It should have been fixed by now.

0 Kudos
7,528 Views
BlackNight
NXP Employee
NXP Employee

Hi Christian,

the messages are not matching when I had such a problem (Failed to Debug with GDB: Breakpoints or Expressions on non-existing Locations | MCU on Eclipse), but it might be worthwile to remove/delete all breakpoints/watchpoints?

The GDB used in KDS has an issue in this area.

I hope this helps,

Erich

0 Kudos
7,528 Views
coopertrooper
Contributor III

HOLY MOTHER OF BREAKPOINTS!!!

I did as you said, and removed all breakpoints, and it actually runs now! I owe you much gratitude.

Any insight as to why this happen?

0 Kudos
7,529 Views
BlackNight
NXP Employee
NXP Employee

:-)

I think what happens is this: gdb tries to set a breakpoint on a debug/line information entry which does not exist any more (e.g. code got optimized out).

GDB internally traps/raises an exception, and as a result the connection gets terminated.

The good thing is that with the Q4_2014 launchpad tools (see Switching ARM GNU Tool Chain and Libraries in Kinetis Design Studio | MCU on Eclipse) that issue in gdb is fixed (at least I was not able to reproduce it any more.

Erich

0 Kudos
7,529 Views
coopertrooper
Contributor III

Eric,

Thank you so much for the help. I did notice that whenever i put a breakpoint, and then i change the code (add/remove lines) the breakpoints dont move with the lines!!! This is crazy to me, as I am used to the breakpoints moving with the source code.

This is good to know and to keep in mind for the future.

0 Kudos
7,529 Views
BlackNight
NXP Employee
NXP Employee

It depends how you set the breakpoints. If you are using the Source view, then breakpoints are identified by file name/line number:

pastedImage_0.png

you can use the gdb commands (e.g. 'break') to set the breakpoints on functions/etc.

Erich

0 Kudos