Go Down

Topic: Arduino ZERO (SAMD21) SERIAL1 Buffer size (Read 94 times) previous topic - next topic



a short describtion of the project and problem:

I have an SAMD21 chip (Arduino Zero) which is connected over the normal "Serial" to the Arduino ISE on the PC by USB, and on the SERIAL1 there is a SIM868 connected (same as SIM800 just with GPS) over nomral UART RX/TX Baudrate 115200.

The problem is the RX Buffer on the Zero of the Serial1 is to small, looks like it is only 64 bytes.

In my project the Zero is in sleep_mode and before it can wake up the RX Buffer is already full and I am loosing data coming from the SIM868.

SO I would like to change the SERIAL1 RX Buffer size.....  I already found a Serial_Buffer_size which is 64 in the Ringbuffer.ccp/.h  .... already changed this in my code to


and also call it back for a checkup

Serial.println(SERIAL_BUFFER_SIZE);   ==> so here it shows 256

But nothing changed for SERIAL1 ,...the RX buffer SIZE of SERIAL1 is still 64 bytes..... so there must be another variable to change ....

Please help ....

Some background , Serial1 is already defined default in the variants.cp /.h for the zero .... didn´t make any changes here.

So it would be perfect if you can tell me the file.... or variable i have to change so the Serial1 RX Buffer becomes bigger than 64 bytes.

Best regards,



changed this in my code to
WHERE did you put that #define?   Adding it to your .ino file won't have any effect on the uart library; you have to change it IN RingBuffer.h for it to have any effect.  (not designed very well, IMO.)


Hey , thanks ....

So first I just put the     #define SERIAL_BUFFER_SIZE 256

in the .ino file before the setup.

And also during the setup I used Serial.println(SERIAL_BUFFER_SIZE);   ==> so here it shows 256

But I also tried to change the SERIAL_BUFFER_SIZE directly in the Ringbuffer.h / cpp .... but nothing changed for SERIAL1

That´s why I think there will be another "SERIAL_BUFFER_SIZE" variable for Serial1  ... and the SERIAL_BUFFER_SIZE variable in the Ringbuffer.h/cpp is maybe only for the normal "USB Serial".

So any idea where there might be another SERIAL_BUFFER_SIZE definition for SERIAL1 ... best regards

Go Up