From: Angus G. <gu...@pr...> - 2014-12-10 21:30:43
|
On Wed, Dec 10, 2014 at 01:29:00PM +0100, Jean-Christian de Rivaz wrote: > >My understanding, that I'm guessing you share, is that you should be > >seeing FAULT responses to everything after the WAIT, until a write to > >ABORT clears the STICKYORUN flag. > > Thanks for the hint ! The CORUNDETECT bit is set in target/arm_adi_v5.c and > is the cause of my problem. Not setting this bit make my patch working very > well. Hi Jean-Christian, Glad you found a solution! Just curious based on what you said previously, does clearing the STICKYORUN flag fail on SAMD21? (This should happen as part of writing ABORT, if you set the correct flag?) I'm wondering because you could possibly leave overrun mode enabled and just call swd_clear_sticky_error(dap) on WAIT (or issue an equivalent command, as the "queueing" mechanism will disallow this exact call happening straight away), before you loop around and try again. This way the patch wouldn't require the hack, and all adapters could still use overrun mode. Let me know if the above paragraph doesn't make sense and I'll try and write it into the patch. (As written, the driver in the patch still behaves a bit as if it were in overrun mode - it clocks the data bits regardless of the command response. It looks like you could change this instead without too much trouble, but I think supporting overrun is a better idea if possible to avoid another special case in the higher layer.) Angus |