wokwi / wokwi-features

Wokwi Feature requests & Bug Reports
https://wokwi.com
69 stars 17 forks source link

EEPROM persistence #231

Open Koepel opened 2 years ago

Koepel commented 2 years ago

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.

greenveg commented 2 years ago

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 👍

urish commented 2 years ago

Thanks @greenveg! What project are you working on?

greenveg commented 2 years ago

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

M-square commented 2 years ago

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

urish commented 1 year ago

Note: additional discussion in #399

ppvnf commented 1 year ago

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.

Koepel commented 1 year ago

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.

jumpjack commented 4 months ago

How can I store EEPROM contents in browser local storage?

Koepel commented 4 months ago

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.