-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decode fails on final transaction in sequence #1
Comments
Hi, @timreyes - I've been looking at this issue and the code. One thing that's not clear to me is how the end of samples is handled generally. The (old) docs say that |
@frankleonrose I'll review this with the team (I've scheduled something this Wednesday). I don't quite remember off the top of my head. I'll need to spend some time on this and might need to run some tests as a refresher, but I'll keep you updated on an explanation! |
When an analyzer runs on an existing capture, instead of when recording, all the functions which normally block for new data won't block until the This end of capture behavior is the same when running on both streaming data and on completed captures - the moment a blocking function attempts to pass the end of the |
ParseBit calls An alternative solution to the problem is to limit how far the |
@Marcus10110 - Thanks very much for the detailed explanation. Maybe a way around it is to use the Just curious - when the function just doesn't return - how do you do that? Summarily terminate the thread? |
@frankleonrose As for how the function does not return, good question! We call the analyzer's Your implementation of If no more data is ever recorded, the function stays blocked - until we decide to join the thread. There are an number of triggers for this, but the implementation is the same. Basically, we set a boolean flag called "thread must exit". If it has, we throw a special exception, something like "thread must exit exception". At the very top of the thread, when we called your implementation of |
Another user reported the bug in ticket #69924 |
Another report of the issue here: #85860 |
Hi! I'm not sure if this is the appropriate place to report issues with this analyzer, so please redirect me if not.
When decoding an SWD transaction, the current analyzer needs to see a '1' bit after the current transaction, to mark it as a valid operation. Specifically for each bit parsed the worker thread calls
IsOperation
which runs through all trailing zeros until it sees a 1 bit.However, the final transaction in a sequence won't have any subsequent 1 bit, because no more bits are clocked out at all. As a result, the final transaction doesn't get analyzed at all. This is especially annoying when analysing a failure situation because the final transaction is the one you're most interested in!
I prepared an example capture, the first is a normal SWD transaction where the analyzer doesn't process the final transaction, the second I artificially add some extra 1 bits at the end which triggers the analysis.
Here's a zip of the two traces:
swd_analyzer_trailing_1s.zip
I don't understand how the loop in https://github.com/saleae/swd-analyzer/blob/master/src/SWDTypes.cpp#L407 ever terminates but perhaps a fix could be as simple as having the loop break if there are no bits left to analyser as well as if we see a 1.
The text was updated successfully, but these errors were encountered: