available() always returns zero after receiving 10 bytes on hardware serial ports

Status
Not open for further replies.

shawn

Well-known member
I'm encountering a strange problem. I have code on a Teensy 3.2 (Teensyduino 1.40, PlatformIO v2.8.0) that loops and listens to one of the hardware serial ports. My logic analyzer tells me that there's constantly serial data going into the serial pins. However, stream.available() always returns zero, after receiving 10 bytes.

I've tried Serial1 and Serial3 so far, but the result is the same: continuous serial data is definitely going in, but available() returns 0 after receiving only 10 bytes, until the next reset of the board.

I've checked that the code is indeed running inside loop() and is being continuously called to check available(). I'm stumped.

Does anyone have suggestions of things to look for? Maybe the thing I'm doing wrong is very simple...
 
We get questions like this all the time here. It almost always turns out to be something simple, sometimes the wrong name used in the code, sometimes a wiring problem, sometimes other stuff.

You need to show us the code and how you've really connected the wires, ideally photos.
 
Status
Not open for further replies.
Back
Top