Raspberry Pi 3 with OpenOCD

Sysprogs forums Forums VisualGDB Raspberry Pi 3 with OpenOCD

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #21388
    andreaslindner
    Participant

    Hi,

    I wanted to setup my RPi3 for hardware-based debugging using OpenOCD and tried to follow the instructions here: https://sysprogs.com/VisualKernel/tutorials/raspberry/jtagsetup/. When it comes to starting OpenOCD with a board/target config file, I hit the wall.

    It says it would work for RPi1-3 but I’m quite sure that the same OpenOCD config file (you specify ‘target/raspberry.cfg’) wouldn’t work for 2 and 3 as well. Could you please help me to find the file you used? I’m a bit lost in the big pile of OpenOCD’s config script files :).

    By the way. I have installed the latest OpenOCD package which is installed by VisualGDB.

    Best and thanks in advance,
    Andreas

    #21390
    support
    Keymaster

    Hi,

    The tutorial you mentioned describes low-level kernel debugging of the Raspberry Pi itself. If you are using VisualGDB (i.e. debugging user-mode applications), you don’t need JTAG and can simply debug your applications via SSH.

    If you are trying to use Raspberry Pi itself as a JTAG debugger for a barebone ARM device, please consider using one of the Olimex devices instead (e.g. arm-usb-ocd-h). Although OpenOCD can be configured to use Raspberry Pi as a JTAG debugger, it will be relatively slow (due to various latencies) and unreliable.

    #21398
    andreaslindner
    Participant

    Yes, right, hardware-based debugging using OpenOCD. This is exactly what I want to do. Not the other way around and no GDB servers for user-mode debugging.

    The very first sentence in the article I linked says “This tutorial shows how to prepare your Raspberry PI board for debugging with JTAG (we have tested this with Raspberry Pi 1, 2 and 3).”. Now I’m wondering how this could work with the following description with respect to the different ARM cores throughout the RPi versions.

    More specifically, the latest OpenOCD version that is bundled and distributed does not support aarch64. So I assume you didn’t test debugging of this mode anyways but rather the aarch32 with standard Raspbian. Now I’d like to know which OpenOCD config file you used for RPi3. As I said, it cannot have been ‘target/raspberry.cfg’, right?

    Best,
    Andreas

    #21400
    support
    Keymaster

    Hi,

    Thanks for clarifying this. The OpenOCD version bundled with VisualKernel does support aarch64 targets, although we have indeed tested it with a 32-bit Raspbian distro (we used the raspberrypi3.cfg file).

    If you could post the error you are getting with raspberrypi3.cfg, we might be able to help you resolve it, however as we have not explicitly tested the 64-bit mode, it might be failing due to an OpenOCD bug. We should be able to provide more details once we see the error message.

    #23743
    crazyhippititi
    Participant

    Hi,

    I had the same issue when I tried RPi 3 with OpenOCD.

    There are my experiments:

    # RPi 3B V1.2:

    Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux
    Hardware : BCM2835
    Revision : a22082

    #OpenOCD 0.10.0 [2018-11-30] download at: http://gnutoolchains.com/arm-eabi/openocd/

    #ARM-USB-TINY-H adapter

    I changed in the JtagEnable.cpp file as #define BCM2708_PERI_BASE 0x3F000000

    However when I run this command: <Directory Path>\OpenOCD-20181130\share\openocd\scripts>..\..\..\bin\openocd.exe -f interface\ftdi\olimex-arm-usb-tiny-h.cfg -f target\raspberrypi3.cfg

    There were errors as bellow:

    Open On-Chip Debugger 0.10.0 (2018-11-30) [https://github.com/sysprogs/openocd]
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    adapter speed: 1000 kHz
    adapter_nsrst_delay: 400
    none separate
    Info : auto-selecting first available session transport “jtag”. To override use ‘transport select <transport>’.
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections
    Info : clock speed 1000 kHz
    Error: JTAG scan chain interrogation failed: all ones
    Error: Check JTAG interface, timings, target power, etc.
    Error: Trying to use configured scan chain anyway…
    Error: bcm2837.cpu: IR capture error; saw 0x0f not 0x01
    Warn : Bypassing JTAG setup events due to errors
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    Error: Invalid ACK (7) in DAP response
    Error: JTAG-DP STICKY ERROR
    in procedure ‘init’
    in procedure ‘ocd_bouncer’

    I have double checked my wiring between RPi 3 and Olimex.

    Would you please help me in this case? Thank you  so much.

    #23767
    support
    Keymaster

    Hi,

    Please try using VisualKernel as shown in this tutorial. It should configure the necessary debug settings automatically.

    #23803
    crazyhippititi
    Participant

    Thank for your suggestion. I will try it.

    Bests.

    #23889
    crazyhippititi
    Participant

    Hi,

    I tried using VisualKernal as in that tutorial. However, there was error as in attached photo. Would you please give some advice in this case? Thanks in advance.

    Error

    #23893
    support
    Keymaster

    Looks like the Linux machine you are using for building is not compatible with the Raspberry Pi toolchain. Please ensure you use a 64-bit Linux machine for building the Raspberry Pi kernel.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.