Can I downgrade from littleFS to fatFS?
-
We have some old modules that are still running fatFS but am in the process of seeing if it's viable to update to newer firmware that include littleFS. My issue is, if my client decides to rollback, will I be able to flash a previous firmware that will put the filesystem back to fatFS or once you update to littleFS you can't go back? Thanks!
-
@lmerza After update. If at that moment to he file system is not switched, change the setting and reboot. During reboot the new filesystem will get active. Since switching to the FS which is already set does not change anything, you can just set LittleFS and reboot. Sobthe sequence is:
- save files, if required
- update firmware
- reboot
- set FS to LittleFS
- reboot
- restore the files
-
@robert-hh said in Can I downgrade from littleFS to fatFS?:
@lmerza You just call that once, when switching the file system.
when do i switch the file system? after update or after reboot?
-
@robert-hh I see if you update from 1.18.2 you have to update to 1.18.3 to resize partitions first before moving to 1.20.x. This will all need to happen OTA so I usually use the bin files from this url https://software.pycom.io/downloads/WiPy.html
The url doesn't seem to have the latest firmware files in it anymore. Is there a new place to get the latest bin files?
-
@lmerza Yes. You have to update the firmware first. It may be that the switch from 1.18.2 to 1.20.2.r34 is not possible with OTA, and changing the file system all files on the target are lost.
-
@robert-hh sorry, maybe I am misunderstanding the filesystem formatting. I'm currently on firmware version
1.18.2.r7
. If I were to use theota_
functions to update the firmware to the latest version, this would not change the underlying filesystem until I callpycom.bootmgr(fs_type=pycom.LittleFS)
as well?
-
@lmerza LittleFS is definitely more robust in case of power fails or the like. And if Pycom eventually enables the wear leveling, is is also safe against flash wear.
-
@lmerza You just call that once, when switching the file system.
-
@robert-hh said in Can I downgrade from littleFS to fatFS?:
import pycom
pycom.bootmgr(fs_type=pycom.FAT)Hello! Thank you for responding. When would I call these two lines? After calling
ota_finish()
or in theboot.py
file right at bootup? We are also testing to see if littleFS is something we want to do since we are experiencing corruption on some older devices but wanted to very I can switch back and forth easily. Thanks!
-
@lmerza The new firmware supports both file systems. YOu can always switch using:
import pycom
pycom.bootmgr(fs_type=pycom.FAT)or
pycom.bootmgr(fs_type=pycom.LittleFS)