15 Comments

    • ryan

      Richard,

      JTAG is enabled on all the Raspberry Pi boards. The pins are on the GPIOs but need to be set to alternative function. By following the steps in this guide, you will be able to utilize JTAG. Are you having difficulty with any of my instructions that I can assist you with?

      Ryan

      • Alexandre

        Hi,

        I’m trying something pretty similar but in bare metal context, no OS. At boot I enable the necessary GPIO for JTAG (24, 25, 26, 27) but my debug module (RPi HUB module from FTDI) is unable to get any feedback from the PI2. The TDO line keeps always high.
        I wonder if really JTAG is enabled on all PI boards :/
        Doesn’t it depend on the proc mode (my PI2 boots in HYP mode) ? Or any hidden feature in the bootcode.bin program would prevent the JTAG cell to reply ?
        Thanks for any ideas.

        • ryan

          How are you enabling the GPIOs for JTAG? Do you have the proper interface configuration file for the RPi HUB and OpenOCD? JTAG is enabled on all models, all that needs to happen is for the GPIOs to be set to their proper ALT functions. Are you using OpenOCD?

  1. Richard Helgeson

    I want to use an Atmel Dragon programmer to download code and use the Pi as a bare- metal embedded controller.

    I want to bypass any operating system and boot directly to the application.

    Can this be done?

    • ryan

      In theory yes, you’ll probably need to do a soft_reset_halt in OpenOCD and clear all the registers and wipe the memory, then load your application. I’m not too familiar with the Atmel Dragon Programmer but if it uses standard JTAG protocol, it shouldn’t be an issue. There’s an example blink.elf somewhere on GitHub that serves as a bare-metal/GPIO example.

  2. required

    Can we crack the video codecs with this ? I’m running a hash farm for several weeks and I have no match results yet. I thing it’ll be more straightforward, or maybe we can glitch the runtimes into borking the comm.

  3. tatery

    I wonder if it is possible to configure JTAG on raspberry pi3 with raspbian on board and use it to program other devices directly from the same PI (without any additional PC with Linux or Windows).

  4. Greg Herlein

    Thanks for this great guide!

    If you get errors in the bootstrap make sure you have pkg-config installed:

    sudo apt-get install pkg-config

    (author: you may want to just add this to the packages you call out to be installed)

  5. I am trying to enable JTAG. Followed the exact step but still, I am getting this error. Please help me unlock the JTAG
    I am on ubuntu 17 with ft232h adapter.
    Open On-Chip Debugger 0.9.0 (2015-09-02-10:42)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    adapter speed: 1000 kHz
    adapter speed: 1000 kHz
    adapter_nsrst_delay: 400
    none separate
    Info : auto-selecting first available session transport “jtag”. To override use ‘transport select ‘.
    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: rpi2.dap: IR capture error; saw 0x0f not 0x01
    Warn : Bypassing JTAG setup events due to errors
    Warn : Invalid ACK 0x7 in JTAG-DP transaction
    Warn : Invalid ACK 0x7 in JTAG-DP transaction
    Warn : Invalid ACK 0x7 in JTAG-DP transaction
    Warn : Invalid ACK 0x7 in JTAG-DP transaction
    Warn : Invalid ACK 0x7 in JTAG-DP transaction
    Warn : Invalid ACK 0x7 in JTAG-DP transaction
    Warn : Invalid ACK 0x7 in JTAG-DP transaction
    Warn : Invalid ACK 0x7 in JTAG-DP transaction
    Warn : Invalid ACK 0x7 in JTAG-DP transaction
    Warn : Invalid ACK 0x7 in JTAG-DP transaction

    • ryan

      It looks like the GPIO have not been set to the proper alternative function. Please be sure that during the section where you compile ‘JtagEnabler’ you go into the source code and modify the line ‘#define BCM2708_PERI_BASE 0x20000000’ to ‘#define BCM2708_PERI_BASE 0x3F000000’ (without the quotes) then compile following the rest of the directions. 0x3F000000 is for Raspberry Pi 2 and 3, where 0x20000000 is for the original Raspberry Pi. Be sure to run the JtagEnabler binary before attempting to connect to JTAG. Double check your pins are connected correctly.

Leave a Reply to Alexandre Cancel reply

Your email address will not be published. Required fields are marked *