One last try. This time with serialEventRun(); which is about the only difference between setup() and loop() :
void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
while (!Serial)
{
; // Wait for serial to connect
}
delay(1000);
serialEventRun();
Serial.println("setup()");
serialEventRun();
}
void loop()
{
static uint32_t i = 0 ;
Serial.print("loop()"); // should start at 0
Serial.println( i++ ) ;
delay( 1000) ;
}