Why does the ESP32-PICO-D4's UART Port U2TXD/ U2RXD disrupt the Bluetooth communication?

Ifthekhar
Posts: 13
Joined: Mon Mar 29, 2021 1:10 pm

Why does the ESP32-PICO-D4's UART Port U2TXD/ U2RXD disrupt the Bluetooth communication?

Postby Ifthekhar » Tue Oct 18, 2022 8:19 am

Hello,
In one of my prototype designs, I used the ESP32-WROOM-32D's U2TXD/U2RXD serial port to communicate with another MCU and the U0TXD/U0RXD pins to program it with an FTDI board and read serial data over UART (Arduino IDE, Serial Monitor). I also used the Bluetooth communication to send some data to my PC. It worked very well. But now I want to use the ESP32-PICO-D4 in my final design. I also have a development board (ESP32-PICO-KIT) for it and I have tested the same code with PICO. The problem is that my PC can no longer discover the Bluetooth connection. If I, however, comment the declaration of the U2TXD/U2RXD serial port (line 7 of the code), my PC can detect the Bluetooth device. Any idea why it is behaving like that and how to fix it?

Thanks

My code (Arduino IDE):

Code: Select all

#define RXD2 16  // UART2 of ESP32
#define TXD2 17  // UART2 of ESP32

#include "BluetoothSerial.h"
 
BluetoothSerial SerialBT;

void setup() {
  Serial.begin(115200); // Print over UART
  Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2);  //Serial2.begin(baud-rate, protocol, RX pin, TX pin); From the PIC MCU
  SerialBT.begin("AAAA");
}

void loop() {
  //while (Serial2.available()) {

    char sensor_data= Serial2.read();
    Serial.print(sensor_data);
    SerialBT.print(sensor_data);
  }
}

ESP_LJH
Posts: 387
Joined: Tue May 18, 2021 9:21 am

Re: Why does the ESP32-PICO-D4's UART Port U2TXD/ U2RXD disrupt the Bluetooth communication?

Postby ESP_LJH » Wed Oct 19, 2022 1:03 pm

Becasue PICO has different connections of flash, GPIO16 and GPIO17 are used to connect flash. SD_DATA2 and SD_DATA3 are available instead.

Who is online

Users browsing this forum: No registered users and 149 guests