When OpenOCD tries to initialize JTAG, it tries to detect the test access port (TAP) ID of each device in the JTAG chain. The tap ID is set by the manufacturer. OpenOCD's config files contain expected tap values for each board. You may encounter this error either because OpenOCD has failed to read the tap ID correctly, or because the expected value in a config file is incorrect or outdated.

Look at the "tap/device found" and "UNEXPECTED" values in OpenOCD's output. If you see a value of 0x00000000 or 0x000000ff, OpenOCD has failed to read the tap ID. If you see any other value, some other error has occurred, and the error is most likely an incorrect value in a config file.

In this example, OpenOCD has found an ID of 0x000000ff, an invalid tap ID. For this output you would refer to the Failed to Read Tap ID section below. For the example at the top of the page, OpenOCD has detected an ID of 0x0032409d, and you would start with the Incorrect Value in Config File section.

Failed to Read Tap ID

If you see a tap ID found with a value of 0x00000000 or 0x000000ff, OpenOCD has failed to read the tap ID.

Step 1: Check JTAG Connection

In particular, make sure the JTAG ribbon cable is secured, and is not connected backwards. A loose or misaligned connection will cause the tap ID to read incorrectly. WARNING: a misaligned connection may damage the pins on the JTAG header! If you are unsure whether the cable is connected backwards, consult the manual before testing.

Step 2: Check for Updated Config Files

The config files distributed with your version of OpenOCD may not reflect recent revisions made by the manufacturer. TinCanTools maintains a page with updated config files for use with guides on this wiki. Check for config files on the OpenOCD Config Files page.

Note for Beagleboard/Beagleboard XM Users

The Beagleboard and Beagleboard XM have an issue that may prevent the JTAG chain from initializing correctly. You may be able to correct this issue by running the init and reset init commands on OpenOCD startup.

Incorrect Value in Config File

If OpenOCD finds an unexpected tap ID other than 0 (0x00000000) or 0x000000ff the issue is most likely an incorrect expected value in a config file. The example at the beginning of this article occurs when running OpenOCD with the Hammer and the hammer.cfg file provided with OpenOCD 0.4.0:

OpenOCD has found a valid tap ID - 0x0032409d - but it doesn't match the expected value - 0xffffffff. For OpenOCD to initialize JTAG correctly you will need to change the expected ID in the config file to match the actual ID.

Step 1: Check for Updated Config Files

The config files distributed with your version of OpenOCD may not reflect recent revisions made by the manufacturer. TinCanTools maintains a page with updated config files for use with guides on this wiki. Check for config files on the OpenOCD Config Files page.

If the no new config file is available or the new file fails to correct the issue, proceed to Step 2.

Step 2: Note the Unexpected Value

The first two lines above list the tap ID detected by OpenOCD. Take note of the 32-bit hexadecimal value (the one with 0x followed by 8 digits) in the first two lines, and the expected value in the third line.

The found tap ID is 0x0032409d and the expected tap ID is 0xffffffff. You will need these values in step 3.

Step 3: Find the Config File for your Board

Find the config file for your board. This file usually has the same name as your board and is located in a folder called board/. For example, if you were using OpenOCD with the Flyswatter and the Hammer, and you started OpenOCD like this:

The config file for your board is hammer.cfg, and you can find it in /home/myusername/openocd/tcl/board. If you aren't setting OpenOCD's search directory with the -s flag you may have to look in multiple places to find the board config file OpenOCD actually uses. See OpenOCD Config File Paths.

Setting CPUTAPID for the Hammer in WordPad

Step 4: Edit the Config File

Open the config file in a text editor. Find a line that calls the config file for your processor. It should look like this:

source [find target/name_of_the_target.cfg]

For the Hammer, the target file is samsung_s3c2410.cfg, so this line reads:

source [find target/samsung_s3c2410.cfg]

Immediately above this line, add a new line that reads:

set CPUTAPID 0x[TapID]

...where 0x[TapID is value found in Step 1. (Don't actually type "0xTapID." Type the hexadecimal value you found above.) For the Hammer, the file should now read like this: