On Thursday 10 December 2015 20:15:34 you wrote: > On Thu, Dec 10, 2015 at 1:21 PM, Matthias Welwarsky <matth...@welwarsky.de> > > Apart from the obvious conceptual > > cleaning, it is going to make it easier to fix WAIT handling in the DAP > > layer. > > I didn't have that in mind at all actually, so I'm a bit surprised to hear > that. What kind of model do you imagine for WAIT handling?
The proof of concept is tracked here: http://openocd.zylin.com/3166 The current strategy is pretty brute. I keep a journal of all dap transactions since the last dap_run(). The transactions are recorded with their full parameters so that they can be replayed when needed. Ack status is recorded for each of the transactions instead of a per-dap ack, which doesn't work anyway. On dap_run(), I check if a sticky overrun condition happened, and if yes, the whole journal is replayed synchronously, i.e. each transaction is followed immediately by a jtag_execute_queue() and potential WAIT conditions are resolved immediately. The reason for the full journal replay is the quirky WAIT implementation in ADIv5: With overrun check enabled, APACC are discarded after a WAIT is detected (overrun is sticky), but DPACC are still performed as soon as the DAP is no longer busy. This means the DAP state might be clobbered and I can not simply replay starting with the first failed transaction. There might be a different solution, like tracking and restoring the DAP state before starting the journal replay but I have to investigate this further. BR, Matthias ------------------------------------------------------------------------------ _______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel