Getting extra byte 0xFF while configuring UART

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Getting extra byte 0xFF while configuring UART

Postby Ritesh » Tue Jul 11, 2017 12:48 pm

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.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Getting extra byte 0xFF while configuring UART

Postby Ritesh » Tue Jul 11, 2017 1:43 pm

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.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Getting extra byte 0xFF while configuring UART

Postby Ritesh » Tue Jul 11, 2017 4:24 pm

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.
Regards,
Ritesh Prajapati

jakkra
Posts: 7
Joined: Mon Sep 11, 2017 12:49 pm

Re: Getting extra byte 0xFF while configuring UART

Postby jakkra » Mon Sep 11, 2017 12:51 pm

I'm having the same problem, did you find a fix?

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Getting extra byte 0xFF while configuring UART

Postby Ritesh » Tue Sep 12, 2017 3:32 am

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.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Getting extra byte 0xFF while configuring UART

Postby Ritesh » Tue Sep 12, 2017 3:43 am

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.
Regards,
Ritesh Prajapati

jakkra
Posts: 7
Joined: Mon Sep 11, 2017 12:49 pm

Re: Getting extra byte 0xFF while configuring UART

Postby jakkra » Tue Sep 12, 2017 6:51 am

Ritesh wrote: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 :)

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Getting extra byte 0xFF while configuring UART

Postby Ritesh » Tue Sep 12, 2017 8:44 am

jakkra wrote:
Ritesh wrote: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.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: No registered users and 115 guests