Virtual file system FatFS address

pepopi
Posts: 32
Joined: Mon Apr 11, 2022 9:45 am

Virtual file system FatFS address

Postby pepopi » Thu Oct 06, 2022 9:58 am

Hello,

I am doing a project using the vfs and I have a question. Having different subdirectories and files, how can I know the address of each file saved in the vfs?

Thank you

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Virtual file system FatFS address

Postby ESP_igrr » Thu Oct 06, 2022 12:39 pm

Hi peopi,

The direct answer to your question is "it's not possible to know".

It's probably better if you explain what you want to achieve, which requires you to know the address of the file.


The address of a particular file in Flash is something we can consider to be internal business of FAT library. The file might be located anywhere in the FAT partition. It's only important that the FAT library can find the file when you call "fopen" and access its data when you call "fread" or "fwrite". Besides, since the FAT partition is wrapped in a wear levelling container, the individual sectors in the partition might be shuffled according to the wear levelling algorithm. Just like in the case with FAT, it's not important where each particular sector ends up, it's only important that the wear levelling library knows how to find this sector.

Who is online

Users browsing this forum: awegel, StanInexeon and 96 guests