Closed
Description
Serial settings with two stop bits do not work properly with UART RX.
Is it possible to modify uartBegin in esp32-hal-uart.c to include the new workaround for two stop bits in the latest IDF, something like this.
324 uartFlush(uart);
325 uartSetBaudRate(uart, baudrate);
326 UART_MUTEX_LOCK();
327
328 uart->dev->conf0.val = config;
329
330 //begin mod ****************************************************
331 // workaround for two stop bits hardware issue
332 // if 2 stop bits, set conf0.stop_bit_num to 1 and set conf delay 1 bit
333 // see https://github.com/espressif/esp-idf/blob/master/components/driver/uart.c lines 118-127
334
335 if ( uart->dev->conf0.stop_bit_num == TWO_STOP_BITS_CONF) {
336 uart->dev->conf0.stop_bit_num = ONE_STOP_BITS_CONF;
337 uart->dev->rs485_conf.dl1_en = 1;
338 }
339
340 //end mod ****************************************************
341
342 UART_MUTEX_UNLOCK();
Metadata
Metadata
Assignees
Labels
No labels