-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider increasing serial receive buffer size #14
Comments
@kierdavis Where can I try putting this compile flag when building the arduino sketch? I think we have enough SRAM available. Right now about 75% of our team's time has probably been spent wrestling with the arduino (using it for GPIO) - it almost always falls over within a few minutes (BlockingIOError, connection never happens, CommandError showing commands which we never sent, various others) and we have to restart everything and try again. Any suggestions on how to improve the stability would be much appreciated. |
With my limited knowledge of C++, you should just be able to add |
Unfortunately it's not quite as simple as that. This constant needs to be defined when the arduino standard library is compiled, so you can't just put it in your own source file. The easiest way is to add |
We can do this in the board definition: http://www.hobbytronics.co.uk/arduino-serial-buffer-size |
If this buffer gets full then incoming bytes are discarded until space is free in the buffer again, which may account for some of our serial communication issues. The default size is a mere 16 bytes.
This can be implemented by adding a compiler flag. For example, to set the buffer size to 256 bytes, you can pass
-DSERIAL_RX_BUFFER_SIZE=256
.The reason why I'm holding off making the change right now is that we're currently very memory-hungry already and I get the impression that we're pushing the limits of the microcontroller's SRAM capacity. Increasing the amount of SRAM dedicated to the serial buffer will almost certainly worsen the situation, so we should fix those issues first (I'm slowly working out a good way to approach this).
The text was updated successfully, but these errors were encountered: