I am reaching out in hopes of finding a solution to a persistent issue I’ve been encountering. I am attempting to program an STM32L412KB microcontroller using SWD (Serial Wire Debug) with an FT2232 module. While I’ve had success with the JTAG interface, transitioning to SWD has been problematic.
The specific issue I am facing is an error message: “Error: Error connecting DP: cannot read IDR”. This occurs when I try to establish a connection using my programming and debugging tools. I have tried various settings and configurations, but to no avail.
I’m wondering if anyone here has had similar experiences or if there are known issues or limitations with this particular hardware and microcontroller combination. Any advice or suggestions on what I might try would be greatly appreciated.
FT2232H.cfg file for SWD
#
# OpenOCD configuration file for the FTDI FT2232HL
#
# Include the configuration for the JTAG adapter.
# If you have a different interface, please edit this to include the
# configuration file of yours.
adapter driver ftdi
ftdi vid_pid 0x0403 0x6010
ftdi channel 0
ftdi layout_init 0x0008 0x000b
transport select swd
adapter speed 20
telnet_port 4444
ftdi layout_init 0x0018 0x05fb
ftdi layout_signal SWD_EN -data 0
ftdi layout_signal nSRST -data 0x0010
Yeah that’s on the microcontroller side. It indeed only has SWDIO that is a combination of TDO and TDI (testdata in / out). But on the FTDI I imagine it manually needs to connect TDO and TDI together by the user. Otherwise, why would it be written in all these configs.
I have this resistor on my board. I have also looked at this page and taken the configuration from there. Unfortunately, the configuration is very outdated. Maybe that’s why it has an error.