Data written to EEPROM gets randomly wiped out (rewritten as 0xff) after reset, wake from sleep, or power off/on
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- cpp
- Ambito
- embedded-iot
Direzione di ricerca
Il payload non indica alcun file sorgente o test. Inizia trasformando lo sketch esplicativo EEPROM.begin/read/write/commit in una riproduzione testata sullo SparkFun ESP8266 Thing Dev con core 3.1.2, quindi confronta il comportamento tra reset, sleep e cicli di alimentazione con quello del core precedente. Il lavoro sarà completato quando sarà identificata una causa riproducibile e sarà verificato che i dati EEPROM sottoposti a commit non vengano sostituiti da 0xff.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Basic Infos
- This issue complies with the issue POLICY doc.
- I have read the documentation at readthedocs and the issue is not addressed there.
- I have tested that the issue is present in current master branch (aka latest git).
- I have searched the issue tracker for a similar issue.
- If there is a stack dump, I have decoded it.
- I have filled out all fields below.
Platform
- Hardware: ESP8266
- Core Version: 3.1.2
- Development Env: [Arduino IDE|]
- Operating System: [Manjaro Linux]
Settings in IDE
- Module: Sparkfun ESP8266 Thing Dev
- Flash Mode: [qio|dio|other] I don't know
- Flash Size: 512 kB
- lwip Variant: v2 Lower Memory
- Reset Method: I don't know
- Flash Frequency: [40Mhz] I don't know
- CPU Frequency: [80Mhz|160MHz] I don't know
- Upload Using: [SERIAL]
- Upload Speed: [115200] (serial upload only)
Problem Description
My code writes to the (fake?) EEPROM with EEPROM.write() and EEPROM.commit() and reads with EEPROM.read() the data that has been written in previous "sessions".
Sometimes, utterly randomly, after waking up from sleep, when my sketch reads a byte from a given position, instead of the value that it had previously written, it finds a 0xff.
My code had been running for literally years without issues on a dozen identical boards.
Recently I re-compiled and re-uploaded with the last version of the Arduino core on a new unit of the same identical board. I made no changes to the relevant part of the code, but the version compiled with the latest core has this issue.
Note that I'm observing the issue on a brand new chip, so this is not the Flash memory getting damaged by too many write cycles. Also, the old boards that are still running the code that was compiled with the old core, are still having no issue (they haven't got anywhere near 10k write cycles).
MCVE Sketch
NOTE: I cannot share the original sketch. I haven't written and tested a minimal sketch. The issue is hard to reproduce at will because it occurs randomly, but it happens often. I'm writing a minimal code example just to explain the issue, but I have not run and tested the code below; consider it as explanatory pseudo-code, it may very well contain mistakes.
#include <Arduino.h>
void setup() {
EEPROM.begin(512);
char x = EEPROM.read(0);
if (x != 'X') Serial.printf("!!! Unexpected value found in EEPROM: %d\n", x);
else Serial.println("Found expected value in EEPROM");
EEPROM.write(0, 'X');
EEPROM.commit();
}
void loop() {
}
Debug Messages
Debug messages go here
- Lingua principale
- C++
- Stelle
- 16.7k
- Fork
- 13.1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di esp8266/Arduino
-
Typo in Scan Class DocumentationForse già presa @MukundaKatta l’ha presa 183 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
lwip2 time-wait.patch: TCP_TW_LIMIT can abort the pcb that tcp_process() is still handling -> double free, heap corruptionForse già presa @scardus l’ha presa 17 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
Tutte le issue di esp8266/Arduino
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
FriendsofECCE/ECCE#336 · 1 commento ·
-
Real literal with a 'd' exponent and a kind suffix (1.0d0_4) is accepted; the suffix is ignoredApertaerror not reported low priority semantics
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
bitcoin-core/gui-qml#1030 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno