November 22, 2024, 03:14:27 PM

ARM-USB-OCD-H / ARM-JTAG-SWD OpenOCD Issues

Started by joe, May 05, 2022, 08:21:24 PM

Previous topic - Next topic

joe

We're working on programming an STM32 via the ARM-USB-OCD-H + ARM-JTAG-SWD using OpenOCD.

We're having trouble under a variety of scenarios, and I wanted to see if my understanding of the pinouts are correct.

My OpenOCD .cfg:

source [find interface/ftdi/olimex-arm-usb-ocd-h.cfg]
source [find interface/ftdi/olimex-arm-jtag-swd.cfg]
source [find target/stm32l4x.cfg]
# use hardware reset
reset_config srst_only srst_nogate


To reduce confusion, I've reduced it to only the pins I think are *required* for SWD debugging/programming.

Pin Out          [Olimex]            (Adapter)               STM32# 3  - [TTRST_N]    (TRST)                 nRST# 5  - [TTDI]          (TDI)# 7  - [TTMS]         (TMS_SWDIO)      SWIO # 9  - [TTCK]         (TCK)                   SWCLK# 11 - [TRTCK]      (RTCK)         # 13 - [TTDO]        (TDO_SWO)       # 15 - [TSRST_N]   (SRT)
# 20 -[GND]     (GND)          GND


I've connected nRST, SWIO, SWCLK, and GND, and the devide to be programmed is self powered.
Am I missing something in terms of the pinouts, or is my translation of pin functions incorrect?

Thank you,
Joe

LubOlimex

You need to connect VCC, it is used to "sense" the voltage of the target.
Technical support and documentation manager at Olimex

joe

#2
Thank you - I've tried that as well (using pin 2), but no luck.
I also tried switching the resets around and tried reset_config trst_only since I'm only connecting to what I believe is trst -> nRST

I continue to receive the following message:
Info : FTDI SWD mode enabled
Info : DEPRECATED target event trace-config; use TPIU events {pre,post}-{enable,disable}
srst_only separate srst_nogate srst_open_drain connect_deassert_srst

Info : clock speed 500 kHz
Error: Error connecting DP: cannot read IDR
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

LubOlimex

TRST/nRST is an optional signal, you can skip connecting it.

On the contrary SRST/SRT is mandatory and should be connected (pin #15 of big connector that is routed to pin #10 of small connector).
Technical support and documentation manager at Olimex