AT91SAM9260 Reset / resume bug introduced after Rev 247?

Hi,

I’m still struggling to drill down to the root cause, but this is what I have found so far:

If I reset the target and then resume it with OpenOCd rev 247, everything works OK. For rev 272 and 276, OpenOCD exits without any warning. The lines that causes the exit(-1) are:

File: arm7_9_common.c

Function: arm7_9_restart_core(…)

Line 1391:

if ((jtag_execute_queue()) != ERROR_OK)
 	1392		{
-	1393			exit(-1);
 	1394		}

Does anyone have any insight?

Thanks!

Pieter

Here is the relevant part of the debug output:

Debug:   target.c:1504 handle_reset_command(): -
Debug:   embeddedice.c:220 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:383 embeddedice_write_reg(): 2: 0x00000001
Debug:   arm7_9_common.c:728 arm7_9_assert_reset(): target->state: running
Debug:   jtag.c:291 jtag_call_event_callbacks(): jtag event: SRST asserted
Debug:   jtag.c:1167 jtag_reset_callback(): -
Debug:   ft2232.c:1000 olimex_jtag_reset(): trst: 0, srst: 1, high_output: 0x03, high_direction: 0x0f
Debug:   arm7_9_common.c:950 arm7_9_halt(): target->state: reset
Debug:   arm7_9_common.c:794 arm7_9_deassert_reset(): target->state: reset
Debug:   jtag.c:291 jtag_call_event_callbacks(): jtag event: SRST released
Debug:   jtag.c:1167 jtag_reset_callback(): -
Debug:   embeddedice.c:220 embeddedice_read_reg_w_check(): 1
Debug:   ft2232.c:1000 olimex_jtag_reset(): trst: 0, srst: 0, high_output: 0x09, high_direction: 0x0f
Debug:   arm7_9_common.c:692 arm7_9_poll(): DBGACK set, dbg_state->value: 0x10d
Debug:   embeddedice.c:383 embeddedice_write_reg(): 0: 0x00000005
Debug:   embeddedice.c:383 embeddedice_write_reg(): 0: 0x00000005
Debug:   embeddedice.c:220 embeddedice_read_reg_w_check(): 1
Debug:   arm926ejs.c:301 arm926ejs_examine_debug_reason(): vector catch breakpoint
Debug:   arm7_9_common.c:1068 arm7_9_debug_entry(): target entered debug from ARM state
Debug:   arm7_9_common.c:1100 arm7_9_debug_entry(): target entered debug state in Supervisor mode
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r0: 0x0002a0f3
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r1: 0x0020007c
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r2: 0x0020007c
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r3: 0x00029f8e
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r4: 0x00400000
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r5: 0xfffff4ff
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r6: 0x00000000
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r7: 0x00000002
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r8: 0x00000009
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r9: 0xac151f05
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r10: 0x0000000c
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r11: 0x72a34532
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r12: 0xfffcc0ff
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r13: 0x00200f1c
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r14: 0x1000057c
Debug:   arm7_9_common.c:1129 arm7_9_debug_entry(): r15: 0x00000000
Debug:   arm7_9_common.c:1135 arm7_9_debug_entry(): entered debug state at PC 0x0
Debug:   arm926ejs.c:186 arm926ejs_read_cp15(): addr: 0x10 value: 00050078
Debug:   arm926ejs.c:427 arm926ejs_post_debug_entry(): cp15_control_reg: 00050078
Debug:   arm926ejs.c:186 arm926ejs_read_cp15(): addr: 0x100 value: 1d112112
Debug:   arm926ejs.c:186 arm926ejs_read_cp15(): addr: 0x50 value: 0000003b
Debug:   arm926ejs.c:186 arm926ejs_read_cp15(): addr: 0x150 value: 00000008
Debug:   arm926ejs.c:186 arm926ejs_read_cp15(): addr: 0x60 value: da9157a7
Debug:   arm926ejs.c:448 arm926ejs_post_debug_entry(): D FSR: 0x0000003b, D FAR: 0xda9157a7, I FSR: 0x00000008
Debug:   arm926ejs.c:186 arm926ejs_read_cp15(): addr: 0x38f0 value: 00000000
Debug:   arm926ejs.c:264 arm926ejs_write_cp15(): addr: 0x38f0 value: 00000007
Debug:   target.c:487 target_call_event_callbacks(): target event 0
Debug:   arm7_9_common.c:950 arm7_9_halt(): target->state: halted
Warning: arm7_9_common.c:954 arm7_9_halt(): target was already halted
Warning: jtag.c:1053 jtag_read_buffer(): in_handler reported a failed check
Debug:   target.c:1548 handle_resume_command(): -
Debug:   arm7_9_common.c:1452 arm7_9_resume(): -
Debug:   arm7_9_common.c:1251 arm7_9_restore_context(): -
Debug:   arm926ejs.c:264 arm926ejs_write_cp15(): addr: 0x50 value: 0000003b
Warning: jtag.c:1053 jtag_read_buffer(): in_handler reported a failed check
Debug:   arm926ejs.c:264 arm926ejs_write_cp15(): addr: 0x150 value: 00000008
Warning: jtag.c:1053 jtag_read_buffer(): in_handler reported a failed check
Debug:   arm926ejs.c:264 arm926ejs_write_cp15(): addr: 0x60 value: da9157a7
Warning: jtag.c:1053 jtag_read_buffer(): in_handler reported a failed check
Debug:   arm926ejs.c:186 arm926ejs_read_cp15(): addr: 0x38f0 value: 00000007
Debug:   arm926ejs.c:264 arm926ejs_write_cp15(): addr: 0x38f0 value: 00000000
Debug:   arm7_9_common.c:1267 arm7_9_restore_context(): examining User mode
Debug:   arm7_9_common.c:1281 arm7_9_restore_context(): examining dirty reg: r0
Debug:   arm7_9_common.c:1281 arm7_9_restore_context(): examining dirty reg: pc
Debug:   arm7_9_common.c:1330 arm7_9_restore_context(): writing register 0 of mode User with value 0x0002a0f3
Debug:   arm7_9_common.c:1267 arm7_9_restore_context(): examining FIQ mode
Debug:   arm7_9_common.c:1281 arm7_9_restore_context(): examining dirty reg: pc
Debug:   arm7_9_common.c:1267 arm7_9_restore_context(): examining IRQ mode
Debug:   arm7_9_common.c:1281 arm7_9_restore_context(): examining dirty reg: pc
Debug:   arm7_9_common.c:1267 arm7_9_restore_context(): examining Supervisor mode
Debug:   arm7_9_common.c:1281 arm7_9_restore_context(): examining dirty reg: pc
Debug:   arm7_9_common.c:1267 arm7_9_restore_context(): examining Abort mode
Debug:   arm7_9_common.c:1281 arm7_9_restore_context(): examining dirty reg: pc
Debug:   arm7_9_common.c:1267 arm7_9_restore_context(): examining Undefined mode
Debug:   arm7_9_common.c:1281 arm7_9_restore_context(): examining dirty reg: pc
Debug:   arm7_9_common.c:1370 arm7_9_restore_context(): writing PC with value 0x00000000
Debug:   embeddedice.c:383 embeddedice_write_reg(): 0: 0x00000000
Warning: jtag.c:1053 jtag_read_buffer(): in_handler reported a failed check

