Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By treii28
#70014 Are there samples of any code anywhere where you can actually ask the device itself for it's current memory profile? i.e. use a generic setting appropriate to your device then run code to actually test the memory?
User avatar
By martinayotte
#70019 What is exactly the question ?
Do you wish to know the Flash size and SPIFFS size at run time ?
Code: Select all  str = "FlashID : ";
  str += String(ESP.getFlashChipId(), HEX);
  str += "\r\nFlashSizeByChipId : ";
  str += ESP.getFlashChipSizeByChipId();
  str += "\r\nFlashChipSize : ";
  str += ESP.getFlashChipSize();
  str += "\r\nSPIFFS Size : ";
  str += ((uint32_t) (&_SPIFFS_end) - (uint32_t) (&_SPIFFS_start));
  str += "\r\nMagic : ";
  uint32_t data;
  uint8_t * bytes = (uint8_t *) &data;
  // read first 4 byte (magic byte + flash config)
  spi_flash_read(0x0000, &data, 4);
  str += ((bytes[3] & 0xf0) >> 4);
  FSInfo fsInfo;
  SPIFFS.info(fsInfo);
  str += "\r\nFS Bytes: ";
  str += fsInfo.usedBytes;
  str += " / ";
  str += fsInfo.totalBytes;
  str += "\r\n";
  Serial.println(str);