arduino / arduino/ArduinoCore-avr

loop/while/for problem

Open
#279 21 comments 0 reactions 0 assignees View on GitHub
Upstream notified
Dominant language
C
Stars
1.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

This example code does not print 0-127 as you would expect, it only prints 0. The thread that I've linked to below hints that it may be a 5.4.0 issue.

"With IDE 1.8.4 (avr-gcc 4.9.2) it works as expected. With IDE 1.8.8 (avr-gcc 5.4.0) it fails, prints 0, once. Must be another 5.4.0 bug. Use the 4.9.2 toolchain."

```
void setup() {
Serial.begin(115200);
}

void loop() {
while (1) {
for (byte i = 0 ; i < 128 ; i++) {
Serial.println(i);
}
}
}
```

https://forum.arduino.cc/index.php?topic=621017.0

Contributor guide

No contributing guide indexed for this repository

Research direction

Use the example code in the issue as the reproduction case and compare the AVR-GCC 4.9.2 and 5.4.0 toolchains referenced in the report. Read the linked Arduino forum thread for prior investigation; done means the behavior is reproduced and its cause or an agreed corrective path is established.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers, 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.