Page 2 of 2
Re: Getting extra byte 0xFF while configuring UART
Posted: Tue Jul 11, 2017 12:48 pm
by Ritesh
Hi,
Sorry for late post.
We have tried with uart_flush(uart_num) solution but it creates problem while re-configuring UART in existing running system like getting all bytes as garbage data while sending proper data.
So, It means that solution is not proper to consider for actual product.
Again, I have looked into ESP32-IDF UART Driver and found that issue I am getting exactly while configuring UART driver with "gpio_matrix_out(tx_io_num, tx_sig, 0, 0);" for TX Pin.
So, It means issue might be in configuring GPIO Matrix table and i have tried to go in details in that API but that is function of ROM and I didn't find any function definition for that.
Please let me know if anyone has fixed this issue from driver level which will be helpful for me as well.
Re: Getting extra byte 0xFF while configuring UART
Posted: Tue Jul 11, 2017 1:43 pm
by Ritesh
Hi,
Also the issue i am getting is random means sometimes I am getting garbage 0xFF as first byte randomly. So, The issue is in GPIO Matrix Output configurations which might cause this type of issue.
I have tried it with PULLUP and PULLDOWN configurations for that TX PIN but still issue remains same for that.
Re: Getting extra byte 0xFF while configuring UART
Posted: Tue Jul 11, 2017 4:24 pm
by Ritesh
Hi,
Please let me know if anyone has faced this type of issue while configuring UART with which another any module is connected over UART.
I have tried to look definition of "gpio_matrix_out(tx_io_num, tx_sig, 0, 0);" but not found it.
Re: Getting extra byte 0xFF while configuring UART
Posted: Mon Sep 11, 2017 12:51 pm
by jakkra
I'm having the same problem, did you find a fix?
Re: Getting extra byte 0xFF while configuring UART
Posted: Tue Sep 12, 2017 3:32 am
by Ritesh
Hi,
Yes. We have solved this issue with the help of Espressif System Developer.
Would you please let me know which ESP32-IDF RTOS SDK are you using for your development purpose? ESP32-IDF 2.0 or 2.1 or latest master branch?
The issue is in UART driver while configuring TX and RX Pins.
Re: Getting extra byte 0xFF while configuring UART
Posted: Tue Sep 12, 2017 3:43 am
by Ritesh
Hi,
Please include following solution into UART driver specific to uart_set_pin function to solve issue of extra byte 0xFF while configuring UART.
if(tx_io_num >= 0) {
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[tx_io_num], PIN_FUNC_GPIO); PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[tx_io_num], PIN_FUNC_GPIO);
gpio_set_level(tx_io_num, 1); /// for uart garbage issue solution this line added
gpio_set_direction(tx_io_num, GPIO_MODE_OUTPUT); gpio_set_direction(tx_io_num, GPIO_MODE_OUTPUT);
gpio_matrix_out(tx_io_num, tx_sig, 0, 0); gpio_matrix_out(tx_io_num, tx_sig, 0, 0);
}
Let me know if you still have any doubt for that.
Re: Getting extra byte 0xFF while configuring UART
Posted: Tue Sep 12, 2017 6:51 am
by jakkra
Hi,
Please include following solution into UART driver specific to uart_set_pin function to solve issue of extra byte 0xFF while configuring UART.
if(tx_io_num >= 0) {
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[tx_io_num], PIN_FUNC_GPIO); PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[tx_io_num], PIN_FUNC_GPIO);
gpio_set_level(tx_io_num, 1); /// for uart garbage issue solution this line added
gpio_set_direction(tx_io_num, GPIO_MODE_OUTPUT); gpio_set_direction(tx_io_num, GPIO_MODE_OUTPUT);
gpio_matrix_out(tx_io_num, tx_sig, 0, 0); gpio_matrix_out(tx_io_num, tx_sig, 0, 0);
}
Let me know if you still have any doubt for that.
Great, works like a charm! Thank you, was about to test that when I saw your answer

Re: Getting extra byte 0xFF while configuring UART
Posted: Tue Sep 12, 2017 8:44 am
by Ritesh
Hi,
Please include following solution into UART driver specific to uart_set_pin function to solve issue of extra byte 0xFF while configuring UART.
if(tx_io_num >= 0) {
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[tx_io_num], PIN_FUNC_GPIO); PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[tx_io_num], PIN_FUNC_GPIO);
gpio_set_level(tx_io_num, 1); /// for uart garbage issue solution this line added
gpio_set_direction(tx_io_num, GPIO_MODE_OUTPUT); gpio_set_direction(tx_io_num, GPIO_MODE_OUTPUT);
gpio_matrix_out(tx_io_num, tx_sig, 0, 0); gpio_matrix_out(tx_io_num, tx_sig, 0, 0);
}
Let me know if you still have any doubt for that.
Great, works like a charm! Thank you, was about to test that when I saw your answer

Good. Most Welcome.
Please let me know if you find any issue into ESP32 w.r.t. SDK or application development as we are right now working on ESP32 and validating different interface in parallel for newer ESP32 chip and module.