wokwi-features icon indicating copy to clipboard operation
wokwi-features copied to clipboard

EEPROM persistence

Open Koepel opened this issue 4 years ago • 10 comments
trafficstars

Feature request: store the internal EEPROM somewhere to make its data persistent.

My request is a for the internal EEPROM of the AVR family boards. When returning to Wokwi next day, the previous written data should still be there.

No extras There are many additions that I can think of (download the contents; have a number of binary files which can be choosen or uploaded; also store the simulated EEPROM of the SAMD and ESP processors; and so on), but that it too much over the top.

Writing to EEPROM has no clock-accurate delay. It is slower on a old ATmega8 then on a newer microcontroller. This might have consequences for interrupts. Since this is a very specific situation, I don't mind if the delay for writing data is skipped.

Storage location It would be nice if the data was stored on the Wokwi server in the project and not on the user's computer. That allows to use an other computer and continue with the same data.

Koepel avatar Nov 18 '21 09:11 Koepel

I too need better EEPROM functionality. I mostly need start/stop functionality to behave as power off as I'm trying to write good power-loss recovery stuff.

Gave it 4 votes 👍

greenveg avatar Dec 08 '21 13:12 greenveg

Thanks @greenveg! What project are you working on?

urish avatar Dec 12 '21 09:12 urish

Using a Controllino (Arduino framework PLC) for test rig at work. Need power-off recovery and such…

greenveg avatar Dec 13 '21 07:12 greenveg

(This comment is mostly a "bump" - but I also just used a few votes on it!)

M-square avatar Jun 03 '22 12:06 M-square

Note: additional discussion in #399

urish avatar Oct 23 '22 07:10 urish

newbie here, for my school project IRL I am using highScore = EEPROM.read(0);, however in the emulator I have to use EEPROM.get(0, highScore);, otherwise I will get 255 as the high score. And in the real hardware I have to use highScore = EEPROM.read(0); in order not to get 255. Another workaround I found is running in void setup EEPROM.write(0, 0); so that the emulator highScore starts with 0 using the same code I use in the real Arduino.

ppvnf avatar May 10 '23 16:05 ppvnf

When you buy a new ATmega328P microcontroller (as used in the Arduino Uno), then the EEPROM is empty. A empty EEPROM means that all the data is 0xFF. Wokwi simulates a fresh new unused Arduino Uno and therefor the EEPROM is empty and is 0xFF. The Arduino Uno board that you have in real life has probably been used by others.

Koepel avatar May 10 '23 18:05 Koepel

How can I store EEPROM contents in browser local storage?

jumpjack avatar Mar 24 '24 16:03 jumpjack

That is not implemented yet. The EEPROM contents is not stored in the Wokwi project as a file yet and it is not stored on your computer as local browser data.

Koepel avatar Mar 24 '24 16:03 Koepel