receive over serialUSB a string more than 191 chars causes a reset with core 2.0.0 and mapleMini

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
Ralf9
Posts: 33
Joined: Sat Jan 11, 2020 7:21 pm
Answers: 1
Location: Germany, BaWü

receive over serialUSB a string more than 191 chars causes a reset with core 2.0.0 and mapleMini

Post by Ralf9 »

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

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;
      }
   }
}
This 191 char string ist ok

Code: Select all

123456789z123456789z223456789z323456789z423456789z523456789z623456789z723456789z823456789z923456789z023456789z123456789z223456789z323456789z423456789z523456789z623456789z723456789z823456789z9
and this 192 char string causes a reset

Code: Select all

123456789z123456789z223456789z323456789z423456789z523456789z623456789z723456789z823456789z923456789z023456789z123456789z223456789z323456789z423456789z523456789z623456789z723456789z823456789z92
User avatar
fpiSTM
Posts: 1745
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: receive over serialUSB a string more than 191 chars causes a reset with core 2.0.0 and mapleMini

Post by fpiSTM »

Hi, it is already reported:
https://github.com/stm32duino/Arduino_C ... ssues/1399

Since an HAL update there is a regression.
Ralf9
Posts: 33
Joined: Sat Jan 11, 2020 7:21 pm
Answers: 1
Location: Germany, BaWü

Re: receive over serialUSB a string more than 191 chars causes a reset with core 2.0.0 and mapleMini

Post by Ralf9 »

with this bug i can't use the core 2.0.0 in my project.

if I want use platformio, which release has not the serial big data bug? 7.0.0 or can I use a newer?
https://github.com/platformio/platform-ststm32/releases
Post Reply

Return to “General discussion”