[SOLVED] JLink appears to be stuck in an infinite loop at the initial breakpoint

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

  • [SOLVED] JLink appears to be stuck in an infinite loop at the initial breakpoint

    I have one particular project where when I try to debug it, the JlinkServer says that it is stopping at the breakpoint in main(), then it reports that it is reading the registers, and then immediately says "Starting target CPU..." and loops there over and over forever. When this happens, the halt and other icons are grayed out and the only thing that I can do is to click the stop debug icon whereupon it ends. During this time my computer is in overload mode and the fan runs.

    This is happening in MCUXpresso on Windows with an NXP K8x target.
    The other thing to point out is that it only happens for this one project in the workspace. The other two projects do no have this happen, but I cannot figure out what settings are different between them.

    Here is example output from the JLinkServer console:

    Source Code

    1. Starting target CPU...
    2. ...Breakpoint reached @ address 0x00039AA6
    3. Reading common registers: Read register 'r0' (4 bytes) from hardware: 0x00000000
    4. Read register 'r1' (4 bytes) from hardware: 0x00000000
    5. Read register 'r2' (4 bytes) from hardware: 0x2001C53C
    6. Read register 'r3' (4 bytes) from hardware: 0x00000000
    7. Read register 'r4' (4 bytes) from hardware: 0x00000000
    8. Read register 'r5' (4 bytes) from hardware: 0x00000000
    9. Read register 'r6' (4 bytes) from hardware: 0x1C00045C
    10. Read register 'r7' (4 bytes) from hardware: 0x00000000
    11. Read register 'r8' (4 bytes) from hardware: 0x0000173D
    12. Read register 'r9' (4 bytes) from hardware: 0x00000000
    13. Read register 'r10' (4 bytes) from hardware: 0x1FFF0000
    14. Read register 'r11' (4 bytes) from hardware: 0x00000000
    15. Read register 'r12' (4 bytes) from hardware: 0x00000002
    16. Read register 'sp' (4 bytes) from hardware: 0x20000000
    17. Read register 'lr' (4 bytes) from hardware: 0x00005D6F
    18. Read register 'pc' (4 bytes) from hardware: 0x00039AA6
    19. Read register 'xpsr' (4 bytes) from hardware: 0x61000000
    20. Starting target CPU...
    21. ...Breakpoint reached @ address 0x00039AA6
    22. Reading common registers: Read register 'r0' (4 bytes) from hardware: 0x00000000
    23. Read register 'r1' (4 bytes) from hardware: 0x00000000
    24. Read register 'r2' (4 bytes) from hardware: 0x2001C53C
    25. Read register 'r3' (4 bytes) from hardware: 0x00000000
    26. Read register 'r4' (4 bytes) from hardware: 0x00000000
    27. Read register 'r5' (4 bytes) from hardware: 0x00000000
    28. Read register 'r6' (4 bytes) from hardware: 0x1C00045C
    29. Read register 'r7' (4 bytes) from hardware: 0x00000000
    30. Read register 'r8' (4 bytes) from hardware: 0x0000173D
    31. Read register 'r9' (4 bytes) from hardware: 0x00000000
    32. Read register 'r10' (4 bytes) from hardware: 0x1FFF0000
    33. Read register 'r11' (4 bytes) from hardware: 0x00000000
    34. Read register 'r12' (4 bytes) from hardware: 0x00000002
    35. Read register 'sp' (4 bytes) from hardware: 0x20000000
    36. Read register 'lr' (4 bytes) from hardware: 0x00005D6F
    37. Read register 'pc' (4 bytes) from hardware: 0x00039AA6
    38. Read register 'xpsr' (4 bytes) from hardware: 0x61000000
    39. Starting target CPU...
    Display All
  • Hi,

    the "Go" commands you are seeing are coming from GDB.
    So it is basically GDB that is stuck in some kind of endless loop.

    This is most probably because the breakpoint at 0x00039AA6 is probably not a breakpoint that GDB set on itself.
    Can you check if you have any BP set at this address?

    Also, which J-Link SW version are you using?
    Note that V7.92l comes with a fix for the case I explained above, see release notes for V7.92l:
    segger.com/downloads/jlink/ReleaseNotes_JLink.html



    BR
    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.