JTAG chain

I have board with LPC2378, Xilinx spartans3e-250 and configuration flash for it.

When I tried to run openocd I see:

Open On-Chip Debugger 1.0 (2008-04-18-18:40) svn:588
$URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $
Info:    options.c:50 configuration_output_handler(): jtag_speed: 0, 0
Info:    options.c:50 configuration_output_handler(): Command jtag not found
Info:    options.c:50 configuration_output_handler(): Open On-Chip Debugger 1.0 (2008-04-18-18:40) svn:588
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0x11c1a093 (Manufacturer: 0x049, Part: 0x1c1a, Version: 0x1)
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0xf5046093 (Manufacturer: 0x049, Part: 0x5046, Version: 0xf)
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)
Error:   jtag.c:1386 jtag_examine_chain(): number of discovered devices in JTAG chain (3) doesn't match configuration (1)
Error:   jtag.c:1387 jtag_examine_chain(): check the config file and ensure proper JTAG communication (connections, speed, ...)
Error:   jtag.c:1545 jtag_init_inner(): trying to validate configured JTAG chain anyway...
Warning: jtag.c:1204 jtag_check_value(): value captured during scan didn't pass the requested check: captured: 0x05 check_value: 0x01 check_mask: 0x0f
Warning: jtag.c:1164 jtag_read_buffer(): in_handler reported a failed check
Warning: jtag.c:1204 jtag_check_value(): value captured during scan didn't pass the requested check: captured: 0x05 check_value: 0x01 check_mask: 0x0f
Warning: jtag.c:1164 jtag_read_buffer(): in_handler reported a failed check
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0x11c1a093 (Manufacturer: 0x049, Part: 0x1c1a, Version: 0x1)
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0xf5046093 (Manufacturer: 0x049, Part: 0x5046, Version: 0xf)
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)
Error:   jtag.c:1386 jtag_examine_chain(): number of discovered devices in JTAG chain (3) doesn't match configuration (1)
Error:   jtag.c:1387 jtag_examine_chain(): check the config file and ensure proper JTAG communication (connections, speed, ...)
Error:   jtag.c:1545 jtag_init_inner(): trying to validate configured JTAG chain anyway...
Warning: jtag.c:1204 jtag_check_value(): value captured during scan didn't pass the requested check: captured: 0x05 check_value: 0x01 check_mask: 0x0f
Warning: jtag.c:1164 jtag_read_buffer(): in_handler reported a failed check
Warning: jtag.c:1204 jtag_check_value(): value captured during scan didn't pass the requested check: captured: 0x05 check_value: 0x01 check_mask: 0x0f
Warning: jtag.c:1164 jtag_read_buffer(): in_handler reported a failed check

Please help me program LPC2378 in JTAG chain.[/code]

What is your .cfg file?

You have to add Xilinx JTAG devices in the jtag chain configuration.

Note : the first device in your .cfg is the device sending the last TDO to the Amontec JTAGkey emulator.

Regards,

Laurent

http://www.amontec.com

my config

#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
interface parport
parport_port 0
parport_cable dlc5
jtag_speed 0
#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config trst_and_srst srst_pulls_trst

#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 4 0x1 0xf 0xe

#target configuration
daemon_startup reset
#target <type> <startup mode>
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4
target_script 0 reset h2294_init.script
run_and_halt_time 0 30
working_area 0 0x40000000 0x40000 nobackup

#flash configuration
flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 14765 calc_checksum
flash bank cfi 0x80000000 0x400000 2 2 0

How to add Xilinx device?

My JTAG chain

LPC2378 ->XCF04SV020C->Spartan3E-250-qt144

Where are Length, IR Capture, IR Capture Mask, IDCODE for this devices?

using the following info:

http://www.xilinx.com/support/documenta … /ug332.pdf

and

viewtopic.php?t=3925&highlight=xsvf+openocd

you get (for the Spartan 3e 250):

#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

jtag_device 4 0x1 0x3 0x1c1a093

because:

ID CODE is in table 12-4 and the IR length is 6 bits according to the ug332.pdf

