Skip to content

After HardwareSerial input FIFO overflow, no more input is received. #6336

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
hreintke opened this issue Feb 23, 2022 · 2 comments · Fixed by #6364
Closed

After HardwareSerial input FIFO overflow, no more input is received. #6336

hreintke opened this issue Feb 23, 2022 · 2 comments · Fixed by #6364
Assignees
Labels
Resolution: Duplicate Issue is a duplicate of another issue

Comments

@hreintke
Copy link
Contributor

Board

LOLIN 32

Device Description

LOLIN32

Hardware Configuration

Only Serial connected to PC using USB

Version

latest master

IDE Name

Sloeber Eclipse

Operating System

Window 10

Flash frequency

80 Mhz

PSRAM enabled

no

Upload speed

921600

Description

I have a 360 degree distance sensor which always outputs a data stream of 115200 baud.
When handling that datastream, an input FIFO can occour.
That is no problem as the messages have a crc so errors are detected by the protocol.
But what happens is that after the FIFO overflow, there are no more characters received from the Serial port.

I know I can increase the rxBufferSize, but that only makes the issue less frequent. I'd like to have a solid solution without the risk of hanging.

I would expect an overflow "only" gives loss of characters, but now it completely stops the uart from functioning.
Looks like the fifo error interrupt flag is not reset.

Checked in the 1.06 version, which uses uart directly (not using IDF).
In there on every interrupt the flag is reset uart->dev->int_clr.rxfifo_full = 1;

With that version all works as expected.

I used this small program to force the FIFO overflow, just send a larger message to the esp and it will trigger.
Any further input will only report another overflow

Sketch

#include "Arduino.h"

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

void loop()
{
	if (Serial.available())
	{
		char c = Serial.read();
		delay(1);
		Serial.printf("%c",c);
	}
}

Debug Message

[↑☻☻☻??m◄um????2-hal-cpu.c:211] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz

0
01234567890
1
01234567890
2
0123456789[  4783][W][esp32-hal-uart.c:119] uart_event_task(): UART0 Buffer Full. Flushing data. Consider encreasing your buffer size of your Application.
0[  4796][W][esp32-hal-uart.c:113] uart_event_task(): UART0 FIFO Overflow. Flushing data. Consider adding Flow Control to your Application.
[  4808][W][esp32-hal-uart.c:113] uart_event_task(): UART0 FIFO Overflow. Flushing data. Consider adding Flow Control to your Application.
[  4821][W][esp32-hal-uart.c:113] uart_event_task(): UART0 FIFO Overflow. Flushing data. Consider adding Flow Control to your Application.


### Other Steps to Reproduce

_No response_

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

- [X] I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@hreintke hreintke added the Status: Awaiting triage Issue is waiting for triage label Feb 23, 2022
@gonzabrusco
Copy link
Contributor

Reported on here: #6326

@hreintke
Copy link
Contributor Author

Duplicate

@VojtechBartoska VojtechBartoska added Resolution: Duplicate Issue is a duplicate of another issue and removed Status: Awaiting triage Issue is waiting for triage labels Feb 23, 2022
@SuGlider SuGlider self-assigned this Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Duplicate Issue is a duplicate of another issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants