Hello.
ESP IDF , Master (or 4.4) , ESP32 (ESP32-PICO-D4) .
Periodicaly (i'm do not know cause) 'printf' is no output to defaut uart, if non-constant format, i.e :
---
printf ("test\n"); // output: test
printf ("number %d\n", 1); // no output
char * line = "line\n";
printf (line); // no output
---
but,
---
fprintf (stdout, "number %d\n", 1); // output: number 1
---
'printf(CONSTANT)' is have output, maybe, because gcc replace 'printf(CONSTANT)' to 'puts(CONSTANT)'.
=================
I'm build tcp server in project, and connect to it from terminal on PC.
All ommited 'printf' output i see in terminal.
How to prevent redirect 'printf' output?
ESP IDF printf
Re: ESP IDF printf
Is it possible that you are overriding 'stdout' stream anywhere in your code? This would explain why printf output (which uses stdout) goes to the TCP connection and 'stderr' is still printed to the console.
If you can find the minimal code to reproduce this issue, please report it at https://github.com/espressif/esp-idf/issues and we will take a look.
If you can find the minimal code to reproduce this issue, please report it at https://github.com/espressif/esp-idf/issues and we will take a look.
Re: ESP IDF printf
Thanks.
I temporary removed all my modules, excluding main.c from build in my project.
Printf have output in app_main(). Now i will add module by module to localize problem.
My modules are not change explicitly vfs , stdout, etc... but are used many SDK components.
I temporary removed all my modules, excluding main.c from build in my project.
Printf have output in app_main(). Now i will add module by module to localize problem.
My modules are not change explicitly vfs , stdout, etc... but are used many SDK components.
Re: ESP IDF printf
Many stdio libraries will buffer a printf() / stdout stream, collecting characters and sending them as a group, usually triggered by a line feed.
Try disabling stdout buffering:
setvbuf(stdout, NULL, _IONBF, 0); // Disable stdout buffering
Try disabling stdout buffering:
setvbuf(stdout, NULL, _IONBF, 0); // Disable stdout buffering
Who is online
Users browsing this forum: No registered users and 73 guests