arduino / arduino/ArduinoCore-avr
HardwareSerial reset crash / freeze
- Dominant language
- C
- Stars
- 1.5k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
CIao, I noticed a strange behaviour working with Serial. If a device restarts while other devices are transmitting data, can end up frozen (I am testing with UNO and Mega on 1.6.7):
TX:
```cpp
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println("I will now freeze you!");
};
```
RX:
```cpp
void loop() {
digitalWrite(13, HIGH); // Blink forever
delay(10);
digitalWrite(13, LOW);
delay(30);
};
```
in this code I have the RX making begin() and then blinking in the loop, if I reset randomly the RX through the button:
- often RX freezes with LED ON, seems before setup
- often RX freezes with LED OFF, seems after executing setup
- mostly I need to reset both at the same time to get back the receiver blinking
- oscilloscope shows TX data coming out so seems not freezed
- bug occurs with or without USB connected in RX or TX (so using other power supply)
Serial buffer overflow? Something connected to bootloader or because of serial incoming data in the process of boot after reset?
I have reported the bug in the italian forum: http://forum.arduino.cc/index.php?topic=460988.0
I am not the only one reporting this, here in russian: http://flprog.ru/forum/18-1803-2#20597
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the reset scenario with the provided UNO/Mega transmitter and receiver sketches, varying USB and power connections as described. Start by tracing HardwareSerial initialization and the bootloader path while incoming serial data is present; done means the receiver completes reset and resumes its LED blink reliably.
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
- Needs clarification
- Newbie friendliness
- 25/100