[SOLVED] Issues switching from ST-LINK to J-LINK

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

  • [SOLVED] Issues switching from ST-LINK to J-LINK

    Hoping someone could assist with a problem I'm having. I recently purchased a J-link Ultra+ to replace the ST-LINK V2 I am using for a project. I am using True Studio.

    I am connecting to the target CPU (STM32F746) via SWD, and I've been able to connect and program/debug the chip just fine using the ST-LINK programmer. However I cannot connect using the J-link device. I get the following output:


    Source Code

    1. SEGGER J-Link GDB Server V6.22b Command Line Version
    2. JLinkARM.dll V6.22b (DLL compiled Dec 6 2017 17:02:06)
    3. Command line: -port 2331 -s -CPU Cortex-M -device STM32F746VG -endian little -speed 4000 -if swd -vd -rtos C:\Program Files (x86)\Atollic\TrueSTUDIO for ARM 8.0.0\Servers\J-Link_gdbserver\GDBServer\RTOSPlugin_FreeRTOS.dll -swoport 2332
    4. -----GDB Server start settings-----
    5. GDBInit file: none
    6. GDB Server Listening port: 2331
    7. SWO raw output listening port: 2332
    8. Terminal I/O port: 2333
    9. Accept remote connection: localhost only
    10. Generate logfile: off
    11. Verify download: on
    12. Init regs on start: off
    13. Silent mode: off
    14. Single run mode: on
    15. Target connection timeout: 0 ms
    16. ------J-Link related settings------
    17. J-Link Host interface: USB
    18. J-Link script: none
    19. J-Link settings file: none
    20. ------Target related settings------
    21. Target device: STM32F746VG
    22. Target interface: SWD
    23. Target interface speed: 4000kHz
    24. Target endian: little
    25. Connecting to J-Link...
    26. J-Link is connected.
    27. Firmware: J-Link Ultra V4 compiled Nov 28 2017 11:47:50
    28. Hardware: V4.00
    29. S/N: 504403398
    30. Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
    31. Checking target voltage...
    32. Target voltage: 3.31 V
    33. Listening on TCP/IP port 2331
    34. Connecting to target...ERROR: STM32: Connecting to CPU via connect under reset failed.
    Display All



    Could someone assist in working out what's different between the two?

    Thanks!
  • Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.

    When setting up True Studio did you folow the following guide? segger.com/products/debug-prob…/ides/atollic-truestudio/

    The log suggests that the connect under reset is not working. Is the reset pin from the MCU connected to J-Link?
    Are you using an eval board or custom hardware?
    To get True Studio out of the equation could you run J-Link Commander (one of the programs in the J-Link Software and Documentation pack) and post a screenshot of the whole connection sequence?

    How to is described here: wiki.segger.com/J-Link_cannot_connect_to_the_CPU

    Best regards,
    Nino
    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.
  • Custom hardware. The reset pin from the MCU is not connected. We have limited space for a programming/debugger connection and elected to leave that pin off because we understood that, though useful, it was not necessary. The pins that are connected are GND, VDD, SWDIO, SWCLK, and SWO. Is there a setting that needs to be changed to allow for that?

    Commander output:

    SEGGER J-Link Commander V6.22b (Compiled Dec 6 2017 17:02:44)
    DLL version V6.22b, compiled Dec 6 2017 17:02:06

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link Ultra V4 compiled Nov 28 2017 11:47:50
    Hardware version: V4.00
    S/N: 504403398
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    VTref = 0.000V


    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. : STM32F746VG
    Type '?' for selection dialog
    Device>?
    Please specify target interface:
    J) JTAG (Default)
    S) SWD
    TIF>S
    Specify target interface speed [kHz]. : 4000 kHz
    Speed>
    Device "STM32F746VG" selected.


    Connecting to target via SWD
    Cannot connect to target.
    J-Link>
  • I apologize, I messed up in my previous post. Please see the following for the correct output from the commander.



    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. : STM32F746VG
    Type '?' for selection dialog
    Device>?
    Please specify target interface:
    J) JTAG (Default)
    S) SWD
    TIF>S
    Specify target interface speed [kHz]. : 4000 kHz
    Speed>
    Device "STM32F746VG" selected.


    Connecting to target via SWD
    Cannot connect to target.
    J-Link>connect
    Device "STM32F746VG" selected.


    Connecting to target via SWD
    STM32 (connect): Can not attach to CPU. Trying connect under reset.
    STM32 (connect): Can not attach to CPU. Trying connect under reset.

    ****** Error: STM32: Connecting to CPU via connect under reset failed.

    STM32 (connect): Can not attach to CPU. Trying connect under reset.
    STM32 (connect): Can not attach to CPU. Trying connect under reset.

    ****** Error: STM32: Connecting to CPU via connect under reset failed.

    Cannot connect to target.
  • Hello,

    Have you connected the MCU supply voltage to the VTref pin (Pin 1) of the debug interface?
    I ask because J-Link Commander is outputting VTref = 0.000 V
    As our debug probes can work with ~10000 different devices a wide range different signal voltages is needed.
    Generally we support 1.2 V - 5 V. If you do not connect VTref J-Link does not know what voltage to supply and thus will not establish connection to protect your device from damage.
    How to wire the debug interface is explained here: segger.com/products/debug-prob…e-description/#tab-4031-2
    RESET is optional but we recommend to connect it anyways so J-Link has the chance to connect to devices that would be otherwise unrecoverable e.g. due to a "bad" application running that disables the debug interface.

    If you have spacing problems we offer a adapter that supplies Pin 1 with the wanted voltage without needing a connection from the target itself.
    More information can be found here: segger.com/products/debug-prob…/adapters/supply-adapter/

    So could you try connecting Pin 1 with the target supply voltage and see if this resolves your issue?

    Best regards,
    Nino
    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.
  • The VDD wasn't connected properly..that was odd. I made sure all of the pins are connected now. I'm unfortunately still getting the same error. Here is a log from a clean power-on.


    SEGGER J-Link Commander V6.22b (Compiled Dec 6 2017 17:02:44)
    DLL version V6.22b, compiled Dec 6 2017 17:02:06

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link Ultra V4 compiled Nov 28 2017 11:47:50
    Hardware version: V4.00
    S/N: 504403398
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    VTref = 3.312V


    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. : STM32F746ZG
    Type '?' for selection dialog
    Device>
    Please specify target interface:
    J) JTAG (Default)
    S) SWD
    TIF>s
    Specify target interface speed [kHz]. : 4000 kHz
    Speed>
    Device "STM32F746ZG" selected.


    Connecting to target via SWD
    STM32 (connect): Can not attach to CPU. Trying connect under reset.
    STM32 (connect): Can not attach to CPU. Trying connect under reset.

    ****** Error: STM32: Connecting to CPU via connect under reset failed.

    STM32 (connect): Can not attach to CPU. Trying connect under reset.
    STM32 (connect): Can not attach to CPU. Trying connect under reset.

    ****** Error: STM32: Connecting to CPU via connect under reset failed.

    Cannot connect to target.
    J-Link>
  • I don't know that it's going to help, but here's what I get when I connect with ST-Link


    08:42:23 : ST-LINK SN : 56FF73066772565655330467
    08:42:23 : ST-LINK Firmware version : V2J27S6
    08:42:23 : Connected via SWD.
    08:42:23 : SWD Frequency = 4,0 MHz.
    08:42:23 : Connection mode : Connect Under Reset.
    08:42:23 : Debug in Low Power mode enabled.
    08:42:23 : Device ID:0x449
    08:42:23 : Device flash Size : 1MBytes
    08:42:23 : Device family : STM32F74x/F75x
  • Hello,

    I just tried to reproduce the issue with the NUCLEO-F746ZG eval board but everything working as expected.
    Could you check if your custom hardware has the debug interface wired like the NUCLEO-F746ZG?
    Is the J-Link generally working with other target devices/eval boards?

    Best regards,
    Nino
    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,

    Great to hear that you are up and running again.
    Pins 3/5 are nTRST/TDI on the JTAG interface. By default nTRST is usually pulled high. If you pull it to ground J-Link will assume that the target is held in reset and can't connect.

    This thread will now be considered as solved.

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