pvvx/ATC_MiThermometer

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"

grafik

Example 2: Before "delete all records"

grafik

Example 2: After "delete all records"

grafik

pvvx commented

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?

pvvx commented

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:

while (faddr < FLASH_ADDR_END_MEMO) {
               …
		if (tmp != MEMO_SEC_ID)
			_flash_erase_sector(faddr);
               …

Thank you, @pvvx! I just tested the new 3.8 on one device and can confirm that deleting now works as expected! Awesome!