Skip to main content
This topic has been closed for replies.
Saket_OmBest answer
ST Technical Moderator
Mar 19, 2025 10:48 AM UTC

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
Mar 19, 2025 10:48 AM UTC

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
Mar 19, 2025 12:18 PM UTC

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
Mar 19, 2025 12:37 PM UTC

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.