Skip to content

Commit

Permalink
[Flash info] Detailed flash information (#678)
Browse files Browse the repository at this point in the history
Last few days a number of issues and forum topic was about the type of flash used on the ESP boards.

This is an extension of the detailed information page.

Perhaps also merge with the newer and more clear layout of pull request #624?
That pull request was only merged to the mega branch.
I kept the changes local, but perhaps they should be placed in the "Storage" section introduced with #624.
Maybe also that pull request should get merged into the v2.0 branch.
  • Loading branch information
TD-er authored and psy0rz committed Jan 9, 2018
1 parent c1a11ff commit 9dc549e
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion src/WebServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3992,8 +3992,49 @@ void handle_sysinfo() {
reply += F("<TR><TD>ESP Chip ID:<TD>");
reply += ESP.getChipId();

reply += F("<TR><TD>ESP Chip Freq:<TD>");
reply += ESP.getCpuFreqMHz();
reply += F(" MHz");

reply += F("<TR><TD>Flash Chip ID:<TD>");
reply += ESP.getFlashChipId();
uint32_t flashChipId = ESP.getFlashChipId();
// Set to HEX may be something like 0x1640E0.
// Where manufacturer is 0xE0 and device is 0x4016.
reply += F("Vendor: 0x");
String flashVendor(flashChipId & 0xFF, HEX);
flashVendor.toUpperCase();
reply += flashVendor;
reply += F(" Device: 0x");
uint32_t flashDevice = (flashChipId & 0xFF00) | ((flashChipId >> 16) & 0xFF);
String flashDeviceString(flashDevice, HEX);
flashDeviceString.toUpperCase();
reply += flashDeviceString;
uint32_t realSize = ESP.getFlashChipRealSize();
uint32_t ideSize = ESP.getFlashChipSize();

reply += F("<TR><TD>Flash Chip Real Size:<TD>");
reply += realSize / 1024;
reply += F(" kB");

reply += F("<TR><TD>Flash IDE Size:<TD>");
reply += ideSize / 1024;
reply += F(" kB");

reply += F("<TR><TD>Flash IDE speed:<TD>");
reply += ESP.getFlashChipSpeed() / 1000000;
reply += F(" MHz");

FlashMode_t ideMode = ESP.getFlashChipMode();
reply += F("<TR><TD>Flash IDE mode:<TD>");
switch (ideMode) {
case FM_QIO: reply += F("QIO"); break;
case FM_QOUT: reply += F("QOUT"); break;
case FM_DIO: reply += F("DIO"); break;
case FM_DOUT: reply += F("DOUT"); break;
default:
reply += F("Unknown"); break;
}


reply += F("</table></form>");
addFooter(reply);
Expand Down

0 comments on commit 9dc549e

Please sign in to comment.