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

    FAT FS corrupted with leading FF ... FF in directory and files.

    Scheduled Pinned Locked Moved Discussion
    2 Posts 2 Posters 25 Views 2 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.
    • D Offline
      dgerman
      last edited by dgerman

      I recently had problems with FAT corruptions. I had WLAN started as STA in boot.
      In main I started LTE for ntp and syslog, appending to a log file(open append, write,close) a few times along the way.
      I added bt.start_scan, bt.get_adv() before starting LTE.
      The boot.log, main.log and /flash directory got 0xFF written as first 0x87(?) bytes.
      After os.format('/flash') and removing get_adv() this problem did not occur.

      Rearrainging the sequence and adding wlan.deinit before bluetooth is working OK.

      Can anyone corroborate this behavior?
      I can make failing code available if you want.
      Might this be fixed since 1.20.2.rc2? (I cannot upgrade to rc6 see https://github.com/pycom/pycom-micropython-sigfox/issues/430 )

      os.uname()
      (sysname='GPy', nodename='GPy', release='1.20.2.rc2', version='v1.11-605f40f on 2020-02-04', machine='GPy with ESP32', pybytes='1.3.1')

      1 Reply Last reply Reply Quote 0
      • C Offline
        crumble
        last edited by

        please mind, that you have to wait to shutdown until all write operations are done. Sadly there is no flush feature, so you have to guess the timings and wait by your own.

        Normally only short messages are written. So a sleep of 1-2 seconds after the last write before a deepsleep will be secure. And don't forget to close the file, which also contains write operations.

        1 Reply Last reply Reply Quote 0

        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