change the serial buffer size from within a sketch?

I've once had to reduce buffers as it wouldn't fit in the 512 bytes of RAM of the ATtiny85 :slight_smile: But that was for I2C. Really didn't need that big a buffer for 2-4 byte communication.

I think you can actually do it by adding your own #define with those values. You can't change the buffers on the fly (that'd be very hard to pull off as you start messing with memory management) but at compile time it should work.

MartynC:
I have a sketch that receives up to 180 characters at a time and it choked around the 120/130 character mark. The sketch wasn't processing the data fast enough.

Then there's probably something wrong with your sketch, even at 921600 bps you have almost 11 µs (over 170 clock cycles) per character before the next comes in.