On Monday 11 January 2010, Thomas Kindler wrote:
> How could this be fixed or explained?

There's some curious voodoo in the Cortex-M3 code
where it mucks with fault handling ... see in the
cortex_m3_endreset_event() routine where it sets
up to trap some faults automagically.  REVISIT
comments mark at least two curiousities, also a
FIXME with respect to a more easily seen bug.

I'd guess you're hitting one of the curiousities.

Part of the theory here would be that it faults and
then drops into debug mode after the debugger
disconnected.  There'd also implicitly be issues
when OpenOCD (re)attaches in that state ... there
are simpler issues, like ISTR registers not getting
loaded if the core is in debug halt when OpenOCD
starts up, and likely other related quirks.

If that's part of the issue, you might be able to
work around it by updating DEMCR before shutting
down.  "cortex_m3 vector_catch none" maybe.

Re needing a power cycle, it's a bit suggestive that
DHCR and DEMCR are not cleared by "normal" reset...

I think a better approach likely just leaves fault
handling alone by default.  Catch reset vector
during "reset" processing, sure.  Pay attention
to the vector_catch config, sure.  But don't touch
the exception vector handling otherwise; and maybe
there's stuff that should trigger on shutdown.

- Dave
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to