🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    I want to know the correct procedure for accessing files to SD memory.

    UiFlow 2.0
    3
    5
    2.3k
    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
      digiponta
      last edited by

      Hi,
      I would like to know the correct procedure for accessing files to SD memory.
      First, is it necessary to initialize the SD memory? If necessary, I would like to know what initialization parameters are required. I want to know the difference between a and a+ in file open flags. I want to know the meaning of +.
      When initializing with the default SD memory initialization parameters, the operation is very unstable and almost always crashes with an error.

      Thank you in the advance

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by felmue

        Hello @digiponta

        have you seen this thread? @ajb2k3 posted this guide a while ago.

        As for a and a+. See here.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 2
        • ajb2k3A
          ajb2k3
          last edited by

          All this information is out there and has been online for years however,

          Plug in card,
          Mount card,
          read card,
          write card,
          unmount card,
          remove card
          The argument mode points to a string beginning with one of the following
          sequences (Additional characters may follow these sequences.):

          ``r'' Open text file for reading. The stream is positioned at the
          beginning of the file.

          ``r+'' Open for reading and writing. The stream is positioned at the
          beginning of the file.

          ``w'' Truncate file to zero length or create text file for writing.
          The stream is positioned at the beginning of the file.

          ``w+'' Open for reading and writing. The file is created if it does not
          exist, otherwise it is truncated. The stream is positioned at
          the beginning of the file.

          ``a'' Open for writing. The file is created if it does not exist. The
          stream is positioned at the end of the file. Subsequent writes
          to the file will always end up at the then current end of file,
          irrespective of any intervening fseek(3) or similar.

          ``a+'' Open for reading and writing. The file is created if it does not
          exist. The stream is positioned at the end of the file. Subse-
          quent writes to the file will always end up at the then current
          end of file, irrespective of any intervening fseek(3) or similar.

          UIFlow, so easy an adult can learn it!
          If I don't know it, be patient!
          I've ether not learned it or am too drunk to remember it!
          Author of the WIP UIFlow Handbook!
          M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

          1 Reply Last reply Reply Quote 1
          • D
            digiponta
            last edited by digiponta

            Sorry, I had found it the trouble about SD memory itself. The S3 seems to need a high spec. SD memory. I have no trouble after replacing it to new one (32GB, 100MB/s).

            ajb2k3A 1 Reply Last reply Reply Quote 1
            • ajb2k3A
              ajb2k3 @digiponta
              last edited by

              @digiponta thanks for the update.
              I had forgotten that some cards are just not compatible

              UIFlow, so easy an adult can learn it!
              If I don't know it, be patient!
              I've ether not learned it or am too drunk to remember it!
              Author of the WIP UIFlow Handbook!
              M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post