I use to MCU is esp32-wroom-32d.
Uart is CP2102N-A01-GQFN28
uart tx -> esp32 tx
uart rx -> esp32 rx
connected. how to solve or is it solve?
You can modify the PCB by carefully cutting the traces with a scalpel, and then use a fine wire make the correct connections.
On the ESP32, just about any GPIO pin can be assigned as serial RX and TX pins, for any of the serial UARTs. Try reassigning the pins.
Example code:
//Serial port echo program, DEV MODULE selected for ESP32-CAM
// works as expected with UART2, RX=14, TX=15
// same for UART1
#include <HardwareSerial.h>
HardwareSerial SerialPort(1); // use UART1
void setup()
{
Serial.begin(115200);
while (!Serial);
Serial.println("Serial test");
SerialPort.begin(115200, SERIAL_8N1, 14, 15);
}
void loop()
{
while (Serial.available()) {
SerialPort.write(Serial.read());
}
while (SerialPort.available()) {
Serial.write(SerialPort.read());
}
}
Good day.
this code is working but error occurred while loading code from Arduino ide.
esptool.py v3.0-dev
Serial port COM5
Connecting........_____....._____....._____....._____....._____....._____.....____An error occurred while uploading the sketch
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
i'm using
SerialPort.begin(115200, SERIAL_8N1, 1, 3);
If the code cannot be uploaded, how can it be "working"?
Solve the upload problem first.
ı am getting data from SerialPort.print()
Fascinating. What program do you think is "printing"?
First of all, I swap the places of tx and rx on my test card. I'm uploading and testing the code. I included the serial.print() print command in the code and sent it inside my esp32 and tested it. I'm sorry for my bad english
Is the problem solved?
NO. I got the tx and rx setup right and uploaded the code, then placed the pins properly as I specified in Hardwareserial.
In .Serialport.begin() I see that I am printing from the Serial menu.
I can't upload code from Arduino ide while plugged into hardwareserial pins
Use the hardware serial pins for uploading, and a different serial port for printing.
You need to put the bootloader into serial upload mode. Tie GPIO0 to GND while resetting the processor by EN shortly to GND.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.