The JTAG standard only guarantess b…01, i.e. the least significant bits b01, while the meaning of the other bits is up to the vendor. A safe setting that works with all IEEE 1149.1 compliant devices would be jtag_device 0x1 0x3 .

Lastly make sure your chain order is correct! I left the other devices up to you.

I am new to jtag so if you or anyone can expand on this then let me no

Also if this works report back your success.

#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
interface parport
parport_port 0
parport_cable dlc5
jtag_speed 0
#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config trst_and_srst srst_pulls_trst

#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 4 0x1 0xf 0xe
jtag_device 4 0x1 0x3 0xf5046093
jtag_device 4 0x1 0x3 0x1c1a093

#target configuration
daemon_startup attach

#target <type> <startup mode>
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
target arm7tdmi little reset_run 0 arm7tdmi-s_r4
working_area 0 0x40000000 0x40000 nobackup

#flash configuration
#flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v2 4000 calc_checksum
flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v2 12000 calc_checksum
Open On-Chip Debugger 1.0 (2008-04-18-18:40) svn:588
$URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $
Info:    options.c:50 configuration_output_handler(): jtag_speed: 0, 0
Info:    options.c:50 configuration_output_handler(): Open On-Chip Debugger 1.0 (2008-04-18-18:40) svn:588
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0x11c1a093 (Manufacturer: 0x049, Part: 0x1c1a, Version: 0x1)
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0xf5046093 (Manufacturer: 0x049, Part: 0x5046, Version: 0xf)
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1554 jtag_init_inner(): Could not validate JTAG chain, exit
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0x11c1a093 (Manufacturer: 0x049, Part: 0x1c1a, Version: 0x1)
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0xf5046093 (Manufacturer: 0x049, Part: 0x5046, Version: 0xf)
Info:    jtag.c:1376 jtag_examine_chain(): JTAG device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1431 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x0075
Error:   jtag.c:1554 jtag_init_inner(): Could not validate JTAG chain, exit

[/code]

Sorry,

My fault

because:

ID CODE is in table 12-4 and the IR length is 6 bits according to the ug332.pdf

so

jtag_device 4 0x1 0x3 0x1c1a093

should be

jtag_device 6 0x1 0x3 0x1c1a093 

Also you may still need to work on (I think you need to make sure the ARM is 1st on your physical chain):

#target <type> <startup mode>
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
target arm7tdmi little reset_run 0 arm7tdmi-s_r4
working_area 0 0x40000000 0x40000 nobackup

#flash configuration
#flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v2 4000 calc_checksum
flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v2 12000 calc_checksum

After changing config to

#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
interface parport
parport_port 0
parport_cable dlc5
jtag_speed 0
#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config trst_and_srst srst_pulls_trst

#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 6 0x1 0x3 0x1c1a093
jtag_device 8 0x1 0x3 0xf5046093
jtag_device 4 0x1 0xf 0xf1f0

#target configuration
daemon_startup attach

#target <type> <startup mode>
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
target arm7tdmi little reset_run 0 arm7tdmi-s_r4
working_area 0 0x40000000 0x40000 nobackup

#flash configuration
#flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v2 4000 calc_checksum
flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v2 12000 calc_checksum

I get:

starterkit@client-pc4148 ~ $ openocd -d3
Open On-Chip Debugger 1.0 (2008-04-18-18:40) svn:588
$URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $
Debug:   5 1 command.c:383 command_run_line(): script openocd.cfg
Debug:   6 1 configuration.c:87 open_file_from_path(): opened openocd.cfg
Debug:   7 1 command.c:383 command_run_line():
Info:    8 1 options.c:50 configuration_output_handler(): Command  not found
Debug:   9 1 command.c:383 command_run_line(): telnet_port 4444
Debug:   10 2 command.c:383 command_run_line(): gdb_port 3333
Debug:   11 2 command.c:383 command_run_line(): interface parport
Debug:   12 2 command.c:383 command_run_line(): parport_port 0
Debug:   13 2 command.c:383 command_run_line(): parport_cable dlc5
Debug:   14 2 command.c:383 command_run_line(): jtag_speed 0
Debug:   15 2 jtag.c:1843 handle_jtag_speed_command(): handle jtag speed
Info:    16 2 options.c:50 configuration_output_handler(): jtag_speed: 0, 0
Debug:   17 2 command.c:383 command_run_line(): reset_config trst_and_srst srst_pulls_trst
Debug:   18 2 command.c:383 command_run_line(): jtag_device 6 0x1 0x3 0x1c1a093
Debug:   19 2 command.c:383 command_run_line(): jtag_device 8 0x1 0x3 0xf5046093
Debug:   20 3 command.c:383 command_run_line(): jtag_device 4 0x1 0xf 0xf1f0
Debug:   21 3 command.c:383 command_run_line(): daemon_startup attach
Info:    22 3 options.c:50 configuration_output_handler(): Open On-Chip Debugger 1.0 (2008-04-18-18:40) svn:588
Debug:   23 3 command.c:383 command_run_line(): target arm7tdmi little reset_run 0 arm7tdmi-s_r4
Debug:   24 3 command.c:383 command_run_line(): working_area 0 0x40000000 0x40000 nobackup
Debug:   25 3 command.c:383 command_run_line(): flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v2 12000 calc_checksum
Debug:   26 3 command.c:383 command_run_line(): init
Debug:   27 4 openocd.c:102 handle_init_command(): target init complete
Debug:   28 4 parport.c:351 parport_init(): opening /dev/parport0...
Debug:   29 4 parport.c:363 parport_init(): ...open
Debug:   30 57 parport.c:233 parport_reset(): trst: 0, srst: 0
Debug:   31 57 openocd.c:109 handle_init_command(): jtag interface init complete
Debug:   32 57 jtag.c:1526 jtag_init_inner(): Init JTAG chain
Debug:   33 57 jtag.c:319 jtag_call_event_callbacks(): jtag event: JTAG controller reset(tms or TRST)
Debug:   34 57 jtag.c:1282 jtag_reset_callback(): -
Debug:   35 57 jtag.c:1282 jtag_reset_callback(): -
Debug:   36 57 jtag.c:1282 jtag_reset_callback(): -
Debug:   37 58 jtag.c:319 jtag_call_event_callbacks(): jtag event: JTAG controller reset(tms or TRST)
Debug:   38 58 jtag.c:1282 jtag_reset_callback(): -
Debug:   39 58 jtag.c:1282 jtag_reset_callback(): -
Debug:   40 58 jtag.c:1282 jtag_reset_callback(): -
Info:    41 62 jtag.c:1376 jtag_examine_chain(): JTAG device found: 0x11c1a093 (Manufacturer: 0x049, Part: 0x1c1a, Version: 0x1)
Info:    42 62 jtag.c:1376 jtag_examine_chain(): JTAG device found: 0xf5046093 (Manufacturer: 0x049, Part: 0x5046, Version: 0xf)
Info:    43 62 jtag.c:1376 jtag_examine_chain(): JTAG device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)
Debug:   44 62 jtag.c:319 jtag_call_event_callbacks(): jtag event: JTAG controller reset(tms or TRST)
Debug:   45 62 jtag.c:1282 jtag_reset_callback(): -
Debug:   46 62 jtag.c:1282 jtag_reset_callback(): -
Debug:   47 62 jtag.c:1282 jtag_reset_callback(): -
Debug:   48 62 openocd.c:116 handle_init_command(): jtag init complete

Error: 49 63 embeddedice.c:191 embeddedice_build_reg_cache(): unknown EmbeddedICE version (comms ctrl: 0x00000000)

Debug:   50 63 openocd.c:119 handle_init_command(): jtag examine complete
Debug:   51 63 openocd.c:126 handle_init_command(): flash init complete
Debug:   52 63 openocd.c:130 handle_init_command(): NAND init complete
Debug:   53 63 openocd.c:134 handle_init_command(): pld init complete
Debug:   54 63 gdb_server.c:1975 gdb_init(): gdb service for target arm7tdmi at port 3333

I have no idea what that ICE error is.

Does your script now program the ARM?

You should now be able to telnet to the openocd and program the xsvf file to your FPGA or config rom.

Now I can telnet to board, but when I print reset soft_reset I recieve timeout.

I cant program the ARM