This seems like the right topic so here goes.
The below simple sketch:
// example/tutorial - https://www.georgevreilly.com/blog/2016/01/05/DecrementingLoops.html
uint32_t bigOne = 0x12345678;
byte pieces[4];
void setup() {
Serial.begin(115200);
memcpy(&pieces, &bigOne, 4); // 32-bit var moved to four consecutive byte array locations
for (int8_t i = 4; --i >= 0;){ // decrementing loop
Serial.print(pieces[i], 16);
Serial.print(" ");
}
Serial.println();
}
void loop() {
}
Produces this output upon upload (serial monitor already open):
If I clear the output window and press the reset on the controller board it prints a single line, as expected.
Why?
IDE v 1.8.13