UART1 TX pin not sending proper data

GaneshPodPoint
Posts: 12
Joined: Thu Oct 24, 2019 12:37 pm

UART1 TX pin not sending proper data

Postby GaneshPodPoint » Mon Jun 08, 2020 12:04 pm

We have a unit in our client side and we have unusual behaviour in UART1. After debugging remotely, i found that TX pin is not sending the data properly. The pin for UART1 that i am using is

#define UART1_RX_PIN GPIO_NUM_22
#define UART1_TX_PIN GPIO_NUM_23

I did a soft reboot in ESP32 but did not recover.

Iam using ESP IDF v 3.1

Could any one tell us that what could be the reason that it did not recover after soft reboot?

Thanks
Ganesh

ESP_Sprite
Posts: 9600
Joined: Thu Nov 26, 2015 4:08 am

Re: UART1 TX pin not sending proper data

Postby ESP_Sprite » Mon Jun 08, 2020 1:28 pm

Hard to say... did a hard reboot solve it? Do you have any idea what caused the problem in the first place?

GaneshPodPoint
Posts: 12
Joined: Thu Oct 24, 2019 12:37 pm

Re: UART1 TX pin not sending proper data

Postby GaneshPodPoint » Mon Jun 08, 2020 1:34 pm

We have two RFID reader attached to UART1 and UART2. We have signal interference in the board. After hard reboot i see the proper communication but still we have RFID signal interference.

Is RFID signal can create the problem in UART communication? Do we need any resistor or any capacitor to add between RX and TX?

Thanks
Ganesh

ESP_Sprite
Posts: 9600
Joined: Thu Nov 26, 2015 4:08 am

Re: UART1 TX pin not sending proper data

Postby ESP_Sprite » Mon Jun 08, 2020 2:48 pm

Hmm, sounds like some weird latchup issue then...

Wrt RFID interference: Hard to say, it depends on a lot of things: the layout of your board, power supply decoupling, wiring, ... It probably helps a bit if you can attach a scope to the Rx/Tx lines and see if there's any interference there.

GaneshPodPoint
Posts: 12
Joined: Thu Oct 24, 2019 12:37 pm

Re: UART1 TX pin not sending proper data

Postby GaneshPodPoint » Mon Jun 08, 2020 3:42 pm

Thanks for your response, We cannot take the scope from RX/TX as the product is in customer side. We will provide you if we have chance to capture the RX/TX line in scope.

Thanks for your help.

GaneshPodPoint
Posts: 12
Joined: Thu Oct 24, 2019 12:37 pm

Re: UART1 TX pin not sending proper data

Postby GaneshPodPoint » Mon Jun 08, 2020 4:01 pm

By the way, Did we have any issue reported by other people regarding UART RX/TX?

Some of them are reporting in https://github.com/espressif/esp-idf/issues/2614

Could that be related.

GaneshPodPoint
Posts: 12
Joined: Thu Oct 24, 2019 12:37 pm

Re: UART1 TX pin not sending proper data

Postby GaneshPodPoint » Mon Jun 08, 2020 8:18 pm

Hi there, i read some that we need to add

Code: Select all

//esp_restart_noos
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_TIMERS_RST | DPORT_SPI01_RST | DPORT_UART_RST | DPORT_UART1_RST | DPORT_UART2_RST | DPORT_UART_MEM_RST);
but when i look at the SDK there is no
DPORT_UART_MEM_RST
Do we need to add "DPORT_UART_MEM_RST"

It is in link
https://github.com/espressif/esp-idf/issues/1202

GaneshPodPoint
Posts: 12
Joined: Thu Oct 24, 2019 12:37 pm

Re: UART1 TX pin not sending proper data

Postby GaneshPodPoint » Tue Jun 16, 2020 7:53 am

We found the same issue in another board as well. At the moment we do not have log print but from the oscilloscope we can see that the yellow line is TX from ESP32 and it is sending some garbage data.

I have seen in the code that there is reset for RX fifo but i don't see any reset for TX fifo in ESP IDF v3.1.

Could you please how to reset the TX fifo. I believe it is something not right in TX.

Thanks
Ganesh
Attachments
Screenshot_2020-06-15-17-59-24.png
Screenshot_2020-06-15-17-59-24.png (62.34 KiB) Viewed 7573 times

GaneshPodPoint
Posts: 12
Joined: Thu Oct 24, 2019 12:37 pm

Re: UART1 TX pin not sending proper data

Postby GaneshPodPoint » Wed Jun 17, 2020 5:31 pm

Hi there,
Can someone help me why the TX data is sending the wrong frame data.

After more debugging i found very wired data coming out from the esp32 Tx.
Correct data should be

Code: Select all

"021a00444e010100130022030002000032e803000302000032d0070003bced"

but it sends out

Code: Select all

"0302000032d0070003bced021a00444e010100130022030002000032e80300"
It is just looping around the data.

I need to reset the TX fifo. Can anyone help me how to reset the TX fifo in esp idf 3.1

Thanks
Ganesh
Attachments
image (3).png
image (3).png (350.82 KiB) Viewed 7488 times

Who is online

Users browsing this forum: No registered users and 77 guests