Available Memory and Memory Hash/Checksum
Posted: Wed Aug 12, 2020 10:48 am
Hello together,
i am using an ESP8266 and want to calculate a Checksum or Hash over all available memory. I tried to solve this problem myself but didn't manage to do so. Therefor i hope i can get here some help or tips. In the following i try to describe what i tried so far.
First of all i tried to understand what memory is available using an ESP8266. When i get it right, there is a RAM and Flash memory available. The difference between them is, that the Flash memory is no volatile. So i tried to access and read the Flash memory and ended up with the following sketch:
The sketch is running on my ESP8266 and should loop over the complet Flash memory (?). But strangely it prints always 255 for each address. That suprises me, why the Flash memory should only consists of 1s. Therefor i think, there must be an mistake somewhere....
Second i tried to access and read the RAM but could not find a way to do so.
I hope i posted my question using the right topic and described my tries correctly.
I also hope i can get some help here, and thanks for everybody in advance for reading my question.
i am using an ESP8266 and want to calculate a Checksum or Hash over all available memory. I tried to solve this problem myself but didn't manage to do so. Therefor i hope i can get here some help or tips. In the following i try to describe what i tried so far.
First of all i tried to understand what memory is available using an ESP8266. When i get it right, there is a RAM and Flash memory available. The difference between them is, that the Flash memory is no volatile. So i tried to 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;}
}
The sketch is running on my ESP8266 and should loop over the complet Flash memory (?). But strangely it prints always 255 for each address. That suprises me, why the Flash memory should only consists of 1s. Therefor i think, there must be an mistake somewhere....
Second i tried to access and read the RAM but could not find a way to do so.
I hope i posted my question using the right topic and described my tries correctly.
I also hope i can get some help here, and thanks for everybody in advance for reading my question.