Skip to content

Better avrdude output #2002

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

Merged
merged 2 commits into from
Nov 7, 2014
Merged

Conversation

matthijskooijman
Copy link
Collaborator

The first commit makes the processing of the uploader output less strictly line-buffered, which makes the avrdude progress bar work in verbose mode.

The second commit reduces the avrdude verbosity, in verbose mode it was spamming more than is productive IMHO.

@matthijskooijman
Copy link
Collaborator Author

I just reduced the verbosity even further (from three -v's to one -v), since I found that avrdude dumps a lot of overly verbose data when using the jtag3 programmer with two or three -v's still.

@cmaglie cmaglie added this to the Release 1.5.8 milestone Jul 15, 2014
@matthijskooijman matthijskooijman added Component: Toolchain The tools used for compilation and uploading to Arduino boards Version: 1.5.x Component: Compilation Related to compilation of Arduino sketches feature request A request to make an enhancement (not a bug fix) labels Sep 10, 2014
@cmaglie cmaglie modified the milestones: Release 1.5.8, Release 1.5.9 Oct 13, 2014
@matthijskooijman
Copy link
Collaborator Author

One more reason to reduce the verbosity: Every now and then people ask how to run avrdude manually. I'd like to tell them to enable verbose uploads to peek at the commands printed, but due to the high verbosity, the commands scroll out of the buffer before you can properly look at them...

I think this PR is ready to merge, would be good if it was indeed merged before the next release.

Previously, the MessageSiphon class would read characters from an
InputStream and then push them to the passed MessageConsumer one line at
a time.

Now, you can specify a line timeout. Normally, messages are still
processed line by line, but if no line ending is received within the
specified timeout (counting from the first character in the line), then
the incomplete line is passed on as a message, without waiting for the
line ending.

This feature is used for the uploader command output. In particular,
this allows the avrdude progress bar to be shown in the IDE as expected,
character by character (previously, the entire progress bar would be
buffered, making it show up completely at the end of the upload).
Previously, when verbose uploads were enabled, avrdude was run with four
-v options, causing it to dump all raw bytes exchanged with the
bootloader. This floods the console so much that meaningful output
mostly disappears.

Most users probably want to enable verbose mode just to see what avrdude
command is ran. Furthermore, users that benefit from the raw bytes
dumped are perfectly capable of either running avrdude manually, or
modifying platform.txt. Given that, running avrdude with just one  -v
should be plenty.

This fixes arduino#891.
@matthijskooijman
Copy link
Collaborator Author

I just rebased this against latest ide-1.5.x. Is anything keeping this from being merged?

@cmaglie cmaglie merged commit cd9a9e3 into arduino:ide-1.5.x Nov 7, 2014
@cmaglie
Copy link
Member

cmaglie commented Nov 7, 2014

I agree with you that in most cases the noise produced with verbosity at level 4 hides much more valuable informations at the beginning of the output, BTW I'm not sure that the verbosity with -v -v -v -v is not useful at all, let's see.

@matthijskooijman
Copy link
Collaborator Author

Four -v's might be useful in some cases, but those will be very specific cases, where modifying platform.txt is acceptable.

Thanks for merging this :-)

@matthijskooijman matthijskooijman deleted the ide-1.5.x-avrdude branch June 12, 2015 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Compilation Related to compilation of Arduino sketches Component: Toolchain The tools used for compilation and uploading to Arduino boards feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants