[SOLVED] JLink takes several tries to connect to STM32H730

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

  • [SOLVED] JLink takes several tries to connect to STM32H730

    Hello,
    with the most recent versions of JLink, the connection to the STM32H730 takes many tries.
    Typically I can connect in the JLink command line, but it takes two tries (the first "connect" will not work, while the second "connect" will work).
    If I re-launch JLink command line, the same behavior happens again (the first "connect" will never work).

    It was working with older JLink versions, so there must be a regression here.


    Source Code

    1. > jlink
    2. SEGGER J-Link Commander V7.92b (Compiled Aug 23 2023 4:01:42)
    3. DLL version V7.92b, compiled Aug 23 2023 14:00:04
    4. Connecting to J-Link via USB...O.K.
    5. Firmware: J-Trace PRO V2 Cortex-M compiled Jun 6 2023 10:51:16
    6. Hardware version: V2.00
    7. J-Link uptime (since boot): 8d 18h 29m 12s
    8. S/N: 752001898
    9. License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    10. USB speed mode: Super speed (5 GBit/s)
    11. IP-Addr: DHCP (no addr. received yet)
    12. Emulator has RAWTRACE capability
    13. VTref=1.779V
    14. Type "connect" to establish a target connection, '?' for help
    15. J-Link>connect
    16. Please specify device / core. <Default>: STM32H730IB
    17. Type '?' for selection dialog
    18. Device>
    19. Please specify target interface:
    20. J) JTAG (Default)
    21. S) SWD
    22. T) cJTAG
    23. TIF>s
    24. Specify target interface speed [kHz]. <Default>: 4000 kHz
    25. Speed>
    26. Device "STM32H730IB" selected.
    27. Connecting to target via SWD
    28. ConfigTargetSettings() start
    29. ConfigTargetSettings() end - Took 12us
    30. InitTarget() start
    31. SWD selected. Executing JTAG -> SWD switching sequence.
    32. DAP initialized successfully.
    33. Can not attach to CPU. Trying connect under reset.
    34. SWD selected. Executing JTAG -> SWD switching sequence.
    35. DAP initialized successfully.
    36. Timeout while waiting for CPU to halt.
    37. Connecting to CPU via connect under reset failed.
    38. InitTarget() end - Took 662ms
    39. Connect failed. Resetting via Reset pin and trying again.
    40. ConfigTargetSettings() start
    41. ConfigTargetSettings() end - Took 8us
    42. InitTarget() start
    43. SWD selected. Executing JTAG -> SWD switching sequence.
    44. DAP initialized successfully.
    45. Can not attach to CPU. Trying connect under reset.
    46. SWD selected. Executing JTAG -> SWD switching sequence.
    47. DAP initialized successfully.
    48. Timeout while waiting for CPU to halt.
    49. Connecting to CPU via connect under reset failed.
    50. InitTarget() end - Took 661ms
    51. Cannot connect to target.
    52. J-Link>connect
    53. Device "STM32H730IB" selected.
    54. Connecting to target via SWD
    55. ConfigTargetSettings() start
    56. ConfigTargetSettings() end - Took 7us
    57. InitTarget() start
    58. SWD selected. Executing JTAG -> SWD switching sequence.
    59. DAP initialized successfully.
    60. Can not attach to CPU. Trying connect under reset.
    61. SWD selected. Executing JTAG -> SWD switching sequence.
    62. DAP initialized successfully.
    63. Timeout while waiting for CPU to halt.
    64. Connecting to CPU via connect under reset failed.
    65. InitTarget() end - Took 658ms
    66. ConfigTargetSettings() start
    67. ConfigTargetSettings() end - Took 7us
    68. InitTarget() start
    69. SWD selected. Executing JTAG -> SWD switching sequence.
    70. DAP initialized successfully.
    71. InitTarget() end - Took 6.47ms
    72. Found SW-DP with ID 0x6BA02477
    73. DPIDR: 0x6BA02477
    74. CoreSight SoC-400 or earlier
    75. Scanning AP map to find all available APs
    76. AP[3]: Stopped AP scan as end of AP map has been reached
    77. AP[0]: AHB-AP (IDR: 0x84770001)
    78. AP[1]: AHB-AP (IDR: 0x84770001)
    79. AP[2]: APB-AP (IDR: 0x54770002)
    80. Iterating through AP map to find AHB-AP to use
    81. AP[0]: Core found
    82. AP[0]: AHB-AP ROM base: 0xE00FE000
    83. CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)
    84. Cache: L1 I/D-cache present
    85. Found Cortex-M7 r1p2, Little endian.
    86. FPUnit: 8 code (BP) slots and 0 literal slots
    87. CoreSight components:
    88. ROMTbl[0] @ E00FE000
    89. [0][0]: E00FF000 CID B105100D PID 000BB4C7 ROM Table
    90. ROMTbl[1] @ E00FF000
    91. [1][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    92. [1][1]: E0001000 CID B105E00D PID 000BB002 DWT
    93. [1][2]: E0002000 CID B105E00D PID 000BB00E FPB-M7
    94. [1][3]: E0000000 CID B105E00D PID 000BB001 ITM
    95. [0][1]: E0041000 CID B105900D PID 001BB975 ETM-M7
    96. [0][2]: E0043000 CID B105900D PID 004BB906 CTI
    97. I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way
    98. D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
    99. Memory zones:
    100. Zone: "Default" Description: Default access mode
    101. Cortex-M7 identified.
    Display All

    Thanks,
    Florent
  • Can you post a screenshot of the old version that shows that multiple connects in a row work?

    I would be surprised if a popular chip like the STM32H5 series would be that broken in a generic way but nobody else ran into and reported it.

    Are you 100% sure that it was ONLY the J-Link version you changed and not also the target application that changed, which now maybe switches the debug pins to GPIO by accident or similar?
    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.
  • Yes, it is working first time on JLink 7.68.
    It is the exact same board, with the same JTrace, and exactly the same connections (the only change is the JLink software).

    Source Code

    1. λ jlink
    2. SEGGER J-Link Commander V7.68 (Compiled Jul 14 2022 16:56:10)
    3. DLL version V7.68, compiled Jul 14 2022 16:54:28
    4. Connecting to J-Link via USB...O.K.
    5. Firmware: J-Trace PRO V2 Cortex-M compiled Jun 6 2023 10:51:16
    6. Hardware version: V2.00
    7. J-Link uptime (since boot): 0d 00h 27m 42s
    8. S/N: 752001898
    9. License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    10. USB speed mode: Super speed (5 GBit/s)
    11. IP-Addr: DHCP (no addr. received yet)
    12. Emulator has RAWTRACE capability
    13. VTref=1.826V
    14. Type "connect" to establish a target connection, '?' for help
    15. J-Link>connect
    16. Please specify device / core. <Default>: EFR32BG22CXXXF352
    17. Type '?' for selection dialog
    18. Device>STM32H730IB
    19. Please specify target interface:
    20. J) JTAG (Default)
    21. S) SWD
    22. T) cJTAG
    23. TIF>s
    24. Specify target interface speed [kHz]. <Default>: 4000 kHz
    25. Speed>
    26. Device "STM32H730IB" selected.
    27. Connecting to target via SWD
    28. ConfigTargetSettings() start
    29. ConfigTargetSettings() end
    30. Found SW-DP with ID 0x6BA02477
    31. STM32 (connect): Can not attach to CPU. Trying connect under reset.
    32. Found SW-DP with ID 0x6BA02477
    33. Active write protected STM32 device detected.
    34. This could cause problems during flash download.
    35. Note: Unsecuring will trigger a mass erase of the internal flash.
    36. Executing default behavior previously saved in the registry.
    37. Device will be unsecured now.
    38. Found SW-DP with ID 0x6BA02477
    39. DPIDR: 0x6BA02477
    40. CoreSight SoC-400 or earlier
    41. Scanning AP map to find all available APs
    42. AP[3]: Stopped AP scan as end of AP map has been reached
    43. AP[0]: AHB-AP (IDR: 0x84770001)
    44. AP[1]: AHB-AP (IDR: 0x84770001)
    45. AP[2]: APB-AP (IDR: 0x54770002)
    46. Iterating through AP map to find AHB-AP to use
    47. AP[0]: Core found
    48. AP[0]: AHB-AP ROM base: 0xE00FE000
    49. CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)
    50. Found Cortex-M7 r1p2, Little endian.
    51. FPUnit: 8 code (BP) slots and 0 literal slots
    52. CoreSight components:
    53. ROMTbl[0] @ E00FE000
    54. [0][0]: E00FF000 CID B105100D PID 000BB4C7 ROM Table
    55. ROMTbl[1] @ E00FF000
    56. [1][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    57. [1][1]: E0001000 CID B105E00D PID 000BB002 DWT
    58. [1][2]: E0002000 CID B105E00D PID 000BB00E FPB-M7
    59. [1][3]: E0000000 CID B105E00D PID 000BB001 ITM
    60. [0][1]: E0041000 CID B105900D PID 001BB975 ETM-M7
    61. [0][2]: E0043000 CID B105900D PID 004BB906 CTI
    62. Cache: Separate I- and D-cache.
    63. I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way
    64. D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
    65. Cortex-M7 identified.
    66. J-Link>
    Display All
    However, I am using the JTrace Pro, which I suspect not many people are using, so it may be broken since quite a long time.

    Thanks,
    Florent
  • Hi Florent,
    I just gave this a quick try on the STM32H735G-DK (STM32H735).
    I could not test it on an STM32H730, as there are no evaluation boards available as far as I know,
    but both should behave the same from a debug standpoint.

    On our side it worked without any issues with J-Trace Pro V2 Cortex-M (see below).

    Do you have any target application running on your device?
    If so, does the same issue appear after erasing & power-cycling the device?

    Best regards,
    Fabian

    Source Code

    1. Firmware: J-Trace PRO V2 Cortex-M compiled Jun 6 2023 10:51:16
    2. Hardware version: V2.00
    3. J-Link uptime (since boot): 0d 00h 00m 01s
    4. S/N: 752060000
    5. License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    6. USB speed mode: High speed (480 MBit/s)
    7. IP-Addr: DHCP (no addr. received yet)
    8. Emulator has RAWTRACE capability
    9. VTref=3.307V
    10. Device "STM32H730IB" selected.
    11. Connecting to target via SWD
    12. ConfigTargetSettings() start
    13. ConfigTargetSettings() end - Took 15us
    14. InitTarget() start
    15. SWD selected. Executing JTAG -> SWD switching sequence.
    16. DAP initialized successfully.
    17. InitTarget() end - Took 7.04ms
    18. Found SW-DP with ID 0x6BA02477
    19. DPIDR: 0x6BA02477
    20. CoreSight SoC-400 or earlier
    21. Scanning AP map to find all available APs
    22. AP[3]: Stopped AP scan as end of AP map has been reached
    23. AP[0]: AHB-AP (IDR: 0x84770001)
    24. AP[1]: AHB-AP (IDR: 0x84770001)
    25. AP[2]: APB-AP (IDR: 0x54770002)
    26. Iterating through AP map to find AHB-AP to use
    27. AP[0]: Core found
    28. AP[0]: AHB-AP ROM base: 0xE00FE000
    29. CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)
    30. Cache: L1 I/D-cache present
    31. Found Cortex-M7 r1p2, Little endian.
    32. FPUnit: 8 code (BP) slots and 0 literal slots
    33. CoreSight components:
    34. ROMTbl[0] @ E00FE000
    35. [0][0]: E00FF000 CID B105100D PID 000BB4C7 ROM Table
    36. ROMTbl[1] @ E00FF000
    37. [1][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    38. [1][1]: E0001000 CID B105E00D PID 000BB002 DWT
    39. [1][2]: E0002000 CID B105E00D PID 000BB00E FPB-M7
    40. [1][3]: E0000000 CID B105E00D PID 000BB001 ITM
    41. [0][1]: E0041000 CID B105900D PID 001BB975 ETM-M7
    42. [0][2]: E0043000 CID B105900D PID 004BB906 CTI
    43. I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way
    44. D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
    45. Memory zones:
    46. Zone: "Default" Description: Default access mode
    47. Cortex-M7 identified.
    Display All
    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.