I’m having an unusual issue recalling data from EEPROM after rebooting the device. I am "put"ing data , and even verifying it with a “get” immediately after. It only (seem to) happen in this specific memory address location of 72.
long SomeVar = 55662; long SomeVar2; EEPROM.put(72, someVar); EEPROM.get(72, someVar2); Serial.println("Before: " + String(SomeVar ) + ", After: " + String(someVar2));
The variable is correctly written to the EEPROM… and while I am performing
other EEPROM.PUT’s in my code after this in other memory locations, evertime I am, I have debugged it to Serial output and verified the stored value is still correct (“55662” in this example).
However, if I call System.reset(); to reboot the device, press the Reset button, or if I send a firmware update to the device, or if I power cycle it, in all scenarios, when I call EEPROM.get(72, someVar2); again, the value always comes back with a whacky value, such as maybe something like 11223. Its always comes back something different, only after a reboot.
Things I know:
- It always does it (System.reset(), firmware update, reset, or a power cycle)
- I’m using Device OS 1.0.1
- I don’t seem to have any issues with the fetching of data from the EEROM in other memory address locations before/after this location of 72. For example I am storing long data type variables in address 68 and 76 and they seem to be recalled without any issues.
I found in a old forum post that I can data dump the eeprom to a file using the following command line:
dfu-util -d 2b04:d006 -a 0 -s 0x800C000:0x18000 -D eeprom.bin
However this forum post was from 2015, and when I try it now, I get an error:
DfuSe interface name: "Internal Flash "
Downloading to address = 0x0800c000, size = 0
Last page at 0x0800bfff is not writeable
I presume the error is because the EEPROM flash address location has changed since DeviceOS 1.0.1? Does anyone know a updated command line to data dump the EEPROM?
In any case… I’m not sure what else to try here to debug this issue.