Skip to main content
MauFanGilaMedical
Associate III
March 19, 2025
Solved

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

  • March 19, 2025
  • 2 replies
  • 507 views

..

Best answer by Saket_Om

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

 

2 replies

Saket_OmBest answer
Technical Moderator
March 19, 2025

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
March 19, 2025

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
March 19, 2025

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.