Arduino Forum

Forum 2005-2010 (read only) => Software => Bugs & Suggestions => Topic started by: jds on Dec 29, 2007, 05:17 pm

Title: avrdude and stdout
Post by: jds on Dec 29, 2007, 05:17 pm
I am trying to catch output from avrdude in a visual studio progam. It seems that avrdude is not using stdout for writing to the console window.

Also, a test in the command prompt (windows xp; cmd.exe) as 'avrdude -h >test.txt' should output the switches supported by avrdude and other text in the file test.txt. Should, but it doesn't.

The Arduino IDE seems to show some text coming from avrdude, for example when upload.verbose is set to true. Can anyone explain how this is done?

Thanks in advance!
Title: Re: avrdude and stdout
Post by: mellis on Dec 29, 2007, 06:15 pm
It looks like avrdude writes to stderr, not stdout.  
Title: Re: avrdude and stdout
Post by: webworm on Dec 29, 2007, 11:43 pm
If you've got access to the avrdude source, the following should make all output go to stdout. You will of course need to re-compile.

Code: [Select]

#!/bin/csh
foreach a (`ls *.c`)
mv $a $a.old
sed -e 's/stderr/stdout/g' $a.old > $a
end
Title: Re: avrdude and stdout
Post by: jds on Dec 31, 2007, 11:56 am
Ok, thanks! Using stderror solved my problem!