For information of all, and may be a correction one day....
I think I have found (at last!) the cause for an erratic bug that resets my zuno boards from time to time:
Here is my config :
- Z-UNO2, Z-Uno bootloader version:3.0.10, Security:none, Frequency:EU Device, included:yes ...
- Fibaro Home Center 3
It seems that it is not safe to use EEPROM.put() while some configuration parameter changes/activities are occurring.
My test code writes 32 bytes of data to the EEPROM rolling over 16 addresses ranging from 0xA00 to 0xBFF. It happens every 5min.
From the home box, I send new config parameter value every 5min, asynchronously.
Every time the exchanges between Zuno and HC3 are not ‘simple’ ie some errors are detected by HC3 (here its console outputs):
- with messages like: No report was received for parameter xx. The device might not have this parameter.
- duplicated many consecutive times: Received parameter xx report, value = 123456..
during/after means that the console output that is right after EEPROM.put() in the code does not produce anything.
(Note that errors detected by HC3 are generally false alarms)
I have found an (99%?) efficient workaround that consists in delaying 3 to 5 s any user EEPROM.put() after my config_parameter_hndlr() has been called.
I think that concurrent access of EEPROM are not enough managed…
Side dish: did you notice that EEPROM.put always return 0 even if data are correctly written? (this is not what is stated in the doc)
Best Regards,
Yves