UART "Pattern Queue Size too small"

edo76mal
Posts: 7
Joined: Wed May 11, 2022 10:17 am

UART "Pattern Queue Size too small"

Postby edo76mal » Thu Aug 04, 2022 7:17 am

I have a wroom32E linked to a bluepill board. From bluepill a receive a 100 chars long message with 30 Hz frequency via UART. Randomly I have the debug message "Pattern Queue Size too small" and I loose a bluepill message.
Have you some ideas how to solve?

The UART configuration is:

#define BLUEPILL_UART_PORT UART_NUM_2
#define BLUEPILL_UART_RXD_PIN (GPIO_NUM_16) // GPIO per UART2 su WROOM-32E
#define BLUEPILL_UART_TXD_PIN (GPIO_NUM_17) // GPIO per UART2 su WROOM-32E
#define BLUEPILL_UART_RX_BUFFER_SIZE 2048
#define BLUEPILL_UART_TX_BUFFER_SIZE 2048
#define BLUEPILL_UART_EVENT_QUEUE_SIZE 32
#define BLUEPILL_UART_BAUDRATE 460800
#define BLUEPILL_UART_TASK_STACK_SIZE 2048
#define BLUEPILL_UART_TASK_PRIORITY 12
#define BLUEPILL_PARSER_RING_BUFFER_SIZE 2048
#define BLUEPILL_PARSER_TASK_STACK_SIZE (BLUEPILL_PARSER_RING_BUFFER_SIZE*2)
#define BLUEPILL_PARSER_TASK_PRIORITY configMAX_PRIORITIES
#define BLUEPILL_PARSER_RUNTIME_BUFFER_SIZE (BLUEPILL_PARSER_RING_BUFFER_SIZE / 2)
#define BLUEPILL_EVENT_LOOP_QUEUE_SIZE (32)


/**
* @brief Default configuration for bluepill Parser
*
*/
#define BLUEPILL_UART_CONFIG_DEFAULT() \
{ \
.uart = { \
.uart_port = BLUEPILL_UART_PORT, \
.rx_pin = BLUEPILL_UART_RXD_PIN, \
.tx_pin = BLUEPILL_UART_TXD_PIN, \
.baud_rate = BLUEPILL_UART_BAUDRATE, \
.data_bits = UART_DATA_8_BITS, \
.stop_bits = UART_STOP_BITS_1, \
.parity = UART_PARITY_DISABLE, \
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE, \
.source_clk = UART_SCLK_APB, \
.event_queue_size = BLUEPILL_UART_EVENT_QUEUE_SIZE, \
.rx_buffer_size = BLUEPILL_UART_RX_BUFFER_SIZE, \
.tx_buffer_size = BLUEPILL_UART_TX_BUFFER_SIZE, \
.rts_io_num = UART_PIN_NO_CHANGE, \
.cts_io_num = UART_PIN_NO_CHANGE, \
} \
}


Thanks

cupracing
Posts: 3
Joined: Wed Jun 08, 2022 6:28 am

Re: UART "Pattern Queue Size too small"

Postby cupracing » Sun Aug 07, 2022 7:25 am

I have a similar issue reading the data from an accelerometer. I try to change baud, buffer and do it with a separate task but nothing. Following that post for solutions

Zoptune
Posts: 18
Joined: Mon May 27, 2019 11:02 pm

Re: UART "Pattern Queue Size too small"

Postby Zoptune » Thu Aug 11, 2022 2:11 pm

Hi,

If this log message is correct, the software is using UART pattern detection (check esp-idf UART documentation for details).
And this message is saying that the queue for pattern detection is to small so you have to find where this value is defined and increase it.

The function used to set the pattern detection queue size is

Code: Select all

uart_pattern_queue_reset(uart_port_t uart_num, int queue_length)
with the first parameter being the UART port number and the second is the queue size.
Search for this function, find where is defined the value for the second parameter and increase it.

Who is online

Users browsing this forum: No registered users and 80 guests