SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By alexandre
#18095
Hi!

I have a problem. I am trying use the Openocd with LPC2138 (ARM7TDMI-S) and Wiggler cable in Debian GNU/Linux 2.6.16 but don't run. When I run the comand openocd -f configfile.cfg -d this error happen: Error: jtag.c:1123 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 3f.

That's all right with my cable Wiggler. I already used it with OpenWince Jtag and Spartan3 Kit. My Wiggler cable is that: http://wiki.openwrt.org/OpenWrtDocs/Cus ... JTAG_Cable .

My ARM's board haven't any pull-up neither pull-down resistor. This is necessary? I used Openocd with MCB2130 (Keil board with LPC2138) and Wiggler cable and happened the same error even so this board has pull-up resistors in TRST, TDI, TMS and TDO signals and pull-down in TCK and RTCK signals. The RTCK signal there isn't in my Wiggler cable. As the standard jtag 1149.1 the TDI, TDO, TCK and TMS signals are essential to comunication, but TRST and RTCK aren't.

The configuration in my config-file is the same used in: http://www.siwawi.arubi.uni-kl.de/avr_p ... index.html

I need only to program the flash memory...
By Dominic
#18099
Hey,

the openwrt Wiki page has two different JTAG interfaces - which one do you use? If you're using the "Unbuffered Cable, Xilinx DLC5 Cable III", you should use "parport_layout dlc5" and "reset_config none".

If instead you're using the "Buffered Cable, Wiggler", you should use "parport_layout wiggler" and "reset_config trst_and_srst srst_pulls_trst".

If the OpenOCD still doesn't work, you might have to add your own layout definiton to parport.c. You have to define the bitfields used for TMS, TCK, TDI and TDO, as well as the bitfields and polarity of nTRST and nSRST (if implemented).

Pull-up/down's shouldn't be necessary.

Regards,

Dominic
By alexandre
#18210
Hi Dominic,

In your parport.c file, the mask for TDO is 0x80 (LPT D7 pin). My Wiggler cable (buffered) uses TDO in Busy pin. It will be that the problem is this? Or I understood wrong?

Thank you, Alexandre.
By Dominic
#18220
The OpenOCD expects the parallel port to be in uni-directional mode, that is it only writes signal using the data pins, and reads signals using the status pins. TDO is usually connected to the 'busy' pin, which affects the msb of the status port (0x80).

Regards,

Dominic
By alexandre
#18236
Ok Dominic! Therefore, apparently that's all right with my parellel port and wiggler cable. I will go to reread the manual one more time so that discovery something wrong in my config.cfg file. Perhaps I am "eating fly". We say thus here in Brazil! If I won't have positive result, I am going to post my config.cfg file here to you see.

I hope not to be disturbing you. I really need to do this to run. My project is stopped more than one week...

Thank you one more time, Alexandre.
By asgard
#18370
How can i change the state of TAP? I'm working with str9.

tnx

Lucio
By Dominic
#18371
I don't think I understand what you want to do. The state of the TAP statemachine is continously changed, while the OpenOCD talks to the target.

Maybe you could explain what you're trying to achieve.

Regards,

Dominic
By asgard
#18372
sorry for the explanation dominic, my problem is :
the scan of IR register performed by amontec demo is 29 instead 01 so openocd returns the error.
A previous post told that maybe the error is caused by a wrong state of TAP.
therefore i ask if is it possible to change that state.

tnx[/quote]
By alexandre
#18377
Hi, my config file is this:

# config LPC2138 ARM7TDMI-S

# daemon configuration
telnet_port 4444
gdb_port 3333

# interface
interface parport
parport_cable wiggler
#parport_layout wiggler
parport_port /dev/parport0
jtag_speed 0

# reset_config <signals> [combination] [trst_type] [srst_type]
reset_config trst_and_srst srst_pulls_trst

# jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>
jtag_device 4 0x1 0xf 0xe

# target configuration
daemon_startup reset

# working_area <target#> <address> <size> <'backup'|'nobackup'>
# working_area 0 0x40000000 0x4000 nobackup

# target <type> <endianess> <reset mode> <jtag#> [variant]
target arm7tdmi little reset_run 0 arm7tdmi-s_r4

# flash bank lpc2000 <base> <size> 0 0 <variant> <target#> <clock> ['calc_checksum']
flash bank lpc2000 0x0 0x7D000 0 0 lpc2000_v2 0 12000 calc_checksum

When I uncoment the line "working_area 0 0x40000000 0x4000 nobackup" this error happens:

secchin:/home/alexandre/work# openocd -f arm7tdmi-s.cfg -d
Info: openocd.c:82 main(): Open On-Chip Debugger (2006-08-20 17:00 CEST)
Error: target.c:972 handle_working_area_command(): target number '0' not defined
secchin:/home/alexandre/work#

When I coment this line: "# working_area 0 0x40000000 0x4000 nobackup" this error happens:

secchin:/home/alexandre/work# openocd -f arm7tdmi-s.cfg -d
Info: openocd.c:82 main(): Open On-Chip Debugger (2006-08-20 17:00 CEST)
Debug: jtag.c:1184 jtag_init():
Warning: parport.c:367 parport_init(): No parport port specified, using default '0x378' (LPT1)
Debug: parport.c:373 parport_init(): requesting privileges for parallel port 0x378...
Debug: parport.c:383 parport_init(): ...privileges granted
Debug: parport.c:210 parport_reset(): trst: 0, srst: 0
Debug: jtag.c:240 jtag_call_event_callbacks(): jtag event: 1
Debug: jtag.c:1070 jtag_reset_callback():
Debug: bitbang.c:223 bitbang_execute_queue(): statemove end in 0
Debug: jtag.c:240 jtag_call_event_callbacks(): jtag event: 1
Debug: jtag.c:1070 jtag_reset_callback():
Debug: bitbang.c:237 bitbang_execute_queue(): scan end in 0
Debug: jtag.c:957 jtag_build_buffer(): fields[0].out_value: 3f
Debug: jtag.c:988 jtag_read_buffer(): fields[0].in_value: 3f
Error: jtag.c:1123 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 3f
secchin:/home/alexandre/work#

Other thing: The openocd enters in prompt mode for execute the instructions or I am obliged use a script in config file or in another file? I don't know if openocd enters in prompt mode because it never ran with me!

Remembering that I am using the Wiggler Cable with the ARM7TDMI-S LPC2138.

Thank you.
By alexandre
#18378
Other thing:
I already tried to use 0x378 in parport_port but don't run. I have the same error!

secchin:/home/alexandre/work# openocd -f arm7tdmi-s.cfg -d
Info: openocd.c:82 main(): Open On-Chip Debugger (2006-08-20 17:00 CEST)
Debug: jtag.c:1184 jtag_init():
Debug: parport.c:373 parport_init(): requesting privileges for parallel port 0x378...
Debug: parport.c:383 parport_init(): ...privileges granted
Debug: parport.c:210 parport_reset(): trst: 0, srst: 0
Debug: jtag.c:240 jtag_call_event_callbacks(): jtag event: 1
Debug: jtag.c:1070 jtag_reset_callback():
Debug: bitbang.c:223 bitbang_execute_queue(): statemove end in 0
Debug: jtag.c:240 jtag_call_event_callbacks(): jtag event: 1
Debug: jtag.c:1070 jtag_reset_callback():
Debug: bitbang.c:237 bitbang_execute_queue(): scan end in 0
Debug: jtag.c:957 jtag_build_buffer(): fields[0].out_value: 3f
Debug: jtag.c:988 jtag_read_buffer(): fields[0].in_value: 3f
Error: jtag.c:1123 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 3f

Thank you.