November 09, 2024, 04:26:42 AM

ARM-USB-OCD-H and STM32H7A3-Nucleo

Started by GeneM, December 25, 2021, 12:18:56 AM

Previous topic - Next topic

GeneM

Hi - I'm trying to use a new ARM-USB-OCD-D for the first time with a STM32 H7A3 Nucleo board.  I have an ARM-JTAG-20-10 adapter connected between the debugger and the MIPI 10 connector on the Nucleo board.  The documentation for the Nucleo says:

6.3.2 Using an external debug tool to program and debug the onboard
STM32H7
There are 2 basic ways to support an external Debug tool:
1. Keep the embedded STLINK-V3E running.
Power on the STLINK-V3E at first until the COM LED lights RED. Then the user
connects his external debug tool through CN5 MIPI-10 debug connector.
2. Set the embedded STLINK-V3E in a high impedance state:
When the user states the jumper JP1 (STLK_RST) ON, the embedded STLINK-V3E is
in RESET state and all GPIOs are in high impedance, then the user can connect his
external debug tool to the debug connector CN5.


Neither of those options work for me.  I'm using the Visual GDB IDE and the example "blinky" program works through ST-Link but I get a "no device found" error when Visual GDB tries to download with the ARM-USB-OCD-H selected as the debugger.

Any ideas what I need to do to make this work?

Thanks - Gene

 

LubOlimex

From what I found online about your board - it has only SWD connector and interface. ARM-USB-OCD-H has only JTAG so you need to also use the SWD adapter:

https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG-SWD/

Refer to the user's manual of ARM-USB-OCD-H here:

https://www.olimex.com/Products/ARM/JTAG/_resources/ARM-USB-OCD_and_OCD_H_manual.pdf
Technical support and documentation manager at Olimex

GeneM

#2
I'm back on this job and still having some problems.  I have the ARM-USB-OCD-H plugged into a ARM-JTAG-SWD plugged into a ARM-JTAG-20-10 ribbon cable with the other end of the ribbon cable plugged into the 10 pin MIPI-10 debug connector on the Nucleo board.  I downloaded the Olimex OpenOCD JTAG ARM-USB-OCK-H (Interface 0) and (Interface 1) drivers using Zadig per the OCD-H manual. When I plug the debugger into my PC I get 2X "Olimex OpenOCD JTAG ARM-USB-OCD-H" devices that show up under USB devices in my device manager.  I have a simple blinky program that downloads and debugs fine with VisualGDB using OpenOCD and the ST-Link V3 debugger.  But when I change the project setup to OpenOCD and Olimex ARM-USB-OCD-H, I get this error: "Error connecting DP: cannot read IDR".  Any suggestions what I'm doing wrong will be greatly appreciated

Thanks

PS the gdb stub log says:
C:\Users\gene\AppData\Local\VisualGDB\EmbeddedDebugPackages\com.sysprogs.arm.openocd\bin\openocd.exe -c "gdb_port 65369" -c "telnet_port 65367" -f interface/ftdi/olimex-arm-usb-ocd-h.cfg -f transport/olimex-arm-jtag-swd.cfg -c "transport select swd" -c "adapter speed 3000" -f target/stm32h7x_dual_bank.cfg -c init -c "reset init" -c "echo VisualGDB_OpenOCD_Ready"
Open On-Chip Debugger 0.11.0 (2021-06-25) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : FTDI SWD mode enabled
Warn : Transport "swd" was already selected
swd
adapter speed: 3000 kHz

Info : clock speed 1800 kHz
Error: Error connecting DP: cannot read IDR

And another probably minor point.  The 10 way connector on the Nucleo board sits on a 14 pin footprint and the names of the 10 pins that actually connect to the 10 pin ribbon cable are slightly different than the schematic for the ARM-JTAG-SWD.  The Nucleo has the following pin out 1- VDD, 3 and 5 - GND, 7- NC, 9 - GNDDetect (connected to ground through a 100 ohm resistor), 10 - T_NRST, 8 - T_JTDI, 6 - T_SWO, 4 - T_SWCLK, 2 - T_SWDIO


LubOlimex

The layout of signals look good, I checked the datasheet. You should use MIPI-10 connector.

Two things to check:

1. Make sure that the target is powered. ARM-JTAG-20-10 has powering disabled by default

2, Make sure the 10-pin is not connected in reverse.
Technical support and documentation manager at Olimex

GeneM

I'm powering the Nucleo board through it's S-Link USB connector.  The Nucleo manual says this will work with a JTAG debugger.

the 10 pin header on the board has a keying slot that makes sure the 10 pin ribbon cable has to plug in correctly.

Do I need to power the ARM-USB-OCD-H through it's barrel connector?

Thanks for the help

LubOlimex

There is no need to do so. ARM-USB-OCD-H gets powered from its USB connector.

I think it is somehow related to the reset, either the reset line is improperly connected or the reset strategy used in the configuration is improper.
Technical support and documentation manager at Olimex

GeneM

Still working on this.  I'm trying the steps your User's Manual and have gotten to section 3.4.1. The openocd download didn't include a .cfg file for the STM32H7 but the openocd stfork download from VisualGDB did so I'm using that.  Here's what happens when I try to run openocd.exe

C:\Users\gene\Documents\CPF\Software\OpenOCD\openocd-0.9.0-rc1\bin-x64>openocd.exe -f ../scripts/interface/olimex-arm-usb-ocd-h.cfg -f ../scripts/target/stm32h7x.cfg
Open On-Chip Debugger 0.9.0-rc1 (2015-04-24-22:09)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
../scripts/target/stm32h7x.cfg:184: Error: invalid command name "dap"
in procedure 'script'
at file "embedded:startup.tcl", line 60
at file "../scripts/target/stm32h7x.cfg", line 184

Line 184 from the script is: dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu

I'm not sure what the dap command is.  I'd like to attach the .cfg file but haven't found the right button yet.  How do I attach a file?


LubOlimex

Technical support and documentation manager at Olimex