Skip to content

Serial drops characters on ESP32 Arduino version 2.0.2 #6205

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
1 task done
technoblogy opened this issue Jan 28, 2022 · 5 comments
Closed
1 task done

Serial drops characters on ESP32 Arduino version 2.0.2 #6205

technoblogy opened this issue Jan 28, 2022 · 5 comments
Assignees
Labels
Area: Peripherals API Relates to peripheral's APIs. Status: Solved

Comments

@technoblogy
Copy link

Board

Adafruit Feather ESP32

Device Description

Plain board.

Hardware Configuration

No.

Version

v2.0.2

IDE Name

Arduino IDE

Operating System

macOS 10.13.6

Flash frequency

40MHz

PSRAM enabled

no

Upload speed

921600

Description

Echoing text in the Serial Monitor causes dropped characters. Run the following sketch, then cut and paste the following text into the Serial Monitor input field, and press Return:

$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

The text is echoed as:

$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS

(without the line break), so the last 8 characters have been dropped.

Sketch

void setup() {
  Serial.begin(9600);
}

void loop (void) {
  if (Serial.available()) Serial.print((char)Serial.read());
}

Debug Message

No debug output.

Other Steps to Reproduce

I have repeated the same test on ESP32 Arduino core version 1.0.6 and it works fine; in other words, it echoes:

$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

(without the line break).

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@technoblogy technoblogy added the Status: Awaiting triage Issue is waiting for triage label Jan 28, 2022
@technoblogy technoblogy changed the title Serial hangs up on ESP32 Arduino version 2.0.2 Serial drops characters on ESP32 Arduino version 2.0.2 Jan 29, 2022
@SuGlider SuGlider self-assigned this Jan 29, 2022
@mstegen
Copy link
Contributor

mstegen commented Jan 30, 2022

Have you tried to increase the receive buffer?
i.e.
Serial.setRxBufferSize(1024);

I've found the new uart implementation to be much more robust then the previous (1.0.6) version.
Especially when using all three uarts at the same time.

@technoblogy
Copy link
Author

technoblogy commented Jan 30, 2022

@mstegen thanks for the suggestion.

I've tried that but it doesn't seem to have any effect, either on my simple test above, or on my real application (uploading programs to uLisp running on ESP boards).

@SuGlider
Copy link
Collaborator

SuGlider commented Jan 30, 2022

@technoblogy
Indeed this is a bug with V2.0.2. Thanks for reporting it!
Please try using the latest version in Github (git checkout master)

This issue has been fixed in PR #6133
You can also apply this fix to your local Arduino folder to test it.

Please let me know.
Thanks.

@technoblogy
Copy link
Author

technoblogy commented Jan 30, 2022

@SuGlider Thank you for your reply. I confirm that applying that fix solves the problem on the following boards I've tested:

Adafruit ESP32 Feather
DOIT ESP32 DEVKIT v1
ESP32-C3 DevKit

However I'm still unable to get Serial to work reliably on ESP32-S2 boards. Should this also fix that case? Thanks!

@SuGlider
Copy link
Collaborator

SuGlider commented Jan 30, 2022

@technoblogy
Yes, the latest master version of this repository shall make all the Serial ports, of every ESP SoC, work very reliably, including the ESP32-S3 which shall be included in the, to be released, Arduino Core 2.0.3 (that will include PR #6133).
I've just tested this specific issue with the ESP32-S2-Saola-1-v1.2 board and it works correctly.

In case you have found some other specific issue with HardwareSerial, please open a new issue and I'll analyze it.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Peripherals API Relates to peripheral's APIs. Status: Solved
Projects
None yet
Development

No branches or pull requests

4 participants