Skip to content

Commit 5186a92

Browse files
committed
Merge pull request #872 from Links2004/example
add CheckFlashConfig.ino example
2 parents 0bd3b72 + 33c9d03 commit 5186a92

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
ESP8266 CheckFlashConfig by Markus Sattler
3+
4+
This sketch tests if the EEPROM settings of the IDE match to the Hardware
5+
6+
*/
7+
8+
void setup(void) {
9+
Serial.begin(115200);
10+
}
11+
12+
void loop() {
13+
14+
uint32_t realSize = ESP.getFlashChipRealSize();
15+
uint32_t ideSize = ESP.getFlashChipSize();
16+
FlashMode_t ideMode = ESP.getFlashChipMode();
17+
18+
Serial.printf("Flash real id: %08X\n", ESP.getFlashChipId());
19+
Serial.printf("Flash real size: %u\n\n", realSize);
20+
21+
Serial.printf("Flash ide size: %u\n", ideSize);
22+
Serial.printf("Flash ide speed: %u\n", ESP.getFlashChipSpeed());
23+
Serial.printf("Flash ide mode: %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT" : ideMode == FM_DIO ? "DIO" : ideMode == FM_DOUT ? "DOUT" : "UNKNOWN"));
24+
25+
if(ideSize != realSize) {
26+
Serial.println("Flash Chip configuration wrong!\n");
27+
} else {
28+
Serial.println("Flash Chip configuration ok.\n");
29+
}
30+
31+
delay(5000);
32+
}

0 commit comments

Comments
 (0)