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

Increase delay in Segger RTT debugging (fix #1697). #1960

Merged
merged 2 commits into from Jun 19, 2020

Conversation

gendx
Copy link
Contributor

@gendx gendx commented Jun 19, 2020

Pull Request Overview

This pull request fixes #1697 by increasing the delay in Segger RTT debugging.

I tried various parameters, and 1ms of delay seems reliable enough, even for large buffers (tested up to 1500 bytes).

Somehow, when I originally filed #1697, I don't recall that increasing this delay would work, but it seems to fix it in the current kernel.

Testing Strategy

This pull request was tested on a nRF52840-DK board with the "console triangle" test mentioned in #1697 and located on https://github.com/gendx/libtock-rs/blob/console-check/examples/console_triangle.rs. I also tested increasing the "width" of the triangle up to 1500 bytes, and the output works properly.

I had a look at https://www.segger.com/downloads/jlink but couldn't find a reliable source of ground truth on the acceptable frequency to refresh the RTT buffers...

TODO or Help Wanted

This change makes the console slower, especially if one only uses very small buffers. However, reliability is likely preferable over premature optimization. Better start from a working code and optimize from there than the opposite.

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

capsules/src/segger_rtt.rs Outdated Show resolved Hide resolved
bradjc
bradjc previously approved these changes Jun 19, 2020
Co-authored-by: Branden Ghena <brghena@berkeley.edu>
@brghena
Copy link
Contributor

brghena commented Jun 19, 2020

bors r+

@bors bors bot merged commit 5fc9260 into tock:master Jun 19, 2020
@gendx gendx deleted the fix-segger-rtt-large-buffer branch June 19, 2020 16:27
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.

[Bug] Corrupted console output with large buffers.
3 participants