Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Serial locks up when no Serial.read() ?

  1. #1
    Senior Member Jp3141's Avatar
    Join Date
    Nov 2012
    Posts
    461

    Serial locks up when no Serial.read() ?

    Simple program outputting some characters. If I type into the serial port (either with Serial Monitor or Coolterm), it frequently hangs when the buffer contains ~30 characters -- not always, but maybe when I cross a 30 (32 ?) threshold within one loop.

    Code:
    void setup() {Serial.begin(9600);}
    
    int i=0;
    void loop() {
     //Serial.println(i++);
     Serial.println(Serial.available());
     //while (Serial.available()) Serial.read();
     delay(100);
    }
    when I enable the Serial.read(), it is 'better' but sometimes still fails.

    I this expected ? Even if I don't expect to receive characters in my program, should the Teensy lockup in this way ?

    Using Arduino 1.6.7 on OSX 10.9.5; Teensy 3.2

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,179
    ..i tried it, i can't see any fail or hang.

    Which OS you are using ? Is it a MAC ?

    edit: oops, you mentioned it.

    MAC has some problems. Its a Bug in the OS.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •