[ABANDONED] J-Link Not connecting to Target Board

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

  • [ABANDONED] J-Link Not connecting to Target Board

    I tried connecting the J-link EDU mini to my target board via SWD and it can seem to connect. The target board is a custom PCB which features the STM32F401RDT6 microcontroller. I connect the SWDIO and SWDCLK pins together, also the ground and VRef pin. This is what I get as the output :

    Output

    SEGGER J-Link Commander V7.94c (Compiled Jan 3 2024 15:17:49)
    DLL version V7.94c, compiled Jan 3 2024 15:17:37

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link EDU Mini V1 compiled Dec 13 2023 14:36:33
    Hardware version: V1.00
    J-Link uptime (since boot): 0d 00h 05m 24s
    S/N: 801043014
    License(s): FlashBP, GDB
    USB speed mode: Full speed (12 MBit/s)
    VTref=3.265V


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


    Connecting to target via SWD
    InitTarget() start
    SWD selected. Executing JTAG -> SWD switching sequence.
    Error: Failed to initialized DAP.
    Can not attach to CPU. Trying connect under reset.
    SWD selected. Executing JTAG -> SWD switching sequence.
    Error: Failed to initialized DAP.
    Connecting to CPU via connect under reset failed.
    InitTarget() end - Took 309ms
    Connect failed. Resetting via Reset pin and trying again.
    InitTarget() start
    SWD selected. Executing JTAG -> SWD switching sequence.
    Error: Failed to initialized DAP.
    Can not attach to CPU. Trying connect under reset.
    SWD selected. Executing JTAG -> SWD switching sequence.
    Error: Failed to initialized DAP.
    Connecting to CPU via connect under reset failed.
    InitTarget() end - Took 209ms
    Cannot connect to target.


    Any help would be greatly appreciated.
  • Hi,
    A good way to approach such an issue is usually the following troubleshooting guide:
    wiki.segger.com/J-Link_cannot_…the_CPU#Target_connection

    Additional hints:
    1) The STM32F4 devices allow to set permanent protection (RDP level 2),
    which will effectively disable the debug features of the chip.
    So if RDP level 2 is set, you will never be able to connect to the chip.
    2) In some cases, applications do override the debug pins.
    In such a case you would also have to connect the nRESET pin between J-Link & Device.
    Otherwise the connect under reset can not work, which is basically the only way to connect to the device in such a case.

    BR
    Fabian
    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.
  • Hello,

    I tried your second suggestion and it didn't work. I used a multimeter to check the voltage of the SWDIO and SWDCLK signals, I get 0.16V and 0.5V respectively. Does this tell you something?

    The post was edited 2 times, last by John1234 ().