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

RTT host-to-target communication #1253

Merged
merged 4 commits into from
Dec 3, 2021
Merged

RTT host-to-target communication #1253

merged 4 commits into from
Dec 3, 2021

Conversation

ccattuto
Copy link
Contributor

@ccattuto ccattuto commented Nov 30, 2021

This is an initial implementation of RTT host-to-target communication for pyOCD's rtt subcommand.

  • It is meant to provide bidirectional, terminal-like RTT communication with the target, with the assumption that the user will type on stdin short commands for the target
  • stdin is read one character at a time, in a non-blocking fashion. Characters are echoed to the terminal and accumulated in a buffer until we see a CR of LF. At that point, if there is sufficient space in the RTT down-buffer (host-to-target), the buffer is copied character-by-character to the RTT ring buffer.
  • the code processes backspace characters from stdin, allowing the user to make corrections before hitting CR/LF. ESC terminates the session.
  • all the modifications were carried out within rtt_cmd.py, including the addition of a class (copied from here) for cross-platform, non-blocking read of 1 character from stdin.

Initial implementation of RTT host-to-target communication with minimal terminal features in the "rtt" subcommand.
@lgtm-com
Copy link

lgtm-com bot commented Nov 30, 2021

This pull request introduces 1 alert and fixes 1 when merging 8a67290 into c90d7bc - view on LGTM.com

new alerts:

  • 1 for Unused local variable

fixed alerts:

  • 1 for Unreachable code

Copy link
Member

@flit flit left a comment

Choose a reason for hiding this comment

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

Since this change is pretty significant, would you mind adding your copyright to the rtt_cmd.py header comment?

Aside from that, just please fix the unused local variable warning from LGTM.

If you feel like it, type annotations would be nice but aren't strictly required yet.

@flit flit mentioned this pull request Dec 2, 2021
@lgtm-com
Copy link

lgtm-com bot commented Dec 2, 2021

This pull request fixes 1 alert when merging db1553f into bc54e81 - view on LGTM.com

fixed alerts:

  • 1 for Unreachable code

@pyocd pyocd deleted a comment from lgtm-com bot Dec 3, 2021
@pyocd pyocd deleted a comment from lgtm-com bot Dec 3, 2021
@flit flit merged commit 41a86b3 into pyocd:develop Dec 3, 2021
@ccattuto ccattuto deleted the rtt-devel branch December 4, 2021 01:01
@ccattuto ccattuto restored the rtt-devel branch December 5, 2021 17:18
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.

2 participants