Pages: [1]   Go Down
Author Topic: avrdude and stdout  (Read 469 times)
0 Members and 1 Guest are viewing this topic.
Netherlands
Offline Offline
Sr. Member
****
Karma: 0
Posts: 414
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks like avrdude writes to stderr, not stdout.  
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#!/bin/csh
foreach a (`ls *.c`)
mv $a $a.old
sed -e 's/stderr/stdout/g' $a.old > $a
end
Logged

Netherlands
Offline Offline
Sr. Member
****
Karma: 0
Posts: 414
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, thanks! Using stderror solved my problem!
Logged

Pages: [1]   Go Up
Jump to: