External Flash lose files
-
This 11 wipy3 are the only with 10 sec write.
The other +-139 wipy3, write to flash every 60sec.Best Regards,
-
@robert-hh said in External Flash lose files:
@serafimsaudade That's indeed quite often, about 3 Million writes/year. A few more questions:
- how many byte do you write every time (average)
- do you close the file after every write? If yes, data will be written, if no, data will be buffered and only written, if the buffer is full or the file is closed.
- which WiPy do you use, WiPy2 or WiPy3? That matters with respect to the size of the file system.
I do not remember the details of the LFS implementation, whether they do some kind of journalling or not. In any case the fault safe property should cause more write operations.
I write +- 200 bytes;
I close the file after every write.
I'm using the WiPy3.Best Regards
-
@serafimsaudade I understood first that you have 11 devices in total and all failed at the same time. However, if 11 out of 150 fail in a short range of time, then a hardware problem could be the cause.
I do not see an easy way of verification that hypothesis. On a quick search I did not find test code for the flash chip.
You could obviously use a Arduino or espressif software environment and create a small program that tries writing and reading the flash. Or you open a device and replace the flash chip.
-
@serafimsaudade That's indeed quite often, about 3 Million writes/year. A few more questions:
- how many byte do you write every time (average)
- do you close the file after every write? If yes, data will be written, if no, data will be buffered and only written, if the buffer is full or the file is closed.
- which WiPy do you use, WiPy2 or WiPy3? That matters with respect to the size of the file system.
I do not remember the details of the LFS implementation, whether they do some kind of journalling or not. In any case the fault safe property should cause more write operations.
-
Well, after doing a double check into the code. This 11 wipy write to flash +- every 10sec.
Best Regards,
-
@serafimsaudade That depends on how many write operations are performed on the flash. The typical figure a vendor guaratees is 100000 erase/write cycles. But practically more write cycles are possible, and it should not affect all devices at the same time. Additionally, LFS has mechanisms for wear leveling, such that all blocks of the flash are written equally, not a few blocks more that others, like it happens with the FAT file system.
Taking the number of 10**5 in a year, that would mean ~274 write events of a single block every day - or one every 5 minutes. Can you estimate how often your devices write to flash?
-
After done all this tests I'm very concern about the flash sanity.
It is possible the flash has reach the write limit cycles ?PS: last year I have install +- 150 units.
Best Regards,
-
@serafimsaudade After the two steps you shoed in the last post the flash is indeed empty, beside a skeleton boot.py and main.py.
-
I use an USB/uart converter.
I check the "erase flash".
Yes I uploaded the application with FTP.I also did another test with the pycom-fwtool-cli:
pycom-fwtool-cli -p /dev/ttyUSB0 erase_all Running in FTDI mode Erasing the board can take up to 40 seconds. Board erased successfully in 15.07 seconds pycom-fwtool-cli -p /dev/ttyUSB0 flash -t WiPy-1.20.2.r4.tar.gz Running in FTDI mode Script Version: 2.1 Flash operation successful.
And the result is the same.
Best Regards,
-
@serafimsaudade What I understand:
- you updated the firmware with the pycom updater to V1.20.2.R4. Did you use the USB interface for that? Did you check the "erase flash" option to have a well defined initial state?
- You uploaded you application file with ftp.
And then, after reset, the flash is empty. That looks like a corrupted file system. Therefore it is important to start the re-build with a full flash erase.
-
Hi Again.
I got an update about my problem.
I updated the firmware of one the fault wipy using the pycom update manager to the latest release V1.20.2.R4.
For this test I didn't compile the firmware from gitbhub with custom fronzen files.
Over FTP I copy the software into the flash. When I reset the pycom the software fail to start returning an error. Checking the flash it was empty.Best regars.
-
Hi @robert-hh
I'm using the version 1.20.2.RC9 from the github, because I compile custom frozen files.
Tomorrow I will program one the faulty wipy using the update manager and the official firmware from pycom, and check if the flash retain the config files.Best regards.
-
@serafimsaudade Please tell, which firmware version you are using and whether you made any changes to the device.
It is unlikely that all eleven devices have the same hardware fault. That looks more like a software problem.