Arduino IDe upload verbose parameters

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Arduino IDe upload verbose parameters

Post by stevestrong »

Hi,
does someone know which parameters can be used as upload.verbose in platform.txt and what is their effect?
In the platform specification I could only find few lines but they do not answer my question.

My problem is that even if i checked the verbose by upload option in Adruino preferences, the std outputs generated during upload are only printed in one piece, after the upload process finished.

Is it possible to get all upload std output lines one by one at the time they are generated displayed in Arduino message window? If yes, how?
by stas2z » Fri May 08, 2020 10:40 am
if your uploader is written on c/c++, try to use setbuf(stdout, NULL) before first printf
it will prevent stdout buffering
Go to full post
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Arduino IDe upload verbose parameters

Post by fpiSTM »

stevestrong wrote: Thu May 07, 2020 9:11 pm
Is it possible to get all upload std output lines one by one at the time they are generated displayed in Arduino message window? If yes, how?
I don't know how it is managed anyway for some upload methid it seems output line by line.
For example when upload has a text progress bar.
Which upload method you want output?
I guess for your bootloader?
How do you print your message? On which stdio?
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Arduino IDe upload verbose parameters

Post by stevestrong »

Yes, that is for my CDC bootloader.
I use normal printf. Isn't that right?
What do you mean under "which stdio"?
What should I use instead?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Arduino IDe upload verbose parameters

Post by fpiSTM »

Stderr, stdout.
Do you end with "\n"?
I don't remember but maybe you can force a flush
stas2z
Posts: 131
Joined: Mon Feb 24, 2020 8:17 pm
Answers: 8

Re: Arduino IDe upload verbose parameters

Post by stas2z »

if your uploader is written on c/c++, try to use setbuf(stdout, NULL) before first printf
it will prevent stdout buffering
Last edited by stas2z on Fri May 08, 2020 10:43 am, edited 1 time in total.
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Arduino IDe upload verbose parameters

Post by stevestrong »

I use Eclipse and MinGW for the development. There is no stdout.h
Of course I use \n when needed.
It works correctly when executed in a CMD window.
Only Arduino IDE message window is not updating the outputs in real time.
stas2z
Posts: 131
Joined: Mon Feb 24, 2020 8:17 pm
Answers: 8

Re: Arduino IDe upload verbose parameters

Post by stas2z »

stevestrong wrote: Fri May 08, 2020 10:41 am I use Eclipse and MinGW for the development. There is no stdout.h
no) stdout and stderr are posix output streams, probably for mingw it will not make any sense, by default printf should output to stdout
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Arduino IDe upload verbose parameters

Post by stevestrong »

I also tried fprintf(stderr, ...) but no chance, the same effect.

For example, output in CMD in real time:

Code: Select all

Trying to reset port COM22 or find bootloader on [1eaf:0002]
.....
 ERROR: Could not establish communication with the device. Giving up.
vs output in Arduino (at the end of process):

Code: Select all

.....
Trying to reset port COM22 or find bootloader on [1eaf:0002]
 ERROR: Could not establish communication with the device. Giving up.
 ERROR: Could not establish communication with the device. Giving up.
This has inverted output and doubled last line...
Last edited by stevestrong on Fri May 08, 2020 10:58 am, edited 5 times in total.
stas2z
Posts: 131
Joined: Mon Feb 24, 2020 8:17 pm
Answers: 8

Re: Arduino IDe upload verbose parameters

Post by stas2z »

Try setbuf, if it will not work, the only way is to modify ide to prevent console buffering there
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Arduino IDe upload verbose parameters

Post by stevestrong »

I just tried setbuf, no improvement.
Post Reply

Return to “IDE's”