Due UART read buffer length

For the Due, how long is the receive buffer that can be read with Serial.readString() command?

I believe the buffer length for the Uno is 64 bytes.

Due has 128byte buffers for HardwareSerial.
I don't believe that Serial.readString() is limited to that size on any of the platforms...

Can the buffer length be increased? The below link suggests that it can by changing a value in code:


This post describes changing the buffer length by changing a parameter value in the HardwareSerial.h file on Windows machines. However, it seems that the HardwareSerial.h file cannot be located on a Mac machine (which I am using). The below link seems to have found the appropriate file on a Mac machine, but I think it is dubious.

How do I change the serial buffer length for the Arduino IDE that is running on a Mac?

Can the buffer length be increased?

You can surely change it in the source code (https://github.com/arduino/ArduinoCore-sam/blob/master/cores/arduino/RingBuffer.h); I don't think there is an "easy" way to change it.

AFAIK from the readString() code, it's only limited by memory size and/or bugs in the String library. The Ringbuffer patch changes how much data can be received without the user code doing anything, and the usual advice is "reading from Serial more often is preferable to increasing buffer size." (still true if you use char arrays rather than String for user-level buffering.)