Menu

#465 CMSIS-DAP SWD: "SWD ack not OK @ 0 JUNK" and "Error connecting DP: cannot read IDR"

0.12.0
new
nobody
None
6 days ago
2026-02-12
No

Hi,

I’m trying to program/debug an STM32F446RE (Nucleo-F446RE target MCU) using a CMSIS-DAPv2 probe (DAP103 Bluepill CMSIS-DAP).
OpenOCD fails to connect over SWD.

Symptoms:

  • Repeated: "SWD ack not OK @ 0 JUNK"
  • Final: "Error connecting DP: cannot read IDR"

What works:

  • Flashing the same firmware via onboard ST-LINK works (program + verify OK).

What fails:

  • Using CMSIS-DAP from OpenOCD/PlatformIO. Earlier I also saw OpenOCD start without interface cfg and error:
    "Can't find openocd.cfg" and "Debug Adapter has to be specified" until I forced the command line.

OpenOCD version:

  • xPack OpenOCD 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30)

Command used (direct OpenOCD):
openocd -d4 -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg -c "transport select swd; adapter speed 100; init; reset halt; exit"

Platform/OS:

  • Windows (MSYS2/MINGW64 terminal)

Wiring:

  • CMSIS-DAP GND -> target GND
  • SWDIO -> SWDIO
  • SWCLK -> SWCLK
  • NRST -> NRST (optional / please advise)
  • VTref/VTarget -> 3.3V (if required by CMSIS-DAP)

Notes/questions:
1) Could ST-LINK be contending on SWD lines on Nucleo-F446RE when using an external probe? If yes, what’s the recommended way to disconnect ST-LINK from the target?
2) Any recommended OpenOCD settings for CMSIS-DAP (connect_under_reset/reset_config, lower speed, etc.)?

Full log (debug_level 4) attached below:

1 Attachments

Discussion

  • Antonio Borneo

    Antonio Borneo - 2026-02-13

    On the Nucleo board there are two jumpers, just above the crystal of the on-board ST-Link.
    You need to remove them to isolate the SWD port of the ST-Link from the F446.
    With the jumpers in place, the on-board ST-Link will prevent using the external CMSIS-DAP.

    Please reply if this fixes the issue, so we can close the ticket

     
  • Shreyas Acharya

    Shreyas Acharya - 2026-02-14

    I have done still same issue :

     
  • Antonio Borneo

    Antonio Borneo - 6 days ago

    I cannot see the connections in the pictures nor the pinout of the DAPLINK, but the removed jumpers are ok.
    You need to connect the GND between the boards, for sure, and VDD 3.3V as you said required by your DAPLINK.
    The SWDIO goes to PA13, that is on pin 13 of CN7
    The SWCLK goes to PA14, that is on pin 15 of CN7

    Probably you have simply swapped SWDIO and SWCLK.

    Or, the firmware in the STM32F446 is blocking the SWD interface.
    Without a NRST driven by the DAPLINK, you can try to keep pressed the black reset button of the Nucleo board, while starting OpenOCD. This would prevent the FW to start and to reprogram the SWD pins.

     

Log in to post a comment.

MongoDB Logo MongoDB