Memo: "Delete all records" does not delete ALL records
bentolor opened this issue · 5 comments
Hi @pvvx Victor,
I'm using the Graph Memo functionality quite regularily. Unfortunately the delete all record function does not delete all records.
See below after a fresh "delete all records". It only seems to delete all recent records.
Example 1: After "delete all records"
Example 2: Before "delete all records"
Example 2: After "delete all records"
It is possible that the battery is low.
There was not enough energy for the entire memory erasing cycle and the device rebooted?
@pvvx I don't think so as I'm able to reproduce this behaviour on multiple devices and I'm not loosing bluetooth connection. I can directly issue a "get time" command right after it.
Just did it on a 3rd device: It always seems to be based on very old data. What remains are the values from 30 March to 22 April. Deleted are all newer than April 22 18:00.
Also: Repeated deletion does not change the data which is not deleted: It stays the same date range: 30 March to 22 April.
I'd see some display flickering or loss of bluetooth connection in case of a reboot, right?
I'd see some display flickering or loss of bluetooth connection in case of a reboot, right?
Yes.
The procedure code in the loop erases the sectors.
It cannot abort until it has erased all Flash sectors associated with "Memo".
@pvvx Just tried this again on another device and now I feel pretty confident that its not the battery. Here is why:
- Downloading the full data takes much, much, much longer and I can even see the display become lighter during the transmission while
- deletion happens in a glimpse: Display is stable; no flicker; bluetooth stays connected. Nothing at all.
Please check the attachments: First on before deletion, second after deletion. Maybe they can give a hint?
lounge-measurements.csv
lounge-measurements-truncated.csv
Looking at the referred code and asking a few dumb questions:
- Why start at
FLASH_ADDR_START_MEMO + FLASH_SECTOR_SIZE
vs.FLASH_ADDR_START_MEMO
? - Was
MEMO_SEC_ID
already present in previous firmwares?. I might have had an older firmware on collecting that old data and flashed/upgraded somewhere at that time where the persistent recording ends. - And I don't get it: Why only erase if no known sector is present? You wrote, it would erase all sectors independent from any condition. This does not seem to be the case:
while (faddr < FLASH_ADDR_END_MEMO) {
…
if (tmp != MEMO_SEC_ID)
_flash_erase_sector(faddr);
…