Summary:
I expect the Hardware Serial TX buffer to not fill up but it does. I expect that as bytes are sent out the TX line the buffer would return to full size, 128.
Details:
I am trying to write a Hardwareserial loop back test.
Not only do I want to test TX to RX but also RTS to CTS, the flow control.
Problem, When I enable hardware flow control I find that I can only send a total of 128 characters and then the MySerial1.write(testString, dataLength); command fails to return and hangs my program.
Here is the serial monitor report where you can see the decreasing space in the serial buffer report from this code
Serial.print("Serial available for write ");
Serial.println(MySerial1.availableForWrite());
From Serial Monitor
ESP32 UART1 Flow Control Loopback Test
SerialLoopBackTest V0.0.1
Compiled at: Jan 2 2026 19:36:45
UART1 initialized with Hardware Flow Control.
Ensure GPIO 15 (RX1) is connected to GPIO 2 (TX1)
and GPIO 32 (RTS1) is connected to GPIO 33 (CTS1).
__*******************___
Serial available for write 128
Sending data: Hello, flow control loopback test data!
Data sent.
Received data: �
CTS pin state: 0
RTS pin state: 0
---
Serial available for write 89
Sending data: Hello, flow control loopback test data!
Data sent.
CTS pin state: 0
RTS pin state: 0
---
Serial available for write 50
Sending data: Hello, flow control loopback test data!
Data sent.
CTS pin state: 0
RTS pin state: 0
---
Serial available for write 11
Sending data: Hello, flow control loopback test data!



