@biobier
Had another look and it seems that the while loop takes too long and the ESP is reset, probably due to the WDT.
Your sketch runs OK with the following changes:
- add Serial.begin to setup, otherwise the print statements will not be visible in the serial monitor
- add a yield() ( or delay(0) ) instruction in the while loop to give the ESP time to do other things
- I changed the increment of the while counter i
Here's the code that runs:
Code: Select allinclude <EEPROM.h>
void setup()
{
Serial.begin(115200);
EEPROM.begin(512);
// write a 0 to all 512 bytes of the EEPROM
int i=0;
byte data=0;
while(i<512){
EEPROM.put(i, data);
i++;
yield();
Serial.println(i);
}
// turn the LED on when we're done
Serial.println("Done!");
digitalWrite(13, HIGH);
EEPROM.end();
}
void loop()
{
}