Skip to main content
MauFanGilaMedical
Associate III
Solved

Is it possible to open two files on uSD in FATFS ?

..

    This topic has been closed for replies.
    Saket_OmBest answer
    ST Technical Moderator

    Hello @MauFanGilaMedical 

    Yes, it is possible to open multiple files simultaneously using FATFS. The number of files can be set via the FS_LOCK parameter in STM32CubeMX.

    Saket_Om_0-1742381271642.png

     

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om

    4 replies

    Saket_OmBest answer
    ST Technical Moderator

    Hello @MauFanGilaMedical 

    Yes, it is possible to open multiple files simultaneously using FATFS. The number of files can be set via the FS_LOCK parameter in STM32CubeMX.

    Saket_Om_0-1742381271642.png

     

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
    MauFanGilaMedical
    Associate III

    so I can open one file in uSD and copy its content to another on uSD ?

    I have to do this copy to change some content.

    I did a first try but processor goes into Hard_Fault ... I supposed that I cannot open two files.

    I will investigate and Accept as Solution if I see that I can.

    Thankyou for the advice

    Ozone
    Principal

    I would think separate FIL objects for both files should suffice.
    Otherwise, I would try to call f_sync() whenever you change the file you currently access.