'reset' failed? (J-Link + ARM926EJS)

Hi,

I am new to openocd and need your kind help.

I copied some code from distributed scripts and got it was trying to get

it run with my board which is based on samsung s3c2416 (arm926ejs) and

has a 2x5pin jtag interface connected to my j-link adaptor.

After successed with some basic initialization, I tried issue 'reset

halt’ from telnet port, but it failed with some errors:

WARNING: mystery debug reason MOE = 0xc. Try issuing a resume + halt.

invalid mode value encountered 8

Jazelle state handling is BROKEN!

cpsr contains invalid mode value - communication failure

I don’t understand what really happened and what’s the error exactly. So

I am attaching the openocd log output and my script file to this email.

Hope someone can give me an idea.

Thanks in advance!

– The Log —

Info : 269 8523 server.c:83 add_connection(): accepting ‘telnet’ connection from 4444

Debug: 270 12114 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_reset halt

Debug: 271 12114 command.c:145 script_debug(): command - reset ocd_reset halt

Debug: 273 12135 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target names

Debug: 274 12135 command.c:145 script_debug(): command - ocd_target ocd_target names

Debug: 275 12135 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu invoke-event reset-start

Debug: 276 12135 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu invoke-event reset-start

Debug: 277 12135 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init-reset

Debug: 278 12135 command.c:145 script_debug(): command - ocd_jtag ocd_jtag arp_init-reset

Debug: 279 12135 core.c:1520 jtag_init_reset(): Initializing with hard TRST+SRST reset

Debug: 280 12135 jlink.c:667 jlink_reset(): trst: 1, srst: 0

Debug: 281 12137 core.c:738 jtag_add_reset(): TRST line asserted

Debug: 282 12137 jlink.c:667 jlink_reset(): trst: 1, srst: 1

Debug: 283 12139 core.c:715 jtag_add_reset(): SRST line asserted

Debug: 284 12139 jlink.c:667 jlink_reset(): trst: 0, srst: 1

Debug: 285 12141 core.c:743 jtag_add_reset(): TRST line released

Debug: 286 12141 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset

Debug: 287 12141 jlink.c:667 jlink_reset(): trst: 0, srst: 0

Debug: 288 12143 core.c:719 jtag_add_reset(): SRST line released

Debug: 289 12143 core.c:1412 jtag_init_inner(): Init JTAG chain

Debug: 290 12143 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset

Debug: 291 12146 core.c:1048 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS

Debug: 292 12146 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset

Info : 293 12281 core.c:951 jtag_examine_chain_display(): JTAG tap: s3c2416.cpu tap/device found: 0x07926f0f (mfg: 0x787, part: 0x7926, ver: 0x0)

Debug: 294 12281 core.c:1208 jtag_validate_ircapture(): IR capture validation scan

Debug: 295 12286 core.c:1267 jtag_validate_ircapture(): s3c2416.cpu: IR capture 0x01

Debug: 296 12286 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu cget -chain-position

Debug: 297 12286 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu cget -chain-position

Debug: 298 12286 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled s3c2416.cpu

Debug: 299 12286 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled s3c2416.cpu

Debug: 300 12286 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu invoke-event examine-start

Debug: 301 12286 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu invoke-event examine-start

Debug: 302 12286 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu arp_examine

Debug: 303 12286 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu arp_examine

Debug: 304 12314 embeddedice.c:501 embeddedice_write_reg(): 0: 0x00000000

Debug: 305 12325 arm7_9_common.c:75 arm7_9_clear_watchpoints(): -

Debug: 306 12325 embeddedice.c:501 embeddedice_write_reg(): 12: 0x00000000

Debug: 307 12325 embeddedice.c:501 embeddedice_write_reg(): 20: 0x00000000

Debug: 308 12345 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu invoke-event examine-end

Debug: 309 12345 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu invoke-event examine-end

Debug: 310 12345 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu invoke-event reset-assert-pre

Debug: 311 12345 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu invoke-event reset-assert-pre

Debug: 312 12345 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu cget -chain-position

Debug: 313 12345 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu cget -chain-position

Debug: 314 12345 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled s3c2416.cpu

Debug: 315 12345 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled s3c2416.cpu

Debug: 316 12345 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu arp_reset assert 1

Debug: 317 12346 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu arp_reset assert 1

Debug: 318 12346 target.c:1620 target_free_all_working_areas_restore(): freeing all working areas

Debug: 319 12346 arm7_9_common.c:878 arm7_9_assert_reset(): target->state: running

Debug: 320 12346 embeddedice.c:501 embeddedice_write_reg(): 2: 0x00000001

Debug: 321 12357 jlink.c:667 jlink_reset(): trst: 0, srst: 1

Debug: 322 12359 core.c:715 jtag_add_reset(): SRST line asserted

Debug: 323 12359 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu invoke-event reset-assert-post

Debug: 324 12359 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu invoke-event reset-assert-post

Debug: 325 12359 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu invoke-event reset-deassert-pre

Debug: 326 12359 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu invoke-event reset-deassert-pre

Debug: 327 12359 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu cget -chain-position

Debug: 328 12359 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu cget -chain-position

Debug: 329 12359 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled s3c2416.cpu

Debug: 330 12359 command.c:145 script_debug(): command - ocd_jtag ocd_jtag tapisenabled s3c2416.cpu

Debug: 331 12359 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_s3c2416.cpu arp_reset deassert 1

Debug: 332 12359 command.c:145 script_debug(): command - ocd_s3c2416.cpu ocd_s3c2416.cpu arp_reset deassert 1

Debug: 333 12359 target.c:1620 target_free_all_working_areas_restore(): freeing all working areas

Debug: 334 12359 arm7_9_common.c:973 arm7_9_deassert_reset(): target->state: reset

Debug: 335 12410 jlink.c:667 jlink_reset(): trst: 0, srst: 0

Debug: 336 12413 core.c:719 jtag_add_reset(): SRST line released

Debug: 337 12433 embeddedice.c:501 embeddedice_write_reg(): 0: 0x0000000f

Debug: 338 12444 arm7_9_common.c:75 arm7_9_clear_watchpoints(): -

Debug: 339 12444 embeddedice.c:501 embeddedice_write_reg(): 12: 0x00000000

Debug: 340 12444 embeddedice.c:501 embeddedice_write_reg(): 20: 0x00000000

Debug: 341 12484 embeddedice.c:501 embeddedice_write_reg(): 0: 0x0000000d

Debug: 342 12484 embeddedice.c:501 embeddedice_write_reg(): 0: 0x0000000d

Warn : 343 12524 arm926ejs.c:306 arm926ejs_examine_debug_reason(): WARNING: mystery debug reason MOE = 0xc. Try issuing a resume + halt.

Debug: 344 12524 arm7_9_common.c:1290 arm7_9_debug_entry(): target entered debug from ARM state

Error: 345 12973 armv4_5.c:189 arm_mode_to_number(): invalid mode value encountered 8

Error: 346 12973 armv4_5.c:386 arm_set_cpsr(): Jazelle state handling is BROKEN!

Debug: 347 12973 armv4_5.c:395 arm_set_cpsr(): set CPSR 0xffff9988: User mode, Jazelle state

Error: 348 12973 arm7_9_common.c:1313 arm7_9_debug_entry(): cpsr contains invalid mode value - communication failure

User : 349 12973 command.c:549 command_print():

Debug: 350 12973 command.c:631 run_command(): Command failed with error code -4

User : 351 12973 command.c:669 command_run_line(): in procedure ‘reset’


— My Script —

gdb_port

tcl_port

telnet_port

echo “— adaptor config —”

source [find interface/jlink.cfg]

adapter_khz 5

echo “— chip config —”

if { [info exists CHIPNAME] } {

set _CHIPNAME $CHIPNAME

} else {

set _CHIPNAME s3c2416

}

if { [info exists ENDIAN] } {

set _ENDIAN $ENDIAN

} else {

this defaults to a bigendian

set _ENDIAN little

}

if { [info exists CPUTAPID] } {

set _CPUTAPID $CPUTAPID

} else {

set _CPUTAPID 0x07926f0f

}

#jtag scan chain

jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x01 -irmask 0x0f -expected-id $_CPUTAPID

set _TARGETNAME $_CHIPNAME.cpu

target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs

echo “— board config —”

reset_config trst_and_srst separate

$_TARGETNAME configure -event reset-init { tq2410_init }

proc tq2410_init { } {

echo “reset-init”

}


-woody