> Subject: Re: [Openocd-development] Cortex M3 halting almost 
> immediately
> 
> I've narrowed it down (I think) to a multiple bugs in 
> cortex_m3.c. Can somebody who knows the codebase a little 
> better take a look and verify if it's an actual bug? Here's 
> what I think is going on.
> 
> bug 1) cortex_m3_assert_reset() called 
> cortex_m3_clear_halt(), which contrary to its name, doesn't 
> clear the halt flag, but instead sets C_HALT.
> 
> bug 2) cortex_m3_poll() does an atomic read on DCB_DHCSR, 
> checks if the target is resetting, and then calls 
> cortex_m3_endreset_event(), which should reset the DHCSR to 
> its reset state. Unfortunately, the atomic read which checks 
> that state is called before endreset_event(), so when it 
> checks (dcb_dhcsr & S_HALT), it's using the old value of 
> DHCSR, then halts the target, leaving you right back where 
> you started (halted).
> 
> Making assert_reset() actually clear C_HALT and adding another read in
> poll() fixed the problem for me.
> 
> 

Thanks for the report - not sure how this crept in.
I will have a look into it.

Cheers
Spen

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to