UART - ring buffer full, uart_flush_input(uart_port_t uart_num) doesn't clear buffer

filipESP
Posts: 74
Joined: Tue Nov 06, 2018 12:42 pm

UART - ring buffer full, uart_flush_input(uart_port_t uart_num) doesn't clear buffer

Postby filipESP » Tue Aug 03, 2021 9:01 am

I use idf v4.4-dev.
When I transmit to esp lot of data with high frequency the event UART_BUFFER_FULL appears but uart_flush_input() doesn't clear buffer but returns ESP_OK status.
Next event is UART_FIFO_OVF and it apears continously when data is receive.
This is my while loop in uart task:

Code: Select all

	while(1) {
        if( xQueueReceive( uart_console_queue, ( void* )&event, 1) ){
			 switch( event.type ) {
				 case UART_DATA:
						uart_console_read_data( event.size );
					 break;
				 case UART_FIFO_OVF:
					 ESP_LOGW( UART_TASK_TAG, "hw fifo overflow, err %s ", esp_err_to_name( uart_flush_input( UART_CONSOLE ) ) );
					 xQueueReset( uart_console_queue );
					 break;
				 case UART_BUFFER_FULL:
					 ESP_LOGI( UART_TASK_TAG, "ring buffer full" );
					 uart_flush_input( UART_CONSOLE );
					 xQueueReset( uart_console_queue );
					 break;
				 case UART_BREAK:
					 ESP_LOGI( UART_TASK_TAG, "uart rx break" );
					 break;
				 case UART_PARITY_ERR:
					 ESP_LOGI( UART_TASK_TAG, "uart parity error" );
					 break;
				 case UART_FRAME_ERR:
					 ESP_LOGI( UART_TASK_TAG, "uart frame error" );
					 break;
				 default:
					 ESP_LOGI( UART_TASK_TAG, "uart event type: %d", event.type );
					 break;
			 }
        }
	}

filipESP
Posts: 74
Joined: Tue Nov 06, 2018 12:42 pm

Re: UART - ring buffer full, uart_flush_input(uart_port_t uart_num) doesn't clear buffer

Postby filipESP » Tue Aug 17, 2021 2:05 pm

Still no suggestions?

linus.lundin
Posts: 1
Joined: Sun Sep 06, 2020 3:11 pm

Re: UART - ring buffer full, uart_flush_input(uart_port_t uart_num) doesn't clear buffer

Postby linus.lundin » Fri Sep 30, 2022 1:01 pm

Hi,

I have the exact same issue, did you find a solution?`

/Linus

Who is online

Users browsing this forum: No registered users and 90 guests