I had the same result that you, I just searched for the references of Hardware.h and the only one that I found is in the RingBuffer. The definition for the Serial_Buffer_Size is in the RingBuffer.h. I found this link explaining how to change the size of the buffer, you could try that if you haven't yet.
Now, I'm not sure if the 5000 is going to work. Were you able to set the size of the serial buffer in the Arduino higher than 256?
Thanks. I had modified the Serial_Buffer_Size definition to a higher value, but it didn't have an apparent effect. I'll attempt to modify my DUE and see if I can get that to work.
Do you still have questions related to this post? If you don’t have any questions please mark assumed or correct answer.
I was able to solve my particular issue another way, but unable to change the buffer size.