Skip to content

Wall ink Memory

jdeananderson edited this page Nov 20, 2018 · 11 revisions

There are four types of memory on the ESP8266, and the wall-ink device project uses all of them.

Flash

The esp8266 has several MB of flash. This is where the Arduino sketch is stored. Is is overwritten by using the serial port and overwriting the sketch.

RAM

There is nearly 80kB of RAM on an esp8266, but there is only about 40-50 kB available for a sketch to use. A simple reset of the chip will cause all contents of the RAM to be cleared. In this project, that means every time the sketch is run all contents of the RAM start empty. You cannot use any variables from one boot to another. This is what Flash, EEPROM and RTC memory are for.

EEPROM

The EEPROM is actually a small portion of the Flash memory that the esp8266 makes available during execution of the sketch to read and write from. It can be written to and cleared from within the sketch, or firmware code. This is where all of the settings in Admin mode are stored, such as WiFi passwords, the URL of the wall-ink-server to attach to, the image key, etc. The EEPROM should be used sparingly since this type of memory does wear out after many uses. This is not a place to store data that will change several times a day or it will burn out the memory.

Flashing the device doesn't clear the EEPROM!

All of the Admin mode settings are stored in the EEPROM memory. This memory persists across flashes. To reset the EEPROM memory, you can run the ESP8266 eeprom_clear sketch. This sketch can be found in the Arduino IDE under file -> Examples -> Examples for Generic ESP8266 Module -> EEPROM -> eeprom_clear. After flashing this sketch and running it once, flash the ESP8266 with the wall-ink firmware.

RTC Memory

The Real Time Clock has 512 bytes of memory. This is very small, but very powerful. This memory keeps it state over reboots, and does not wear out like flash or EEPROM memory. This is where the wall-ink device stores settings such as the drift "fudge factor", the hash of the last image, and what access point that was used last. The RTC memory is updated with all of the latest information each time the screen checks in with the server.

Clone this wiki locally