Page 1 of 2

Arduino IDe upload verbose parameters

Posted: Thu May 07, 2020 9:11 pm
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?

Re: Arduino IDe upload verbose parameters

Posted: Fri May 08, 2020 9:09 am
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?

Re: Arduino IDe upload verbose parameters

Posted: Fri May 08, 2020 9:56 am
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?

Re: Arduino IDe upload verbose parameters

Posted: Fri May 08, 2020 10:14 am
by fpiSTM
Stderr, stdout.
Do you end with "\n"?
I don't remember but maybe you can force a flush

Re: Arduino IDe upload verbose parameters

Posted: Fri May 08, 2020 10:40 am
by stas2z
if your uploader is written on c/c++, try to use setbuf(stdout, NULL) before first printf
it will prevent stdout buffering

Re: Arduino IDe upload verbose parameters

Posted: Fri May 08, 2020 10:41 am
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.

Re: Arduino IDe upload verbose parameters

Posted: Fri May 08, 2020 10:47 am
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

Re: Arduino IDe upload verbose parameters

Posted: Fri May 08, 2020 10:51 am
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...

Re: Arduino IDe upload verbose parameters

Posted: Fri May 08, 2020 10:53 am
by stas2z
Try setbuf, if it will not work, the only way is to modify ide to prevent console buffering there

Re: Arduino IDe upload verbose parameters

Posted: Fri May 08, 2020 10:57 am
by stevestrong
I just tried setbuf, no improvement.