Skip to content
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

add memory trace parser to mbed client #789

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thinkberg
Copy link

Here is the memory trace parser embedded into the sterm functionality. It was pretty easy using the transform functionality of MiniTerm. However, it also means that the sterm basically enters a line mode. So if you expect a prompt on a single line, it may not show up when using trace.

Run the terminal with --trace <resetstring>: mbed sterm --trace "ubirch" -r

The <resetstring> resets the counters, so you can press the reset button and it will clear the counter. Apart from that I think the screenshot is pretty self explanatory.

The output is as follows:
screenshot 2018-11-14 at 15 26 44

Enjoy,

Leo.

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. @screamerbg What do you think of this sterm plugin?

@screamerbg
Copy link
Contributor

Looks good indeed! Thanks for this @thinkberg. I'd like to involve few guys from the various teams (including OOB) to try this functionality.

@sg-, @MarceloSalazar, @maclobdell, @toyowata, @bentcooke could you guys try this cool addition to the sterm functionality?

@screamerbg screamerbg self-requested a review November 14, 2018 15:48
@thinkberg
Copy link
Author

Of course, go check it. The python is not optimal yet, but I wanted to get it done in between all the other projects. There is some room for code improvements and simplification.

@screamerbg
Copy link
Contributor

@thinkberg Could you please elaborate about the line mode?

@thinkberg
Copy link
Author

thinkberg commented Nov 14, 2018

I have to collect the output lines to do the matching. This leads to a situation where I am collecting serial output from the board until I see a CR or NL.
If you do something in your mbed code like: printf("input something: "); and then wait for some input of the user from the serial line, the plugin will show all lines before input something, but only after it sees a newline in the board output print it to the user.

@thinkberg
Copy link
Author

Or put in other words, the plugin outputs whole lines, not characters on the terminal.

for c in rx_input:
if c == '\r' or c == '\n':
if len(self.buffer):
out += self.trace_line(self.buffer)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the place where it runs the data through the trace matcher. The transformer class collects data until it sees either \r or \n

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reference

@thinkberg
Copy link
Author

Opinions? Recommendations? Wishes?

@thinkberg
Copy link
Author

We should come to an end here ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants