arm926ejs has special interpretation of the halt
reason.
The attached patch interprets unknown debug requests as DBGRQ,
but does not return an error for interpreting the debug reason.
DBGRQ is not enabled by default (see arm7_9 dbgrq).
Hopefully this should fix "reset run" + "halt" => not halting
problems with arm926ejs.
Comments? Insights?
Testing much appreciated!!!
--
Øyvind Harboe
Embedded software and hardware consulting services
http://www.zylin.com
### Eclipse Workspace Patch 1.0
#P openocd
Index: src/target/arm7_9_common.c
===================================================================
--- src/target/arm7_9_common.c (revision 2460)
+++ src/target/arm7_9_common.c (working copy)
@@ -1431,18 +1431,10 @@
context[15] -= 3 * 4;
}
- if ((target->debug_reason == DBG_REASON_BREAKPOINT)
- || (target->debug_reason == DBG_REASON_SINGLESTEP)
- || (target->debug_reason == DBG_REASON_WATCHPOINT)
- || (target->debug_reason == DBG_REASON_WPTANDBKPT)
- || ((target->debug_reason == DBG_REASON_DBGRQ) &&
(arm7_9->use_dbgrq == 0)))
+ if ((target->debug_reason != DBG_REASON_DBGRQ) || (!arm7_9->use_dbgrq))
context[15] -= 3 * ((armv4_5->core_state == ARMV4_5_STATE_ARM)
? 4 : 2);
- else if (target->debug_reason == DBG_REASON_DBGRQ)
- context[15] -= arm7_9->dbgreq_adjust_pc * ((armv4_5->core_state
== ARMV4_5_STATE_ARM) ? 4 : 2);
else
- {
- LOG_ERROR("unknown debug reason: %i", target->debug_reason);
- }
+ context[15] -= arm7_9->dbgreq_adjust_pc * ((armv4_5->core_state
== ARMV4_5_STATE_ARM) ? 4 : 2);
if (armv4_5_mode_to_number(armv4_5->core_mode)==-1)
return ERROR_FAIL;
Index: src/target/arm926ejs.c
===================================================================
--- src/target/arm926ejs.c (revision 2460)
+++ src/target/arm926ejs.c (working copy)
@@ -333,20 +333,21 @@
* openocd development mailing list if you have hardware
* to donate to look into this problem....
*/
- LOG_ERROR("mystery debug reason MOE = 0xc. Try issuing
a resume + halt.");
+ LOG_WARNING("WARNING: mystery debug reason MOE = 0xc.
Try issuing a resume + halt.");
target->debug_reason = DBG_REASON_DBGRQ;
- retval = ERROR_TARGET_FAILURE;
break;
default:
- LOG_ERROR("BUG: unknown debug reason: 0x%x",
debug_reason);
+ LOG_WARNING("WARNING: unknown debug reason: 0x%x",
debug_reason);
+ /* Oh agony! should we interpret this as a halt request
or
+ * that the target stopped on it's own accord?
+ */
target->debug_reason = DBG_REASON_DBGRQ;
/* if we fail here, we won't talk to the target and it
will
* be reported to be in the halted state */
- retval = ERROR_TARGET_FAILURE;
break;
}
- return retval;
+ return ERROR_OK;
}
uint32_t arm926ejs_get_ttb(target_t *target)
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development