title: Arduino String not working inside FreeRTOS Task
body: <p>I am trying to read Serial data on Arduino Mega 2560 using built in String object but its not printing the Serial data when used inside a FreeRTOS task like following code</p>
  
  <pre><code>void TaskSerialIn(void *pvParameters)
  {
      String json;
  
      for(;;) {
          while(Serial.available()) {
              json = Serial.readStringUntil('\n');
              Serial.println(json); // this code not printing anything
          }
  
          vTaskDelay(200 / portTICK_PERIOD_MS);
      }
  }
  </code></pre>
  
  <p>It doesn't work even if I declare the String as global variable.
  Whereas the following code works when character array is used to store the bytes</p>
  
  <pre><code>char serialJson[65];
  
  void TaskSerialIn(void *pvParameters)
  {
      char * jsonStr;
      int i = 0;
  
      for(;;) {
          i = 0;
  
          while(Serial.available()) {
              char inChar = (char) Serial.read();
              serialJson[i++] = inChar;
              if(inChar == '\n') {
                  serialJson[i] = '\0';
                  Serial.print(serialJson);
              }
          }
  
          vTaskDelay(200 / portTICK_PERIOD_MS);
      }
  }
  </code></pre>
  
  <p>Any help would be appreciated on how could I use String to read the Serial data.</p>