Hello,
I'm trying to debug Contiki OS on a CC2538DK using eclipse as IDE and J-Link GDB. I use JTAG and not the XDS100v3 debugger because later we will use our own CC2538 board. Therefore I created a new debug configuration of type GDB SEGGER J-Link Debugging. The problem is that the debugging doesn't work. The GDB server is started and the application downloaded but then the GDB server closes the connection.
See the output of the JLinkGDBServer here:
SEGGER J-Link GDB Server V4.98e Command Line Version JLinkARM.dll V4.98e (DLL compiled May 5 2015 11:48:53) -----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: off 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: CC2538SF53 Target interface: JTAG Target interface speed: 1000kHz Target endian: little Connecting to J-Link... J-Link is connected. Firmware: J-Link ARM / Flasher ARM V4 compiled Mar 31 2015 22:22:18 Hardware: V4.00 S/N: 164000090 Feature(s): JFlash, GDB Checking target voltage... Target voltage: 3.31 V Listening on TCP/IP port 2331 Connecting to target... J-Link found 2 JTAG devices, Total IRLen = 10 JTAG ID: 0x4BA00477 (Cortex-M3) Connected to target Waiting for GDB connection...Connected to 127.0.0.1 Reading all registers Read 1 bytes @ address 0x00000000 (Data = 0x00) Read 1 bytes @ address 0x00000000 (Data = 0x00) Read 1 bytes @ address 0x00000000 (Data = 0x00) Read 1 bytes @ address 0x00000000 (Data = 0x00) Read 1 bytes @ address 0x00000000 (Data = 0x00) Read 1 bytes @ address 0x00000000 (Data = 0x00) Reading 8 bytes @ address 0x00000000 Reading 7 bytes @ address 0x00000000 Target interface speed set to 1000 kHz Select auto target interface speed (4000 kHz) Flash breakpoints enabled Semi-hosting enabled (VectorAddr = 0x08) Semihosting I/O set to TELNET Client Read 1 bytes @ address 0x00000000 (Data = 0x00) Reading register (PRIMASK = 0x00000000) GDB closed TCP/IP connection
When I check the box "Connect to running target" in the debugger configuration I additionally get these gdb error information:
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04 [...] *** stack smashing detected ***: gdb terminated ======= Backtrace: ========= /lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x45)[0xb72740e5] /lib/i386-linux-gnu/libc.so.6(+0x10409a)[0xb727409a] gdb[0x80ab1fc] gdb(gdbarch_unwind_pc+0xb8)[0x81d800e] gdb(dwarf2_tailcall_sniffer_first+0xbb)[0x8241403] gdb[0x823e55a] gdb[0x823eb17] gdb(frame_unwind_find_by_frame+0xa1)[0x809c59b] gdb(get_frame_id+0x94)[0x809849a] gdb(make_cleanup_restore_current_thread+0xf3)[0x81c756e] gdb(save_current_space_and_thread+0x18)[0x80a4e15] gdb(skip_prologue_sal+0x1d)[0x8195c7e] gdb(find_function_start_sal+0xbc)[0x8195c28] gdb[0x81aad3c] gdb[0x81aa2ac] gdb(iterate_over_symbols+0x6c)[0x8194fa1] gdb[0x81aab19] gdb[0x81aabfa] gdb(decode_line_internal+0x87f)[0x81a780e] gdb(decode_line_full+0x184)[0x81a7ae9] gdb[0x8157e65] gdb(create_breakpoint+0x1b0)[0x81585d7] gdb(mi_cmd_break_insert+0x21d)[0x8115485] gdb[0x811c070] gdb[0x811b77e] gdb(mi_execute_command+0x153)[0x811bb28] gdb[0x81172e2] gdb(gdb_readline2+0x121)[0x81d01ab] gdb(stdin_event_handler+0x6a)[0x81cf9ce] gdb[0x81cea36] gdb[0x81ce171] gdb(gdb_do_one_event+0xb7)[0x81ce236] gdb(start_event_loop+0x40)[0x81ce288] gdb[0x8117357] gdb[0x811730a] gdb(current_interp_command_loop+0x16)[0x81c91f1] gdb[0x8086b9e] gdb(catch_errors+0x4c)[0x81c8ac9] gdb[0x8087ad1] gdb(catch_errors+0x4c)[0x81c8ac9] gdb(gdb_main+0x34)[0x8087b07] gdb(main+0x52)[0x8086916] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb71894d3] gdb[0x8086831]
Does anyone know what the problem here is?