Data written to EEPROM gets randomly wiped out (rewritten as 0xff) after reset, wake from sleep, or power off/on
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cpp
- Lĩnh vực
- embedded-iot
Hướng nghiên cứu
Payload không nêu tên tệp mã nguồn hay các bài kiểm thử. Trước tiên, hãy chuyển sketch giải thích EEPROM.begin/read/write/commit thành một bản tái hiện đã được kiểm thử trên SparkFun ESP8266 Thing Dev với core 3.1.2, sau đó so sánh hành vi qua các lần reset, sleep và chu kỳ cấp nguồn với core cũ hơn. Công việc được xem là hoàn tất khi xác định được nguyên nhân có thể tái hiện và xác minh rằng dữ liệu EEPROM đã commit không bị thay thế bằng 0xff.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C++
- Star
- 16.7k
- Fork
- 13.1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của esp8266/Arduino
-
Typo in Scan Class DocumentationCó thể đã có người làm @MukundaKatta đã nhận 184 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
lwip2 time-wait.patch: TCP_TW_LIMIT can abort the pcb that tcp_process() is still handling -> double free, heap corruptionCó thể đã có người làm @scardus đã nhận 17 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Tất cả issue của esp8266/Arduino
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
NVIDIA-RTX/NRI#277 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
os:Linux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
acceptable_buffer_backends: unknown backend names are silently ignoredCó thể đã có người làm @mini-1235 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
ros2/rmw_fastrtps#945 ·
Maintainer thường phản hồi trong vòng 1 ngày