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



  • 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



  • Hello @digiponta

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

    As for a and a+. See here.

    Thanks
    Felix



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



  • 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).



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