So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By ElQuestion
#88288 Hello together,

i am using an ESP8266 and what i want to calculate a checksum or hash value over all available memory. I tried to solve this problem but had problems to do so. Therefor i hope i can get here some help or tips how to solve my problem. In the following i present what i tried so far myself.

First of all, i tried to understand what memory is available using an ESP8266. When i get it right the ESP8266 has a flash and ram memory. The differnece between them is, that the flash memory is non-volatie. So i started to find out how i can access and read the flash memory and ended up with the following sketch.

Code: Select all#include <Arduino.h>
#include <EEPROM.h>

#define EEPROM_SIZE 512

void setup() {
  Serial.begin(9600);
  EEPROM.begin(EEPROM_SIZE);
}

int i = 0;

void loop() {
  Serial.print(i);
  Serial.print(": ");
  Serial.println(EEPROM.read(i),DEC);

  i++;
  if(i>511){i=0;}

  //Serial.println(hash);
}


The script is running on my ESP8266 and should loop over the complete flash memory (?). Strangely it prints 255 for each address, which suprises me, that the flash memory only contains 1. Therefor i think there must be a mistake in the script somewhere...


Next i tried to access the RAM and to read it. Therefor i couldn't find any information.

I hope i posted my question using the right topic, that i described my attempts right and that the questions aren't too trivial.

Thanks everyone in advance for reading my questions.