Skip to content

Serial Monitor swallows my print lines #5362

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

Closed
ullix opened this issue Jul 7, 2021 · 1 comment · Fixed by #5390 or #5549
Closed

Serial Monitor swallows my print lines #5362

ullix opened this issue Jul 7, 2021 · 1 comment · Fixed by #5390 or #5549
Assignees
Milestone

Comments

@ullix
Copy link

ullix commented Jul 7, 2021

Any Serial.print*() command does not seem to make it to output when it is preceded by a log_X() command, with X= e, i, d, w, v.

This had been first reported on platformio (platformio/platformio-core#3992 ) but was found to be an arduino-core issue.

This simple script:

#include <Arduino.h>
#include <esp_log.h>

void setup() {
    Serial.begin(115200);
    Serial.println("setup started ###########################################################");

    log_i("%s",  "some text");
    log_i("%s",  "more text");
    log_i("%s",  "even more text");

   // Serial.flush();
    Serial.println("1");
    Serial.println("2");
    Serial.println("3");
    Serial.println("4");
    Serial.println("5");

    log_e("%s",  "but where are my numbers?");
}

void loop() {}

was run on Arduino 1.8.13, Arduino 2.0.0Beta7, and Platformio and produced the same output:

18:35:24.821 > setup started ###########################################################
18:35:24.821 > [I][main.cpp:8] setup(): some text
18:35:24.821 > [I][main.cpp:9] setup(): more text
18:35:24.821 > [I][main.cpp:10] setup(): even more text
18:35:24.821 > [E][main.cpp:18] setup(): but where are my numbers?

However, when the Serial.flush() command was uncommented, then the numbers are printed properly. Again, same result on all 3 systems.

Looks like a bug where log_X and Serial are overwriting each others buffers?

@SuGlider
Copy link
Collaborator

Issue solved on PR #5390

@SuGlider SuGlider self-assigned this Jul 19, 2021
me-no-dev pushed a commit that referenced this issue Aug 23, 2021
## Summary
This PR is a complete reffactoring of UART Serial Hardware and respective HAL in order to use IDF instead of current Register manipulation approach. 

It  implements Arduino SerialEvent functionality. 

Fix #5287  
Fix #5273 
Fix #5519 
Fix #5247 
Fix #5403
Fix #5429
Fix #5047
Fix #5463
Fix #5362 
Fix #5112  
Fix #5443 

## Impact
It solves many reported issues related to UART.
It was tested and works fine for ESP32, ESP-S2 and ESP32-C3.
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

Successfully merging a pull request may close this issue.

3 participants