Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serial port pollution on startup #1

Closed
Sonic-Amiga opened this issue Jun 21, 2023 · 2 comments
Closed

Serial port pollution on startup #1

Sonic-Amiga opened this issue Jun 21, 2023 · 2 comments

Comments

@Sonic-Amiga
Copy link
Owner

Despite redirection code, some serial log is still produced after serial port init. This causes delayed startup

@Sonic-Amiga
Copy link
Owner Author

The pollution comes from two facts:

  1. Serial driver appears to buffer things internally; fflush() does not help
   ESP_LOGI (TAG, "Starting UART%s", s21 ? " S21" : "");
// Shut off console log if it is using our UART
#if defined(CONFIG_ESP_CONSOLE_UART_DEFAULT) || defined(CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0)
   if (uart == UART_NUM_0) {
      fflush(stdout);
      esp_log_set_putchar(faikin_log_putc);
   }
#endif

"Starting UART" string already comes at 2400
2. wifi code inside the framework has its own dump, ignoring the putchar callback. espressif/ESP8266_RTOS_SDK#1082

@Sonic-Amiga
Copy link
Owner Author

Fixed by 6cb6279

Sonic-Amiga added a commit that referenced this issue Sep 25, 2023
Fix #1 for real. The fix
relies on patched ets_vprintf() in the SDK. Using an existing flag didn't work
well because every NVS write frobbed it back to zero, causing the issue to
re-appear.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant