[SOLVED] Can't debug on new laptop (Windows 10) with new tools

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

  • [SOLVED] Can't debug on new laptop (Windows 10) with new tools

    I have code that works on my old desktop just fine. I'm trying to move over to a new laptop, so I installed new versions of everything. I got it compile (eventually), but the debugger won't write to Flash & run code.

    Tools:
    working:
    Windows 7, J-Link V496m, Eclipse Luna, msys, gae-4.9_2014q4

    On the laptop:
    Windows 10, J-Link V512f, Eclipse Mars, msys64, gae-4.9_2015q3 (gae 5.3 compiled it differently, and didn't fit into the size constraints)

    Same J-Link debugger

    Source Code

    1. SEGGER J-Link GDB Server V5.12f Command Line Version
    2. JLinkARM.dll V5.12f (DLL compiled May 17 2016 16:03:35)
    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: on
    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: SiM3U167
    21. Target interface: SWD
    22. Target interface speed: auto
    23. Target endian: little
    24. Connecting to J-Link...
    25. J-Link is connected.
    26. Firmware: J-Link V9 compiled Apr 22 2016 11:47:06
    27. Hardware: V9.30
    28. S/N: 59302821
    29. Feature(s): GDB
    30. Checking target voltage...
    31. Target voltage: 3.34 V
    32. Listening on TCP/IP port 2331
    33. Connecting to target...Connected to target
    34. Waiting for GDB connection...Connected to 127.0.0.1
    35. Reading all registers
    36. Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF)
    37. Target interface speed set to 400 kHz
    38. Resetting target
    39. Halting target CPU...
    40. ...Target halted (PC = 0xFFFFFFFE)
    41. R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    42. R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    43. R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    44. R12= 00000000, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 00000000
    45. R14(LR) = FFFFFFFF, R15(PC) = FFFFFFFE
    46. XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    47. CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    48. Reading all registers
    49. WARNING: Failed to read memory @ address 0xFFFFFFFE
    50. Select auto target interface speed (2000 kHz)
    51. Flash breakpoints enabled
    52. Semi-hosting enabled (Handle on BKPT)
    53. Semihosting I/O set to TELNET Client
    54. SWO disabled succesfully.
    55. SWO enabled succesfully.
    56. WARNING: Failed to read memory @ address 0xFFFFFFFE
    57. Downloading 280 bytes @ address 0x00000000 - Verified OK
    58. Downloading 4096 bytes @ address 0x00000118 - Verified OK
    59. Downloading 4096 bytes @ address 0x00001118 - Verified OK
    60. :
    61. Downloading 1024 bytes @ address 0x0001D000 - Verified OK
    62. Downloading 212 bytes @ address 0x0001D400 - Verified OK
    63. Downloading 4 bytes @ address 0x0001FFF8 - Verified OK
    64. Downloading 4 bytes @ address 0x0003FFFC - Verified OK
    65. Writing register (PC = 0x00002d18)
    66. Read 4 bytes @ address 0x00002D18 (Data = 0xF000B508)
    67. Read 2 bytes @ address 0x0000E730 (Data = 0xB530)
    68. Read 2 bytes @ address 0x0000E732 (Data = 0x2000)
    69. Read 2 bytes @ address 0x0000E734 (Data = 0xB083)
    70. Read 2 bytes @ address 0x0000E736 (Data = 0xF7F9)
    71. Read 2 bytes @ address 0x0000E738 (Data = 0xF9D5)
    72. Read 2 bytes @ address 0x0000E736 (Data = 0xF7F9)
    73. WARNING: Failed to reset CPU. VECTRESET has confused core.
    74. WARNING: CPU did not halt after reset.
    75. WARNING: CPU could not be halted
    76. WARNING: CPU did not halt after reset.
    77. WARNING: CPU could not be halted
    78. WARNING: S_RESET_ST not cleared
    79. :
    80. ERROR: DAP error while reading AIRCR / CPUID register
    81. Resetting target
    82. Halting target CPU...
    83. WARNING: CPU could not be halted
    84. ERROR: Can not read register 15 (R15) while CPU is running
    85. ...Target halted (PC = 0x00000000)
    86. Read 2 bytes @ address 0x0000E730 (Data = 0xB530)
    87. Read 2 bytes @ address 0x0000E732 (Data = 0x2000)
    88. Read 2 bytes @ address 0x0000E734 (Data = 0xB083)
    89. Read 2 bytes @ address 0x0000E736 (Data = 0xF7F9)
    90. Read 2 bytes @ address 0x0000E738 (Data = 0xF9D5)
    91. Read 2 bytes @ address 0x0000E736 (Data = 0xF7F9)
    92. ERROR: Can not read register 24 (PRIMASK) while CPU is running
    93. ERROR: Can not read register 25 (BASEPRI) while CPU is running
    94. ERROR: Can not read register 26 (FAULTMASK) while CPU is running
    95. :
    96. ERROR: Can not read register 1 (R1) while CPU is running
    97. ERROR: Can not read register 0 (R0) while CPU is running
    98. R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    99. R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    100. R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    101. R12= 00000000, R13= 00000000, MSP= 00000000, PSP= 00000000
    102. R14(LR) = 00000000, R15(PC) = 00000000
    103. XPSR 00000000, APSR 00000000, EPSR 00000000, IPSR 00000000
    104. CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    Display All


    This is the startup sequence on the working system:

    Source Code

    1. SEGGER J-Link GDB Server V4.96m Command Line Version
    2. JLinkARM.dll V4.96m (DLL compiled Mar 13 2015 15:13:04)
    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: on
    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: SiM3U167
    21. Target interface: SWD
    22. Target interface speed: 0kHz
    23. Target endian: little
    24. Connecting to J-Link...
    25. J-Link is connected.
    26. Firmware: J-Link V9 compiled Apr 22 2016 11:47:06
    27. Hardware: V9.30
    28. S/N: 59302821
    29. Feature(s): GDB
    30. Checking target voltage...
    31. Target voltage: 3.35 V
    32. Listening on TCP/IP port 2331
    33. Connecting to target...Connected to target
    34. Waiting for GDB connection...Connected to 127.0.0.1
    35. Reading all registers
    36. Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF)
    37. Target interface speed set to 400 kHz
    38. Resetting target
    39. Halting target CPU...
    40. ...Target halted (PC = 0xFFFFFFFE)
    41. R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    42. R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    43. R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    44. R12= 00000000, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 00000000
    45. R14(LR) = FFFFFFFF, R15(PC) = FFFFFFFE
    46. XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    47. CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    48. Reading all registers
    49. WARNING: Failed to read memory @ address 0xFFFFFFFE
    50. Select auto target interface speed (2000 kHz)
    51. Flash breakpoints enabled
    52. Semi-hosting enabled (VectorAddr = 0x08)
    53. Semihosting I/O set to TELNET Client
    54. SWO disabled succesfully.
    55. SWO enabled succesfully.
    56. WARNING: Failed to read memory @ address 0xFFFFFFFE
    57. Downloading 280 bytes @ address 0x00000000 - Verified OK
    58. Downloading 4096 bytes @ address 0x00000118 - Verified OK
    59. :
    60. Downloading 212 bytes @ address 0x0001D408 - Verified OK
    61. Downloading 4 bytes @ address 0x0001FFF8 - Verified OK
    62. Downloading 4 bytes @ address 0x0003FFFC - Verified OK
    63. Writing register (PC = 0x00002d18)
    64. Read 4 bytes @ address 0x00002D18 (Data = 0xF000B508)
    65. Read 2 bytes @ address 0x00000000 (Data = 0x8000)
    66. :
    67. Read 2 bytes @ address 0x0000E68E (Data = 0x2000)
    68. Read 2 bytes @ address 0x0000E68C (Data = 0xB508)
    69. Resetting target
    70. Halting target CPU...
    71. ...Target halted (PC = 0x00000A28)
    72. Read 2 bytes @ address 0x0000E68E (Data = 0x2000)
    73. Read 2 bytes @ address 0x0000E68E (Data = 0x2000)
    74. Read 2 bytes @ address 0x0000E68C (Data = 0xB508)
    75. R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    76. R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    77. R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    78. R12= 00000000, R13= 20008000, MSP= 20008000, PSP= 00000000
    79. R14(LR) = FFFFFFFF, R15(PC) = 00000A28
    80. XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    81. CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    82. Reading all registers
    83. Read 4 bytes @ address 0x00000A28 (Data = 0x4B0AB508)
    84. Setting breakpoint @ address 0x00006812, Size = 2, BPHandle = 0x0002
    85. Setting breakpoint @ address 0x0000E68C, Size = 2, BPHandle = 0x0003
    86. Starting target CPU...
    Display All
  • Hi,

    could you please give J-Link Commander a try?
    J-Link commander is part of the J-Link software package, which is available free of charge here .

    • Start J-Link Commander (jlink.exe)
    • Type "connect" in order to start a debug session
    • Type in the target device name if asked (Or type "?" for a target selection Dialog)
    • Choose the correct target interface (JTAG/SWD/etc..)
    • Use a valid speed (Default: 4000kHz, try 100-500 if default does not work)
    • [JTAG only]JTAG conf can be default(most of the times)
    • You should now be successfully connected.
    If anything fails, could you post a screenshot of the complete session?

    Best regards,
    Niklas
    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.
  • So what has that shown me? The jlink tool can connect to the hardware, but not after downloading code to the hardware. However, I have it set to stop at main( ), and this code works on my old PC. Should I try an older version of jlink?
  • solved - bad Eclipse project settings

    Okay - figured it out myself after I had some time to think about it.
    The .cproject settings in Eclipse were messed up. At some point, in getting things to compile I ended up with two copies of the release configuration, and no debug configuration. So I was effectively loading the release code and then trying to debug it.

    The post was edited 1 time, last by nerfer ().

  • Hi,


    Good to hear that you are up and running!

    Best regards,
    Niklas
    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.