I know that similar questions have been asked and replied in the past (e. g. here)but there is never a reference to the documentation or datasheet. I understand that the function "eeprom_busy_wait() " is not needed when using the read/write functions provided in <avr/eeprom.h>: eeprom_read_*(...) and eeprom_update_*(...)
My question is: When is it necessary then?
In the compiler (AVR/GCC) documentation it says:
- All of the read/write functions first make sure the EEPROM is ready to be accessed. Since this may cause long delays if a write operation is still pending, time-critical applications should first poll the EEPROM e. g. using eeprom_is_ready() before attempting any actual I/O. But this functions are not wait until SELFPRGEN in SPMCSR becomes zero. Do this manually, if your softwate contains the Flash burning.
What does this mean? It says, if the application is time-critical then the EEPROM must be polled using eeprom_is_ready(). So:
- I will verify twice (since the function itself already verifies)? would make no sense...
- or to make sure that the write/read has been completed for example before jumping into the Bootloader Section? (I think this is what they mean)
- or do they mean before trying to call the function again and avoid data geting lost? (this is supposed to be checked already) e. g.
eeprom_update_byte(&var1_e, Var2); eeprom_busy_wait(); eeprom_update_byte(&Var3_e ,Var4); eeprom_busy_wait();
Any clarification would be appreciated