EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

JTAG scan chain newbie - five LPC2000s, two Lattice CPLDs

Started by Darcy April 10, 2008
Hi all... heck, the two of us have been struggling with this all day.
I hope someone with a bit more knowledge can please lend us a hand...

We're using an Olimex ARM-USB-OCD

Arrangement
TDI =>
LPC2136 =>
LPC2103 =>
LPC2103 =>
LPC2103 =>
LPC2136 =>
ISP4032 (Lattice CPLD) =>
ISP4064 (ditto) =>
=> TDO

We've been using Rowley Crossworks to try and address one of the ARM
devices but without any success.

So, I swapped over to using OpenOCD which I'd got working earlier with
just a single device.

This is the subset from the OpenOCD .cfg
jtag_device 8 0x1 0x00 0xe
jtag_device 8 0x1 0x00 0xe
jtag_device 4 0x1 0xf 0xe
jtag_device 4 0x1 0xf 0xe
jtag_device 4 0x1 0xf 0xe
jtag_device 4 0x1 0xf 0xe
jtag_device 4 0x1 0xf 0xe

And the result:
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0x11804043
(Manufacturer: 0x021, Part: 0x1804, Version: 0x1)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0x1180c043
(Manufacturer: 0x021, Part: 0x180c, Version: 0x1)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff
(Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Error: jtag.c:1314 jtag_examine_chain(): number of discovered devices
in JTAG chain (20) doesn't match configuration (7)
Error: jtag.c:1315 jtag_examine_chain(): check the config file and
ensure proper JTAG communication (connections, speed, ...)
Error: jtag.c:1460 jtag_init(): trying to validate configured JTAG
chain anyway...
Error: jtag.c:1359 jtag_validate_chain(): Error validating JTAG scan
chain, IR mismatch, scan returned 0x3fffff1919
Error: jtag.c:1359 jtag_validate_chain(): Error validating JTAG scan
chain, IR mismatch, scan returned 0x3fffff1919
Error: jtag.c:1359 jtag_validate_chain(): Error validating JTAG scan
chain, IR mismatch, scan returned 0x3fffff1919
Error: jtag.c:1359 jtag_validate_chain(): Error validating JTAG scan
chain, IR mismatch, scan returned 0x3fffff1919
Error: jtag.c:1359 jtag_validate_chain(): Error validating JTAG scan
chain, IR mismatch, scan returned 0x3fffff1919
Error: jtag.c:1359 jtag_validate_chain(): Error validating JTAG scan
chain, IR mismatch, scan returned 0x3fffff1919
Error: jtag.c:1468 jtag_init(): Could not validate JTAG chain, exit
To note, the first two devices being read out (the two CPLDs furthest
from TDI) appear to be reading their IDs corectly, 0x11804043 and
0x1180c043 (we've verified those IDs are correct from the Lattice
programming tool so we know that some data is being read correctly).

It all just goes to hell in a hand-bag from there.

In Rowley Crossworks we've set the "JTAG Data Bits Before" to 36, and
"JTAG Instruction Bits Before" to 6. This is in an attempt to address
the first LPC2136 in the chain. We've all tried changing these to Bits
After in the chance we got that the wrong way around.

The CPLDs are 8 bits, the ARM7's are 4 bits.

Is there some fatal flaw in methodology here? I've never used anything
in a JTAG scan chain before so this is all very new to me.

Thanks All
Darcy

An Engineer's Guide to the LPC2100 Series

Darcy,

> Hi all... heck, the two of us have been struggling with this all day.
> I hope someone with a bit more knowledge can please lend us a hand...
>
> We're using an Olimex ARM-USB-OCD
>
> Arrangement
> TDI =>
> LPC2136 =>
> LPC2103 =>
> LPC2103 =>
> LPC2103 =>
> LPC2136 =>
> ISP4032 (Lattice CPLD) =>
> ISP4064 (ditto) =>
> => TDO
>
> We've been using Rowley Crossworks to try and address one of the ARM
> devices but without any success.
>
> So, I swapped over to using OpenOCD which I'd got working earlier with
> just a single device.
>
> This is the subset from the OpenOCD .cfg
> jtag_device 8 0x1 0x00 0xe
> jtag_device 8 0x1 0x00 0xe
> jtag_device 4 0x1 0xf 0xe
> jtag_device 4 0x1 0xf 0xe
> jtag_device 4 0x1 0xf 0xe
> jtag_device 4 0x1 0xf 0xe
> jtag_device 4 0x1 0xf 0xe
>
> And the result:
> Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0x11804043
> (Manufacturer: 0x021, Part: 0x1804, Version: 0x1)
> Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0x1180c043
> (Manufacturer: 0x021, Part: 0x180c, Version: 0x1)
> Info: jtag.c:1304 jtag_examine_chain(): JTAG device found: 0xffffffff

[ snip ]

> To note, the first two devices being read out (the two CPLDs furthest
> from TDI) appear to be reading their IDs corectly, 0x11804043 and
> 0x1180c043 (we've verified those IDs are correct from the Lattice
> programming tool so we know that some data is being read correctly).

Ok.

> It all just goes to hell in a hand-bag from there.

CrossWorks is not your problem. Your JTAG chain is your problem. Are the
ARMs being held in reset, are you clocking too quickly? We had a
specially-designed board made up for us that allows us to plug up to six
devices with a multitude of standard JTAG headers. On this board I've had
four ARMs, a Blackfin, and a CPLD all identified and working at the same
time. *However* we do have buffers in the JTAG chain--have you put buffers
in your chain?

See, for instance:

http://toolbox.xilinx.com/docsan/xilinx4/data/docs/pac/designing6.html

> In Rowley Crossworks we've set the "JTAG Data Bits Before" to 36, and
> "JTAG Instruction Bits Before" to 6. This is in an attempt to address
> the first LPC2136 in the chain. We've all tried changing these to Bits
> After in the chance we got that the wrong way around.
>
> The CPLDs are 8 bits, the ARM7's are 4 bits.
>
> Is there some fatal flaw in methodology here? I've never used anything
> in a JTAG scan chain before so this is all very new to me.

I suspect your hardware isn't working as you've not got any IDs from the
ARMs, *or* the ARMs are held in reset with the TAP non-functional.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors


The 2024 Embedded Online Conference