Hi,
this is my first posting here in recent years. Last time i was active was when helping resolve issues with automatic resets bricking arduino UNOs (fixed by adding a diode from RESET and Vcc).
i'm now working on an arduino nano application that requires increasing the serial buffer size in HardwareSerial.h from 64 bytes to 1024 bytes. there is no other solution - trust me! i have found out how to do this, but it is a process that involved delving into the inner workings of the IDE's libraries, something that i see as worthy of avoiding if at all possible. i want others to be able to recompile my code without needing to perform such surgery.
it strikes me that it would be a useful addition if the IDE was able to make this adjustment to the serial buffer size as a selectable menu item.
one simple implementation would be for HardwareSerial.h to #include a secondary header file that either (a) is empty (or doesn't exist), or (b) contains overrides for the default buffer size constants. the IDE would then be able to simply place override values in this file, without it needing to edit HardwareSerial.h
one suitable location for override files would be in a sub-directory off the one containing HardwareSerial.h called "overrides" that could contain the required override files for all the different hardware serial variations, as well as override files for any other items required.
does this sound like a useful and/or doable thing?
cheers,
rob 
I would take some convincing that there is a need to increase the buffer size, and especially to 1024 bytes.
Why won't the standard buffer work and how have you tried to make it work?
...R
my application allows an arduino to act as an ICSP for microchip PIC32 processors. the official ICSP, the PICKIT3 costs us$50 from microchip, and us$20 or more for a clone. this compares to approximately us$3 for an arduino nano clone from ebay china. in addition to the nano, the only other components are 5 resistors and a 3v3 zener diode.
quite a bit of data needs to be exchanged when programming a PIC32 - writing the entire the 256k of flash on a PIC32MX170 involves sending around 3 million single-character commands to the arduino, with about 500,000 single-character responses. i'm doing this all through the serial port running at 500,000 baud. which leads into the problem...
the default serial buffer size defined in HardwareSerial.h requires me to generate handshake signals ever 64 characters or less to prevent buffer overruns. adding in the handshaking creates a considerable time overhead due to the limitations on USB transaction volumes (maximum of 1000 transactions per second).
with a 64 byte (default buffer), the programming time is a little over 4 minutes.
with a 512 or 1024 byte buffer, the programming time is 2 minutes 10 seconds.
with a 64 byte buffer, the bottleneck becomes the USB transaction volume limit - 1000 per second. this can not be changed without reinventing the USB standard. with an increase in buffer size, the bottleneck moves to becoming the speed of the arduino nano, something i am still working on improving.
cheers,
rob 
How about loading them from SD card instead?
I made a card to load sketches from SD card, Nick Gammon wrote the code, no USB needed.
These are 5V only, I have new boards that will do 5V or 3.3V and layout the buttons a little more conveniently.
Can be made No display (only loads 1 file from SD card), One display (load 1 of 16 files, press button to select one), or Two display (load 1 of 256 files., use rotary encoder to select one)
I haven't assembled any new ones yet as there has been no requests for either of these outside of the fellow who asked me for these originally, and bought 6 or 7 of them for field programming of boards in the field.
http://www.crossroadsfencing.com/BobuinoRev17/
[quote author=robert rozee date=1433730893 link=msg=2266910]
with a 64 byte (default buffer), the programming time is a little over 4 minutes.
with a 512 or 1024 byte buffer, the programming time is 2 minutes 10 seconds.[/quote]
You can read far more than 64 bytes and save them into a byte array without changing the serial buffer size.
See serial input basics. It has a 32 byte array but that can easily be increased by changing the constant numChars
If you have room for a 1024 byte array you could have one.
...R
given the speed at which data is arriving - 50,000 cps in blocks of up to 1000 - it is not practical to buffer the data outside of an ISR without risk of losing data. i have conducted tests, and confirmed this; without handshaking data is lost, with handshaking overall performance is significantly impacted.
bear in mind that my application is secondary, i am more interested in feedback on the method of increasing the buffer size. i presume the size is hard coded for good reason, likely speed performance, and my suggestion does not break that. it just provides a tidy way for the IDE to change the hard coded values safely for those users who need this ability.
cheers,
rob 
[quote author=robert rozee date=1433804234 link=msg=2268289]i have conducted tests, and confirmed this; without handshaking data is lost, with handshaking overall performance is significantly impacted.
[/quote]
I will try to do some tests myself later today.
...R