Sending serial data to Arduino seems to freeze it

In an effort to figure out what is wrong with a Matlab library designed to talk to a certain Arduino sketch, I have run into a problem that can be replicated with this code.

void setup() {
    Serial.begin(9600);
    Serial.println("Starting  . . .");
}

void loop() {
    delay(1000);
    Serial.println("test");
}

If I run this code on my Uno SMD R2, built with IDE 1.0.1 on OS X 10.9 Mavericks, any characters that I send in the serial monitor make the Arduino freeze, or at least that's what seems to happen.

What I would expect to see in the serial console:

Starting . . . 
test
test
test
<continuing forever>

But as soon as I send any character to the Arduino by typing in the box at the top of the serial monitor and clicking send, the word "test" stops appearing at 1-second intervals. I would expect it to just keep printing "test" forever.

Am I misunderstanding how the serial monitor works?

Thanks,
Brandon

Update: I am also able to replicate this with an Arduino Mega 2560. I also see a similar freeze when I run the SerialCallResponseASCII example and try sending data via the serial monitor. Additionally, it doesn't seem to be related to whether my host laptop is plugged into the wall or not.

Odd, as you are not even reading from the serial port.

Ugh. It appears that the problem goes away if I switch to my Linux desktop and the Arduino IDE 1.0 that I happened to have installed a while back. I'll try updating the IDE on my laptop to 1.0.5 and see if the problem goes away.

(Please, nobody waste time on this, as it looks like it is some wrinkle specific to OS X 10.9 and/or IDE 1.0.1. I'll try to narrow it down and post an update.)

Updating the Arduino IDE to 1.0.5 solved the problem, as well as the larger problems that I was having with my Matlab library.

Victory!

Brandon

(In the frozen land of Nador, they were forced to Robin's minstrals ...)

And there was much rejoicing.

Well, at least part of that applies :slight_smile: