Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    File system problems & solutions

    Scheduled Pinned Locked Moved GPy
    firmwarefile systemlittlefsfat
    9 Posts 3 Posters 601 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K Offline
      kjm
      last edited by kjm

      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?

      A O 2 Replies Last reply Reply Quote 0
      • A Offline
        andreas @kjm
        last edited by andreas

        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 and main.py as _boot.py and _main.py into the frozen folder of the esp32 subdirectory [6]. Usually, the Custom 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 the Base 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

        K 1 Reply Last reply Reply Quote 1
        • O Offline
          oligauc @kjm
          last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • K Offline
            kjm @andreas
            last edited by

            @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?

            A 1 Reply Last reply Reply Quote 0
            • A Offline
              andreas @kjm
              last edited by andreas

              You will be able to choose the filesystem type within the respective dialog of the Pycom Firmware Updater.

              112dbcdd-dc51-43ed-a0bc-1181f9d2b921-image.png

              -- 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")
              
              K 1 Reply Last reply Reply Quote 0
              • K Offline
                kjm @andreas
                last edited by

                @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

                1 Reply Last reply Reply Quote 0
                • A Offline
                  andreas
                  last edited by

                  @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
                  

                  -- https://community.hiveeyes.org/t/installing-the-recent-pycom-firmware-1-20-1-r1-requires-erasing-the-flash-memory-completely/2688/4

                  K 1 Reply Last reply Reply Quote 0
                  • K Offline
                    kjm @andreas
                    last edited by

                    @andreas said in File system problems & solutions:

                    pycom-fwtool

                    Does anybody have a link where I can download the windows version of this CLI?

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      andreas
                      last edited by andreas

                      @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.

                      [1] https://community.hiveeyes.org/t/setup-commandline-based-micropython-development-environment-on-linux-macos-and-windows/1639/15

                      1 Reply Last reply Reply Quote 2

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • 1 / 1
                      • First post
                        Last post

                      Pycom on Twitter

                      Pycom