Debugging TI CC2538 with JLinkGDB and eclipse

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Debugging TI CC2538 with JLinkGDB and eclipse

    Hello,

    I'm trying to debug (Contiki OS on a) TI CC2538 using eclipse as IDE andJ-Link GDB. 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:

    Source Code

    1. SEGGER J-Link GDB Server V4.98e Command Line Version
    2. JLinkARM.dll V4.98e (DLL compiled May 5 2015 11:48:53)
    3. -----GDB Server start settings-----
    4. GDBInit file: none
    5. GDB Server Listening port: 2331
    6. SWO raw output listening port: 2332
    7. Terminal I/O port: 2333
    8. Accept remote connection: localhost only
    9. Generate logfile: off
    10. Verify download: on
    11. Init regs on start: off
    12. Silent mode: off
    13. Single run mode: on
    14. Target connection timeout: 0 ms
    15. ------J-Link related settings------
    16. J-Link Host interface: USB
    17. J-Link script: none
    18. J-Link settings file: none
    19. ------Target related settings------
    20. Target device: CC2538SF53
    21. Target interface: JTAG
    22. Target interface speed: 1000kHz
    23. Target endian: little
    24. Connecting to J-Link...
    25. J-Link is connected.
    26. Firmware: J-Link ARM / Flasher ARM V4 compiled Mar 31 2015 22:22:18
    27. Hardware: V4.00
    28. S/N: 164000090
    29. Feature(s): JFlash, GDB
    30. Checking target voltage...
    31. Target voltage: 3.31 V
    32. Listening on TCP/IP port 2331
    33. Connecting to target...
    34. J-Link found 2 JTAG devices, Total IRLen = 10
    35. JTAG ID: 0x4BA00477 (Cortex-M3)
    36. Connected to target
    37. Waiting for GDB connection...Connected to 127.0.0.1
    38. Reading all registers
    39. Read 1 bytes @ address 0x00000000 (Data = 0x00)
    40. Read 1 bytes @ address 0x00000000 (Data = 0x00)
    41. Read 1 bytes @ address 0x00000000 (Data = 0x00)
    42. Read 1 bytes @ address 0x00000000 (Data = 0x00)
    43. Read 1 bytes @ address 0x00000000 (Data = 0x00)
    44. Read 1 bytes @ address 0x00000000 (Data = 0x00)
    45. Reading 8 bytes @ address 0x00000000
    46. Reading 7 bytes @ address 0x00000000
    47. Target interface speed set to 1000 kHz
    48. Select auto target interface speed (4000 kHz)
    49. Flash breakpoints enabled
    50. Semi-hosting enabled (VectorAddr = 0x08)
    51. Semihosting I/O set to TELNET Client
    52. Read 1 bytes @ address 0x00000000 (Data = 0x00)
    53. Reading register (PRIMASK = 0x00000000)
    54. GDB closed TCP/IP connection
    Display All


    When I check the box "Connect to running target" in the debugger configuration I additionally get these gdb error information:

    Source Code

    1. GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
    2. [...]
    3. *** stack smashing detected ***: gdb terminated
    4. ======= Backtrace: =========
    5. /lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x45)[0xb72740e5]
    6. /lib/i386-linux-gnu/libc.so.6(+0x10409a)[0xb727409a]
    7. gdb[0x80ab1fc]
    8. gdb(gdbarch_unwind_pc+0xb8)[0x81d800e]
    9. gdb(dwarf2_tailcall_sniffer_first+0xbb)[0x8241403]
    10. gdb[0x823e55a]
    11. gdb[0x823eb17]
    12. gdb(frame_unwind_find_by_frame+0xa1)[0x809c59b]
    13. gdb(get_frame_id+0x94)[0x809849a]
    14. gdb(make_cleanup_restore_current_thread+0xf3)[0x81c756e]
    15. gdb(save_current_space_and_thread+0x18)[0x80a4e15]
    16. gdb(skip_prologue_sal+0x1d)[0x8195c7e]
    17. gdb(find_function_start_sal+0xbc)[0x8195c28]
    18. gdb[0x81aad3c]
    19. gdb[0x81aa2ac]
    20. gdb(iterate_over_symbols+0x6c)[0x8194fa1]
    21. gdb[0x81aab19]
    22. gdb[0x81aabfa]
    23. gdb(decode_line_internal+0x87f)[0x81a780e]
    24. gdb(decode_line_full+0x184)[0x81a7ae9]
    25. gdb[0x8157e65]
    26. gdb(create_breakpoint+0x1b0)[0x81585d7]
    27. gdb(mi_cmd_break_insert+0x21d)[0x8115485]
    28. gdb[0x811c070]
    29. gdb[0x811b77e]
    30. gdb(mi_execute_command+0x153)[0x811bb28]
    31. gdb[0x81172e2]
    32. gdb(gdb_readline2+0x121)[0x81d01ab]
    33. gdb(stdin_event_handler+0x6a)[0x81cf9ce]
    34. gdb[0x81cea36]
    35. gdb[0x81ce171]
    36. gdb(gdb_do_one_event+0xb7)[0x81ce236]
    37. gdb(start_event_loop+0x40)[0x81ce288]
    38. gdb[0x8117357]
    39. gdb[0x811730a]
    40. gdb(current_interp_command_loop+0x16)[0x81c91f1]
    41. gdb[0x8086b9e]
    42. gdb(catch_errors+0x4c)[0x81c8ac9]
    43. gdb[0x8087ad1]
    44. gdb(catch_errors+0x4c)[0x81c8ac9]
    45. gdb(gdb_main+0x34)[0x8087b07]
    46. gdb(main+0x52)[0x8086916]
    47. /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb71894d3]
    48. gdb[0x8086831]
    Display All


    Does anyone know what the problem here is?
  • Hi,

    The GDB server is started and the application downloaded but then the GDB server closes the connection.

    This is *not* correct.
    As can be clearly seen in the log output, GDB is closing the connection, *not* J-Link GDB Server. (GDB and GDB Server are different applications)

    *** stack smashing detected ***: gdb terminated

    Does not sound good...
    Is your GDB O.K. in general?

    Right now, it sounds like a problem on the GDB side (GDB seems to crash) and not like a problem on the J-Link / GDB Server side.


    - Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.