Here is my initialisation script:

######################################
# OpenOCD Configuration Script
#
# Interface: Olimex JTAG USB OCD Tiny
# Target:    Atmel AT91SAM9260
# Hardware:  SOT
######################################


######################
# Daemon configuration
######################

telnet_port 4444
gdb_port 3333
gdb_detach resume
gdb_memory_map disable
gdb_flash_program disable
daemon_startup attach


##############################
# JTAG interface configuration
##############################

interface ft2232
jtag_speed 1200

#reset_config <signals> [combination] [trst type] [srst type]
reset_config trst_and_srst separate trst_push_pull srst_open_drain

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

jtag_nsrst_delay 200
jtag_ntrst_delay 200


################
# ft2232 options
################

ft2232_device_desc "Olimex OpenOCD JTAG TINY A"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0004
ft2232_latency 2


######################
# Target configuration
######################

#target <type> <endianess> <reset mode> <JTAG pos> <variant>
target arm926ejs little reset_halt 0 arm926ejs

#target_script 0 reset at91sam9260_reset_script.ocd
run_and_halt_time 0 30

#working area <target#> <address> <size> <backup|nobackup>
working_area 0 0x00200000 0x1000 backup


#####################
# Flash configuration
#####################

#flash bank cfi <base> <size> <chip width> <bus width> <target#>
flash bank cfi 0x10000000 0x01000000 2 2 0

Probably worth getting the latest svn, it is changing quite a bit at the moment.

Also post full info to the mailing list

https://lists.berlios.de/pipermail/openocd-development

I do not have any hardware to check this target, but others on the dev list may have.

Cheers

Spen