A call to SerialUSB.println() [or print()] seems to hang if you pass a buffer with a string length greater than 247. Additionally, the characters past the 240 index seem to get messed up during transmission.
Here is some example code which demonstrates this:
void setup()
{
while(!SerialUSB);
char buffer1[512];
//Strangely the limit seems to be 247 characters?
//But it seems to start to fail after 240?
//This works
memset(buffer1, 'a', sizeof(buffer1));
buffer1[247] = 0;
SerialUSB.println("Attempting to print a 247 character buffer: ");
SerialUSB.println(buffer1);
//But this hangs
memset(buffer1, 'a', sizeof(buffer1));
buffer1[248] = 0;
SerialUSB.println("Attempting to print a 248 character buffer: ");
SerialUSB.println("Individual characters:");
for (int i=0; i<248; i++)
SerialUSB.print(buffer1[i]);
SerialUSB.println();
SerialUSB.println("In a single call to SerialUSB.println():");
SerialUSB.println(buffer1);
}
void loop()
{
}
maybe we get some "official" answer (regarding that issue) from the arduino-team sometime ...
I feel a slight decline in community support from the arduino side (regarding the ZERO) within the past weeks
and the documentation and libraries are obviously not up to date for the ZERO yet (?)
(even though the product has been announced for more than one year now...)