Size of EEPROM changed

Upgraded to firmware 5.0. I noticed in the reference docs that the size of the emulated EEPROM has changed from 2048 to 2047 bytes for the Photon. I tried testing this by writing and reading values and discovered that the size of the EEPROM is actually 2043 bytes. Verified this finding on 2 Photons. Can anyone else confirm this?

The eeprom emulation was recently rewritten by @jvanier to be more robust and testable - I’ll leave it to him to comment on any size changes.

The EEPROM now has 2047 addressable bytes on the Photon. Can you tell me more details on how you calculate 2043?

@jvanier
Hi Julien, I arrived at that conclusion, maybe too quickly, because I’m unable to put and get different values to addresses 2044-2047. They always return the same value.

@jvanier
I’ve also just encountered a new EEPROM problem now with a Photon. After a red SOS (didn’t manage to count the number of blinks), I’m now unable to write new values to certain EEPROM addresses. When I try to write to address 2043 after power up, the Photon will attempt to store a new value to that address, but when I try to retrieve that data with a get command, the Photon will not respond. All I’m trying to do with that 2043 location is store a bool variable that when equal to 1, will perform certain tasks. As is with this Photon in question, I’m unable to write a value of 1 to this location. This worries me quite a bit since I rely very heavily upon the EEPROM in several permanent installations.
I’ll also mention that after the red SOS event, all of the data written to the EEPROM was lost.

Could you please save the current state of eeprom so that we can investigate the issue.

You can do this by running:

dfu-util -d 2b04:d006 -a 0 -s 0x80C000:0x14000 -U eeprom.bin

Thanks :smile:

Can you try the test program below? It does EEPROM.put to offsets 2040 to 2050 and then does EEPROM.get to the same offsets.

#include "application.h"

void setup() {
  for(uint8_t i = 0; i < 10; i++) {
    EEPROM.put(2040 + i, i);
  }

  String s;
  for(uint8_t i = 0; i < 10; i++) {
    uint8_t c;
    EEPROM.get(2040 + i, c);
    s += String(c, DEC) + " ";
  }
  Particle.publish("eeprom_bytes", s);
}

Then run particle subscribe mine
You should see that offsets 2040 to 2046 return the value written. 2047 and later EEPROM offsets will always return 255 (erased bytes).

{"name":"eeprom_bytes","data":"0 1 2 3 4 5 6 255 255 255 ","ttl":"60","published_at":"2016-04-25T13:43:09.603Z","coreid":"xxxxxxxxxxx"}