Advertisement
Krzyspx

d1mini_1

Nov 27th, 2016
5,808
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement