receive over serialUSB a string more than 191 chars causes a reset with core 2.0.0 and mapleMini
Posted: Sat May 29, 2021 2:08 pm
Hi,
I use the arduino IDE.
With core 1.9.0 and with Arduino nano I can easily receive over serialUSB a string with more then 200 chars
hier is a testsketch
This 191 char string ist ok
and this 192 char string causes a reset
I use the arduino IDE.
With core 1.9.0 and with Arduino nano I can easily receive over serialUSB a string with more then 200 chars
hier is a testsketch
Code: Select all
String cmdstring = "";
bool command_available=false;
void setup() {
cmdstring.reserve(600);
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB
}
}
void loop() {
if (command_available == true) {
command_available=false;
Serial.println(cmdstring.length());
Serial.println(cmdstring);
if (!command_available) {cmdstring = "";}
}
}
void serialEvent()
{
while (Serial.available())
{
char inChar = (char)Serial.read();
switch(inChar)
{
case '\n':
case '\r':
case '\0':
command_available=true;
break;
default:
cmdstring += inChar;
}
}
}
Code: Select all
123456789z123456789z223456789z323456789z423456789z523456789z623456789z723456789z823456789z923456789z023456789z123456789z223456789z323456789z423456789z523456789z623456789z723456789z823456789z9
Code: Select all
123456789z123456789z223456789z323456789z423456789z523456789z623456789z723456789z823456789z923456789z023456789z123456789z223456789z323456789z423456789z523456789z623456789z723456789z823456789z92