BlueTooth kills UART2

ThomasK
Posts: 25
Joined: Wed Mar 20, 2019 2:33 am

BlueTooth kills UART2

Postby ThomasK » Mon Feb 20, 2023 3:44 pm

Hello,
I have a problem - Chip is ESP32-PICO-V3 (revision 3):
When I use UART2 it only works when Bluetooth is not active. When BT is activated, no more data comes via UART2.
Communication runs normally via UART0. I used Serial. and Serial2.
I need to realize the following:
- Communication "CONSOLE" can work
- Communication "IRDA" must work
"CONSOLE" is the "Serial" function which runs over UART0 by default. "IRDA" is the "Serial2" function over UART2

I also tried the following to swap the two UART functions:
#include <HardwareSerial.h>

#if IRDA_NR == 0
HardwareSerial CONSOLE(2);
HardwareSerial IRDA(0);
#endif
#if IRDA_NR == 2
HardwareSerial CONSOLE(0);
HardwareSerial IRDA(2);
#endif

void setup()
{
CONSOLE.begin(115200,SERIAL_8N1,RXD0,TXD0);
IRDA.begin(115200,SERIAL_8N1,RXD2,TXD2);
....
This works in principle, but as soon as BT is activated, IRDA no longer runs, regardless of whether IRDA_NR == 0 or IRDA_NR == 2 is set.
What is wrong? Is there a better suggestion? :?

The following thoughts: Only data from the ESP is output via the CONSOLE. IRDA has sending and receiving. It may also be independent of the UART no. and only the reception is disturbed by BT. Is it possibly an improper (double) use of interrupts for both functions? :roll:

Best regards
Thomas

sgiba73
Posts: 3
Joined: Sat Mar 04, 2023 11:15 am

Re: BlueTooth kills UART2

Postby sgiba73 » Sat Mar 04, 2023 12:01 pm

Hi Thomas,

having exactly the same problem.
Did you figure out how to fix ?


Best Regards,
Giuseppe

sgiba73
Posts: 3
Joined: Sat Mar 04, 2023 11:15 am

Re: BlueTooth kills UART2

Postby sgiba73 » Tue Mar 07, 2023 4:41 pm

I tested today a connection to an iPhone14 and a Samsung S10+ and works without problems.
But if I connect to Windows10, I have the problem as described.

Best regards,
Giuseppe

Who is online

Users browsing this forum: No registered users and 81 guests