EEPROM issues

Status
Not open for further replies.

daniel-arg

Member
HEllo

I had 2 Teensy that has EEPROM issues, I don't make a very intensive use of it, mainly storing config parameters, readed at boot time, than wrote once or twice per run.

The issue is that the device freezes on EEPROM read.

Is the lifetime of the EEPROM that short?
Is there a 'best practice' to use EEPROM?

Finally, is there a way to get a new device to replace those 2 that are partially unusable?

Any clue on this will be helpful.

Cheers, and thank you

Daniel
 
The issue is that the device freezes on EEPROM read.

Is the lifetime of the EEPROM that short?

No, the EEPROM should definitely not fail in such a short time.

Even when it does eventually fail, the failure mode will be wrong data, not freezing your program (unless your program is written in such a way that is freezes when given wrong data).

Something else is wrong here. What, nobody can even begin to guess, since we have so little info other than "device freezes on EEPROM read".
 
No, the EEPROM should definitely not fail in such a short time.

Even when it does eventually fail, the failure mode will be wrong data, not freezing your program (unless your program is written in such a way that is freezes when given wrong data).

Something else is wrong here. What, nobody can even begin to guess, since we have so little info other than "device freezes on EEPROM read".

Thanks for your quick answer.
I'll double check my code. What's is strange is that the same code on 2 identical devices, one freezes the other don't.
Anyway, as per your comments, I may be doing something wrong
 
yes, you did not post any code ;-)

What a useful comment! :D


Here is my code:

#include <EEPROM.h>
int cycle=0;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
delay(3000);
}

void loop() {
// put your main code here, to run repeatedly:
char c;
Serial.print("Cycle ");
Serial.println(cycle++);
delay(3000);
for (int e = 0; e < 256; e++) {
c = EEPROM.read(e);
if (c < 0x10) {
Serial.print('0');
}
Serial.print(c, HEX);
Serial.print(" ");
if((e+1)%16==0) Serial.println(" ");
EEPROM.write(e,e);
}
Serial.println(" ");
delay(3000);
Serial.println("Restart");
}


On device #1, the result is the following, and the Teensy freezes

Device1.png

On device #2, the result is the following, and it iterates undefinitely
Device2.png
 
Could you try adding this at the beginning of loop()?

Code:
  Serial.println(FTFL_FCNFG, HEX);

Does it print something different on each board?
 
Can you use an interval timer interrupt to toggle a pin/LED to see if the entire device is freezing?

I can't seem to find any blocking code in the EEPROM library
 
First thing I'd do is comment out the EEPROM.write call to see if the problem occurs during a read or a write.
 
Same for both devices: it prints 1

Same here, when I ran it on a Teensy 3.2. At least that rules out the FlexNVM memory not getting configured into EEPROM mode, which is really the only thing that could be expected stall.

Is it possible something entirely unrelated is happening here, but just seems like it might be the EEPROM memory? Are either of these boards being tested with connections to other hardware?
 
Status
Not open for further replies.
Back
Top