filesystem fatfs function unavailable

kernic
Posts: 11
Joined: Tue Aug 20, 2024 10:33 pm

filesystem fatfs function unavailable

Postby kernic » Tue Aug 20, 2024 11:17 pm

I was reading from the doc about fatfs, and I found out about these two functions that I need to use to preallocate a contiguous file on my sd card, since I'm working on a tiny database project and I want my file to be contiguous for performance reasons.

The problem is that the provided includes from #include "esp_vfs_fat.h" and from #include "ff.h" don't seem to work, and I can't find out why, originally I was trying to use the "f_expand()" function right from the fatfs doc:

Code: Select all

The f_expand function prepares or allocates a contiguous data area to the file.

FRESULT f_expand (
  FIL*    fp,  /* [IN] File object */
  FSIZE_t fsz, /* [IN] File size expanded to */
  BYTE    opt  /* [IN] Allocation mode */
);
but even after trying to include the correct files, functions from the "esp_vfs_fat.h" header like "esp_vfs_fat_sdspi_mount()" will work, but the function which I need "esp_vfs_fat_create_contiguous_file()" from that same header won't work, even if I included the headers. same thing for f_expand() with fatfs, I am able to f_open() a file for example, but it seems impossible to call f_expand(),

which I currently really need since I wanted to directly overwrite over my file sectors using the sdmmc_write_sectors function from the espressif drivers and I can't do that with a fragmented file.

I even tried to downgrade the esp extension in visual studio from 5.3 to 5.0 with no success

Thanks for any help, that would be really appreciated!

ESP_adokitkat
Posts: 50
Joined: Thu Jun 22, 2023 12:50 pm

Re: filesystem fatfs function unavailable

Postby ESP_adokitkat » Thu Aug 22, 2024 2:51 pm

Please let's move the conversation to one thread, I answered in the other one: https://esp32.com/viewtopic.php?f=13&t=41464

Who is online

Users browsing this forum: No registered users and 65 guests