Hi
I'm calling uart_param_config() like this:
uart_config_t uartConfig;
uartConfig.baud_rate = baudrate;
uartConfig.data_bits = UART_DATA_8_BITS;
uartConfig.parity = UART_PARITY_DISABLE;
uartConfig.stop_bits = UART_STOP_BITS_1;
uartConfig.flow_ctrl = UART_HW_FLOWCTRL_DISABLE;
uartConfig.rx_flow_ctrl_thresh = 1000/*bufferSize*/ *9/10;
uartConfig.use_ref_tick = false;
err = uart_param_config (UART_NUM_1, &uartConfig);
and I get this error:
E (3559) uart: uart_set_hw_flow_ctrl(276): rx flow thresh error
If I use a smaller buffer size like 100 it works ok.
Any ideas about this?
thanks
uart_param_config() returns an error
-
- Posts: 9723
- Joined: Thu Nov 26, 2015 4:08 am
Re: uart_param_config() returns an error
First of all, I don't think this field will have any effect with uartConfig.flow_ctrl set to UART_HW_FLOWCTRL_DISABLE. Secondly, this is a hardware feature and the threshold is measured against how full the UARTs hardware FIFO is; as such it cannot be set to a larger value than the amount of bytes available in that FIFO.
-
- Posts: 22
- Joined: Thu Jan 23, 2020 9:31 am
Re: uart_param_config() returns an error
Thanks and understood.
It seems that the routine checks the field rx_flow_ctrl_thresh even when flow_ctrl is set to UART_HW_FLOWCTRL_DISABLE!
And therefore generates the error.
It seems that the routine checks the field rx_flow_ctrl_thresh even when flow_ctrl is set to UART_HW_FLOWCTRL_DISABLE!
And therefore generates the error.
Re: uart_param_config() returns an error
yeah when filling out the structure like that, you need to explicitly set the thresh field to 0, otherwise it gets filled with stack garbage hence makes esp-idf throw an error.
Who is online
Users browsing this forum: No registered users and 135 guests