rgrr / yapicoprobe

Yet Another Picoprobe
123 stars 12 forks source link

Unable to Connect to STM32 Target #62

Closed tornupnegatives closed 1 year ago

tornupnegatives commented 1 year ago

It appears that versions rg-1.12 and upward are unable to successfully establish a connection from OpenOCD to an STM32 target. I am attempting to use a Raspberry Pi Pico H to debug a Nucleo board with an STM32H723 microcontroller, with the latest version of yapicoprobe. The latest version that works is rg-1.11. This issue is a break-off of the discussions regarding #60 and #61.

Steps to Reproduce

  1. Check out and build version rg-1.12 or later of yapicoprobe

    $ git clone https://github.com/rgrr/yapicoprobe.git -b <rg1.12/rg-1.13/v1.14/v1.15>
    $ cd yapicoprobe
    $ git submodule update --init --recursive
    $ export PICO_SDK_PATH=<path/to/pico-sdk>
    $ make cmake-create-release
    $ make all -j
  2. Check out and build the latest version of OpenOCD, via Raspberry Pi

    $ git clone https://github.com/raspberrypi/openocd.git -b rp2040
    $ cd openocd
    $ ./bootstrap
    $ ./configure
    $ make -j
  3. Flash yapicoprobe onto the Pico, and attach the STM32 target to the Pico via SWD

  4. Launch OpenOCD, and wait for it to fail...

    
    $ sudo src/openocd -f interface/cmsis-dap.cfg -c "adapter speed 5000" -f target/stm32h7x.cfg -s tcl

Open On-Chip Debugger 0.12.0-g97d1e6e55 (2023-07-20-12:02) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html adapter speed: 5000 kHz

Info : auto-selecting first available session transport "swd". To override use 'transport select '. Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E6616407E34A622D Info : CMSIS-DAP: SWD supported Info : CMSIS-DAP: Atomic commands supported Info : CMSIS-DAP: Test domain timer supported Info : CMSIS-DAP: FW Version = 2.0.0 Info : CMSIS-DAP: Serial# = E6616407E34A622D Info : CMSIS-DAP: Interface Initialised (SWD) Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0 Info : CMSIS-DAP: Interface ready Info : clock speed 1800 kHz Error: Error connecting DP: cannot read IDR



## Extra Credit
If you connect a logic analyzer to the SWD pins, you should see that yapicoprobe is talking to the target, and OpenOCD is successfully driving the Pico. However, it fails to successfully communicate with the target.
rgrr commented 1 year ago

many thanks for your pull request. Can we close this issue now?