On the weekend I started to have very strange flash write issues, where it would take two attempts to write to flash before the value would change. No errors were reported by the FDS module.
After many frustrating hours trying to figure out why this is happening, I had the idea that flash was full, but not reporting properly the full state. So I looked at how we are cleaning up flash after writing, and it turns out we are not doing this at all.
So I added fds_gc() after the write update in eeprom.c, and all the problems went away!
It is working well as it did before the problem happened.
See: https://devzone.nordicsemi.com/f/nordic-q-a/25923/fds-gc-seems-not-to-work
"Running Garbage collection after fds_record_update() will delete the 'old' copy of the record, if it succeeds."
I must have collected over the last many months enough garbage in the flash to be an issue.
NOTE: I DID NOT CORRECT THIS IN THE WIRELESS CONTROLLER MODULE. PLEASE REVIEW AND ADD THIS TO THE CODE IF YOU AGREE.
@casinho,
On the weekend I started to have very strange flash write issues, where it would take two attempts to write to flash before the value would change. No errors were reported by the FDS module. After many frustrating hours trying to figure out why this is happening, I had the idea that flash was full, but not reporting properly the full state. So I looked at how we are cleaning up flash after writing, and it turns out we are not doing this at all. So I added fds_gc() after the write update in eeprom.c, and all the problems went away! It is working well as it did before the problem happened. See: https://devzone.nordicsemi.com/f/nordic-q-a/25923/fds-gc-seems-not-to-work "Running Garbage collection after fds_record_update() will delete the 'old' copy of the record, if it succeeds."
I must have collected over the last many months enough garbage in the flash to be an issue. NOTE: I DID NOT CORRECT THIS IN THE WIRELESS CONTROLLER MODULE. PLEASE REVIEW AND ADD THIS TO THE CODE IF YOU AGREE.