Using pycom-fwtool-cli
-
Hi guys
Are there any experts out there who know how to flash the Pycom Firmware using the CLI-version (pycom-fwtool-cli) instead of the GUI-version (pycom-fwtool)?
The firmware (as I have understood it) can be downloaded from here:
https://github.com/pycom/pycom-micropython-sigfox/releasesI would like to use pycom-fwtool-cli instead of having clicking through the gui-app, and still be able to do some configurations, such as LoRa Region, Erase options, FileSystems (LittleFS), etc
All in one pretty one-liner if possible. :-)
-
@robert-hh said in Using pycom-fwtool-cli:
if one opens the docs in development view
Do you also believe it's better to browse https://github.com/pycom/pycom-documentation/tree/publish/content than stumbling through https://docs.pycom.io/?
-
@andreas After playing around with these pycom.bootmgr() API, I conclude that there is only a single image: the one with LittleFS included. The actual filesystem to be used is stored in NVS, and the option in the pycom updater just sets the one or the other default. This default can be changed with pycom.bootmgr(), but only if the firmware is compiled without the LFS option. The NVS is part of the firmware tar package.
P.S.: Surprisingly, all of that is documented, if one opens the docs in development view.
-
@kodarn To flash you can use: pycom-fwtool-cli -p "your COM port" flash -t "your .tar.gz file"
-
@andreas
pycom.bootmgr(fs_type=pycom.LittleFS, reset=True)
works as suspected. You can change the file system on the fly.
It seems that I did not look into the pycom module a while.
-
@kodarn said in Using pycom-fwtool-cli:
I assumed that filesystem creation was a part of the flashing procedure
Actually, I was believing the same thing.
In earlier releases, there was
os.mkfs('/flash')
, now we haveos.fsformat('/flash')
. While both don't say anything about the filesystem format, there is stillpycom.bootmgr(fs_type=pycom.LittleFS, reset=True)
which we are still using occasionally for clearing out the filesystem on the device.If it is possible to change the filesystem format with that is beyond what I have researched into.
Nevertheless, @robert-hh is also right that it is also related to the firmware itself somehow. At least, one can configure the respective parameter
FS=LFS
on the command line when building the firmware images.
-
@kodarn As far as I understand it, the filesystem to be used is coded in the firmware package. A short I made confirms that.
-
Ah, reading up on things. So there are two versions of the firmware files; One using FatFS and the other LittleFs. I assumed that filesystem creation was a part of the flashing procedure, but instead Pycom maintains two different sets of firmwares for all development boards?
-
Well, that's certainly a start :-)
However, I didn't find any reference to FatFS/LittleFS when reading the help page. Nor did I see any reference to the filesystems when reading through the online documentation of the tool at https://docs.pycom.io/advance/cli/
-
@kodarn pycom-fwtool-cli --help