EmbDev.net

Forum: ARM programming with GCC/GNU tools OpenOCD parallel port


Author: Thomas Fernando (thomas_f)
Posted on:

Rate this post
0 useful
not useful
Hi ,

I am trying to get OpenOCD to work with LPC2138 with a parallel port 
wiggler.

H-JTAG(also works with giveio.sys) works perfectly with my setup , I 
need to set it with
nTRST --> output inverted
nSRST-->"no sysrst"
TCK Speed MAX/1.

I replicated this by using
parport_cable wiggler_ntrst_inverted
jtag_speed 8 in the openOCD_lpc2138_wiggler.cfg.

When I try compiling and flashing I get :
Programming with OPENOCD
openocd_go_flash.cmd
Info:    openocd.c:93 main(): Open On-Chip Debugger (2007-09-05 09:00 
CEST)
Error:   lpc2000.c:384 lpc2000_flash_bank_command(): unknown LPC2000 
variant
Error:   flash.c:180 handle_flash_bank_command(): 'lpc2000' driver 
rejected flash bank at 0x00000000
Error:   jtag.c:1301 jtag_examine_chain(): number of discovered devices 
in JTAG chain (2) doesn't match configuration (1)
Error:   jtag.c:1302 jtag_examine_chain(): check the config file and 
ensure proper JTAG communication (connections, speed, ...)
Error:   jtag.c:1440 jtag_init(): trying to validate configured JTAG 
chain anyway...
Warning: arm7_9_common.c:734 arm7_9_assert_reset(): srst resets test 
logic, too
Error:   arm_jtag.c:38 arm_jtag_set_instr_error_handler(): setting the 
new JTAG instruction failed, debugging is likely to be broken

Any newbie errors I am making ?

Regards
Thomas

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
As far as I know H-JTAG installs it's own direct port-access driver but 
I have not used H-JTAG since several months

It seems that the configuration is outdated. "reject flash bank" does 
not look good. Could you try with a configuration files from the openocd 
target library: interface/parport.cfg and target/lpc2148.cfg? Also try 
to increase the debug-level.

Author: Thomas Fernando (thomas_f)
Posted on:

Rate this post
0 useful
not useful
Hello Martin,

I am using your example from here :
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm...
Let me try the configuration file from the source you mentioned.

Thomas

Author: Thomas Fernando (thomas_f)
Posted on:
Attached files:

Rate this post
0 useful
not useful
I managed to get get OpenOCD to flash the program for me,with a few 
issues.

1) JTAG cannot detect the board unless I manually reset the board once 
after power up.After this it works fine,till I power off the board.Then 
I need to do the "manual reset once",once again.

2) After loading the firmware in ROM ,the board executes the program 
,but I get the following message :

Programming with OPENOCD
openocd_go_flash.bat
Open On-Chip Debugger (2008-03-22 12:00 CET) svn: r520
URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/
Info:    jtag.c:1329 jtag_examine_chain(): JTAG device found: 0x4f1f0f0f 
(Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)
Info:    target.c:240 target_init_handler(): executing reset script 
'openocd_lpc2148_flash.script'
Info:    options.c:50 configuration_output_handler(): dcc downloads are 
disabled
User:    target.c:784 target_arch_state(): target state: halted
User:    armv4_5.c:340 armv4_5_arch_state(): target halted in ARM state 
due to debug request, current mode: System
cpsr: 0x8000005f pc: 0x0000103c
Info:    options.c:50 configuration_output_handler(): flash 'lpc2000' 
found at 0x00000000
Info:    options.c:50 configuration_output_handler(): erased sectors 0 
through 26 on flash bank 0 in 0.156250s
Info:    options.c:50 configuration_output_handler(): wrote 36488 byte 
from file main.bin in 3.640625s (9.787554 kb/s)
Warning: arm7_9_common.c:724 arm7_9_poll(): DBGACK set, but the target 
did not end up in the halted stated 1
User:    target.c:365 target_process_reset(): Timed out waiting for 
reset
Press any key to continue . . .

I then exit this using "Stop Tools".Meanwhile the program is already 
executing on the board
I have attached the OpenOCD files from my setup.

Author: Thomas Fernando (thomas_f)
Posted on:

Rate this post
0 useful
not useful
Hi ,

Just managed to get OpenOCD working for debugging partially.
i.e. I am able to single step through the code. Now my problem is when I 
read the value of a variable ( by parking the mouse over it) , I get :
for example

741-data-evaluate-expression ptr
741^error,msg="Cannot access memory at address 0x40005660"

Any suggestions on what I might be doing wrong ?

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Did you try with the gdb command set mem inaccessible-by-default off ?
See 
http://openocd.berlios.de/doc/html/GDB-and-OpenOCD... 
for further information.

Author: Thomas Fernando (thomas_f)
Posted on:

Rate this post
0 useful
not useful
I tried this :

target remote localhost:3333
set mem inaccessible-by-default off
monitor soft_reset_halt
monitor sleep 500
monitor arm7_9 force_hw_bkpts enable
symbol-file lpcspi.elf
load
thbreak main
continue

It now seems to work as expected.Will do more trials and revert back.
Thanks for sharing your knowledge and the results of your efforts.

Thomas

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.