arduino / arduino/ArduinoCore-sam

Unexpected extra characters appeared in the IDE Serial Monitor when write to Serial in loop()

Open
#146 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

```C++
void setup() {
Serial.begin(9600);
Serial.setTimeout(65535);
}
void loop() {
Serial.println("Snapshot");
char C;
Serial.readBytes(&C,1);
}
```
Upload this sketch in Arduino IDE and open the Serial Monitor. There is a certain probability that unexpected random characters will be generated before normal output.
![image](https://github.com/arduino/ArduinoCore-sam/assets/33191697/88067993-6a56-4414-a501-9a402e59623b)
This is not likely an IDE problem because the same code uploaded to Mega2560 does not have this problem.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by uploading the provided C++ sketch and observing the Arduino IDE Serial Monitor on the affected ArduinoCore-sam board, then compare its behavior with the Mega2560 result described in the issue. Trace the setup(), loop(), Serial.println(), and Serial.readBytes() calls to identify the source of the unexpected characters; done means normal output is produced without random characters.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.