Olimex Support Forum

ARM => JTAG => Topic started by: joe on May 05, 2022, 08:21:24 PM

Title: ARM-USB-OCD-H / ARM-JTAG-SWD OpenOCD Issues
Post by: joe on May 05, 2022, 08:21:24 PM
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
Title: Re: ARM-USB-OCD-H / ARM-JTAG-SWD OpenOCD Issues
Post by: LubOlimex on May 06, 2022, 11:51:40 AM
You need to connect VCC, it is used to "sense" the voltage of the target.
Title: Re: ARM-USB-OCD-H / ARM-JTAG-SWD OpenOCD Issues
Post by: joe on May 19, 2022, 05:13:57 PM
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
Title: Re: ARM-USB-OCD-H / ARM-JTAG-SWD OpenOCD Issues
Post by: LubOlimex on May 20, 2022, 09:25:06 AM
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).