J-Link on linux and at91sam9g20 kernel debugging

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

  • J-Link on linux and at91sam9g20 kernel debugging

    Hello,
    I'm trying to use GNU tools to debug kernel modules with j-link. I have downloaded actual beta version of driver for linux (4.22a) and now I'm trying to do some progress.
    Unfortunately I'm hanging just at the beginning. When I try to connect to JLinkGDBServer with gdb (target remote :2331) I'm getting following messages

    Source Code

    1. SEGGER J-Link GDB Server V4.22
    2. JLinkARM.dll V4.22 (DLL compiled Apr 5 2011 13:54:52)
    3. Listening on TCP/IP port 2331
    4. J-Link connected
    5. Firmware: J-Link ARM V8 compiled Jun 21 2011 20:26:20
    6. Hardware: V8.00
    7. S/N: 58004787
    8. J-Link found 1 JTAG device, Total IRLen = 4
    9. JTAG ID: 0x0792603F (ARM9)
    10. Connected to 127.0.0.1
    11. WARNING: Unknown packet received: "qSupported:qRelocInsn+"
    12. Reading all registers
    13. WARNING: Failed to read cacheable memory @ address 0x00000000
    14. Read 4 bytes @ address 0x00000000 (Data = 0x678E10B7)
    15. WARNING: Failed to read memory @ address 0xFFFFFFFC
    16. Read 4 bytes @ address 0xFFFFFFFC (Data = 0xAAAAAAAA)
    17. WARNING: Failed to read cacheable memory @ address 0x00000000
    18. Read 4 bytes @ address 0x00000000 (Data = 0xAAAAAAAA)
    19. WARNING: Failed to read memory @ address 0xFFFFFFFC
    20. Read 4 bytes @ address 0xFFFFFFFC (Data = 0xAAAAAAAA)
    21. WARNING: Failed to read cacheable memory @ address 0x00000000
    22. Read 4 bytes @ address 0x00000000 (Data = 0xAAAAAAAA)
    23. WARNING: Failed to read memory @ address 0xFFFFFFFC
    24. Read 4 bytes @ address 0xFFFFFFFC (Data = 0xAAAAAAAA)
    25. WARNING: Failed to read cacheable memory @ address 0x00000000
    26. Read 4 bytes @ address 0x00000000 (Data = 0xAAAAAAAA)
    27. WARNING: Failed to read cacheable memory @ address 0x00000000
    28. Read 4 bytes @ address 0x00000000 (Data = 0xAAAAAAAA)
    29. WARNING: Failed to read cacheable memory @ address 0x00000000
    30. Read 4 bytes @ address 0x00000000 (Data = 0xAAAAAAAA)
    31. Starting target CPU...
    Display All

    Command continue never ends. I have found many "howtos" for kernel debugging with JTAG, but I can't get working any of them with described configuration.
    Any help would be appreciated.
    best regards
    Jan
  • Hi Jan,

    Could you please check out the current Linux version (V4.30) which is available for download on our website?
    It should correct the problem with the
    WARNING: Unknown packet received: "qSupported:qRelocInsn+"

    problem.


    Best regards
    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.
  • Hi Alex,
    thank you for answer. I have tried it again with newer version, unfortunately the situation is the same (except of qSupported:qRelocInsn+ warning).
    I performed following steps:
    1. Boot linux kernel with debugging symbols on the board
    2. Connect the j-link
    3. Run JLinkGDBServer -endian=little
    now the board is stopped
    4. arm-none-linux-gdb vmlinux
    gdbserver warns about reading cacheable memory5.
    5. continue
    kernel execution is not resumed

    I have tried the debugging also in an evaluation of Codesourcery Codebench, it works better, but it uses some middle layer called sprite.
    Am I missing something obvious? Does the gdbserver have any option to attach a running board?
    regards
    Jan
  • Hello,
    do you have please any advice how to make kernel debugging working? I think I have tried almost everything, but still no success.
    It seems to me that J-Link resets the board after GDBServer (or gdb?) connecting.
    (gdb) target remote :2331
    Remote debugging using :2331
    0x00000000 in ?? ()
    (gdb) c
    Continuing.

    Is there any way to attach the debugger to running program? I'm trying this on Ubuntu 11.04 with latest beta, but the behaviour is the same on Windows...
    regards
    Jan
  • Hi Jan,

    Is there any way to attach the debugger to running program?

    No, currently not.
    We will check if something like attach will be added in future versions on the GDBServer.


    Best regards
    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.
  • Hi Christoph,

    NOTE: Option -nori (do not init registers) is not documented.

    Incorrect. UM08001 (J-Link User Guide) V4.96 Rev. 0, chapter "3.3.5 Command line options":

    C Source Code

    1. -ir Initialize the CPU registers on start of GDB Server. (Default)
    2. -noir Do not initialize CPU registers on start of GDB Server.
    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.