Closed dolence closed 1 year ago
Hi dolence,
for each block of data stored by EEWL there is also 1 control byte, so the first buffer has size 30x40+1x40 = 1240. You start the second buffer at 1300 so that is ok. The second buffer has size 3x200+1x200 = 800 that is bad because the start at 1300 plus a size of 800 overflows the EEPROM size. I hope this can help.
Fabrizio.
Hi Fabrizio! Thank you for your fast response :)
I think I didn't get it right... Second block for example:
uint16_t e_cnt = 0; 2 bytes + 1 control byte = 3 bytes Why 1x200 added to the 3x200? Souldn't it be 3*200 = 600?
Equally, first block should be: 39 bytes + 1 control byte = 40 and 40*30 = 1200?
Of course you are right. You have already taken into account the extra byte. It's my mistake. From the pieces of code that you posted, I do not see anything wrong. Could there be something in the rest? Another suggestion: I never tested EEWL on an ATMEGA64, so may be useful to see if the example countPowerCycles works properly on ATMEGA64.
I'm trying to use this library on my project. At first it seemed to fit perfectly my needings, but unfortunately I'm having a lot of data corruption issues.
When I save data on epprom, wait few seconds and turn the power off and turn it on again now and then eepParam.get(eepromParametros) return false causing the eeprom data to be reinitialized to the default values.
I have two blocks/circular buffers as you can see below:
Struct declaration:
Setup() portion
Everytime a button is pressed I read the parameters and save them again directly after:
What I'am doing wrong?
EDIT: forgot to mention, I'm using an ATMEGA64. This microcontroller have 2048 bytes eeprom.