arduino / arduino/ArduinoCore-sam

Serial3.setTimeout(...) is not expiring with the rx line always idle.

Open
#119 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
91
Forks
112
PR merge metrics
No merged PRs in 30d

Description

The following code never ends (it loops inside the " Serial3.readString() " ** when and only when the rx line is always HIGH** ('1' logic):

```
String rxReply;

Serial3.begin(1200, SERIAL_8N1);

while(!Serial3);

Serial3.setTimeout(200); // 200 is just an example and if you print Serial3.getTimeout() you'll get the right result

rxReply = Serial3.readString();

// When the rx line stays high ('1' logic) the execution never arrives here, as if the 200ms time-out never expired
// Conversely the code is properly executed when the rx line is low ('0' logic)

Serial.print(rxReply);
```

Could you take a look at this anomalous behaviour?

Thanks

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the provided Serial3 example on Arduino SAM hardware with the RX line held HIGH, then compare it with the LOW case. Inspect the implementation behind Serial3.readString() and setTimeout(); done means readString() returns after the configured 200 ms timeout in both conditions.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.