Hi,

I'm new to openocd but according some recipe it should work. I try to
debug barebox
bootloader with openocd but aftre loading image to RAM it always fail
with timeout.

Any ideas?

test.cfg :
interface parport
parport_port 0
parport_cable chameleon

source [find board/mini2440.cfg]

telnet_port 4444
gdb_port 3333

reset_config trst_and_srst

debug.cfg:
#
# download an image and break
#

# set parameters
set FIRMWARE_PATH "/home/open-nandra/Downloads/barebox/barebox.bin"
set CODE_ENTRY   "0x30000000"
set CODE_BP   "0x30000034"

# run the configuration steps
init

# configure polling
puts "activating poll"
poll
sleep 1

# halt board
puts "Halting CPU..."
halt
wait_halt

# reset board
puts "CPU halted, soft reset"
soft_reset_halt

# download the binary image
puts "Downloading image"
load_image $FIRMWARE_PATH $CODE_ENTRY bin
sleep 200
puts "Image downloaded"

# set hardware breakpoint at code start
puts "Setting hardware breakpoint at code entry=$CODE_ENTRY"
bp $CODE_BP 4 hw

# resume execution
puts "Resuming execution"
resume $CODE_ENTRY

# wait for breakpoint to be hit
wait_halt
puts "CPU halted, breakpoint hit"

# remove previous breakpoint
puts "Removing breakpoint"
rbp $CODE_BP

puts "= Ready for debug =


then run as root: openocd -f /home/open-nandra/test.cfg -f
/home/open-nandra/debug.cfg

Result is always:
Info : s3c2440.cpu: hardware has 2 breakpoint/watchpoint units

-------------------------------------------
--- login with - telnet localhost 4444  ---
--- then type help_2440                 ---
-------------------------------------------

trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
background polling: on
TAP: s3c2440.cpu (enabled)
target state: running
target state: halted
target halted in ARM state due to debug-request, current mode: Abort
cpsr: 0x800000d7 pc: 0x00000050
MMU: disabled, D-Cache: disabled, I-Cache: enabled
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x800000d3 pc: 0x00000000
MMU: disabled, D-Cache: disabled, I-Cache: disabled
Warn : memory write caused data abort (address: 0x30000000, size: 0x4,
count: 0x7cdb)
Command handler execution failed

With -d 3:
User : 326 464 armv4_5.c:603 arm_arch_state(): target halted in ARM
state due to breakpoint, current mode: Supervisor
cpsr: 0x800000d3 pc: 0x00000000
User : 327 464 arm920t.c:507 arm920t_arch_state(): MMU: disabled,
D-Cache: disabled, I-Cache: disabled
User : 329 464 command.c:824 openocd_jim_vfprintf():
Debug: 330 464 command.c:133 script_debug(): command - ocd_command
ocd_command type ocd_load_image
/home/open-nandra/Downloads/barebox/barebox.bin 0x30000000 bin
Debug: 331 464 command.c:133 script_debug(): command - load_image
ocd_load_image /home/open-nandra/Downloads/barebox/barebox.bin
0x30000000 bin
Debug: 333 471 configuration.c:87 find_file(): found
/home/open-nandra/Downloads/barebox/barebox.bin
Debug: 334 472 target.c:1251 target_write_buffer(): writing buffer of
127852 byte at 0x30000000
Debug: 335 472 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000004
Debug: 336 16579 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000005
Warn : 337 16583 arm7_9_common.c:2573 arm7_9_write_memory(): memory
write caused data abort (address: 0x30000000, size: 0x4, count:
0x7cdb)
Debug: 338 16583 arm9tdmi.c:523 arm9tdmi_write_xpsr_im8(): xpsr_im:
d3, rot: 0, spsr: 0
Debug: 339 16583 command.c:620 run_command(): Command failed with
error code -307
User : 340 16583 command.c:824 openocd_jim_vfprintf(): Command handler
execution failed
User : 343 16583 command.c:824 openocd_jim_vfprintf():
User : 345 16583 command.c:824 openocd_jim_vfprintf():
User : 348 16583 command.c:824 openocd_jim_vfprintf():
User : 350 16583 command.c:824 openocd_jim_vfprintf():


thanks,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to