File system problems & solutions
-
From my own experience with 6 different GPYs & from reading the various pycom forums & GitHubs it's obvious there are issues with the file system stability. Opinion seems to be divided as to if a switch from FAT to LittleFS is worthwhile or not. What interests me most is that the GPY firmware seems very stable. It's always there, flashing it's little blue light every 4s, after it has erased my boot.py & main.py or declared them to have a syntax error after a random number of deepsleep cycles. Also all the pycom.nvs_set writes I do are always intact so the flash memory is obviously OK hardware wise.
I've seen a few posts (https://forum.pycom.io/topic/3902/frozen-modules-for-my-sipy-solved) where folks have converted libraries & other files into the same stable frozen bytecode as the firmware. Is there a way to bake my user land code (the boot.py or main.py) into this firmware too?
-
@kjm said in File system problems & solutions:
the windows version of this CLI
The CLI program should probably just be the same .exe file which is also the graphical thing.
According to [1], its default location might be
c:\Program Files (x86)\Pycom\Pycom Firmware Update\pycom-fwtool-cli.exe
.
-
@andreas said in File system problems & solutions:
pycom-fwtool
Does anybody have a link where I can download the windows version of this CLI?
-
@kjm said in File system problems & solutions:
What's the new command to erase flash
We have been using
pycom-fwtool-cli.exe --port COM16 erase_all
-
@andreas I'm running the latest updater but I don't get that dialogue box. What's the new command to erase flash with version 1.20.1.r1, I'll erase the whole thing & start again
-
You will be able to choose the filesystem type within the respective dialog of the Pycom Firmware Updater.
-- https://community.hiveeyes.org/t/anleitung-firmware-und-bob-software-des-fipys-updaten/2673
Alternatively, you might also be able to invoke this through the REPL:
import uos import pycom pycom.bootmgr(fs_type=pycom.LittleFS, reset=True) uos.fsformat("/flash")
-
@andreas I upgraded a GPY to try LittleFS
(sysname='GPy', nodename='GPy', release='1.20.1.r1', version='v1.11-3138a13 on 2019-10-08'
but how do I Know if it changed from FAT, does it happen automatically? All the online guides are suggesting an element of choice?
-
@kjm Pycom always recommends to use the LittleFs as it is more stable and solves a lot of issues present in the Fats FS.
In the frozen folder you should have a _boot.py and a _main.py.
-
Dear @kjm,
We have been using the module freezing process to successfully improve resilience and to reduce the startup time [1], see also [2].
We found the resources at [3,4] and the README on [5] helpful enough to run through that process successfully.
As outlined by @oligauc, you will have to freeze your
boot.py
andmain.py
as_boot.py
and_main.py
into thefrozen
folder of theesp32
subdirectory [6]. Usually, theCustom
folder is there to hold additional modules of your firmware and can also be used to carry_boot.py
and_main.py
, if you remove them from theBase
folder altogether, see also [7].However, you might also think about restructuring your code not to reside in a single
main.py
file but spread it out to appropriate modules for separating concerns [8,9].Nevertheless,
Pycom always recommends to use LittleFS as it is more stable and solves a lot of issues present in FatFS.
We totally second that.
With kind regards,
Andreas.[1] https://community.hiveeyes.org/t/micropython-module-freezing/2445
[2] https://forum.pycom.io/topic/5319/gpy-refuses-to-lte-attach-after-running-for-months/13
[3] https://forum.pycom.io/topic/1919/how-i-built-a-custom-firmware-for-frozen-bytecode
[4] https://forum.pycom.io/topic/3902/frozen-modules-for-my-sipy-solved
[5] https://github.com/pycom/pycom-micropython-sigfox/blob/v1.20.1.r1/README.md
[6] https://github.com/pycom/pycom-micropython-sigfox/tree/v1.20.1.r1/esp32/frozen
[7] https://forum.pycom.io/topic/5258/firmware-release-v1-20-1/30
[8] https://forum.pycom.io/topic/3175/code-structure-and-implementation-fsm
[9] https://forum.pycom.io/topic/3860/proper-structure-of-micropython-package