How to enable FATFS in ESP-IDF 4.2

User avatar
MickPF
Posts: 45
Joined: Tue Apr 03, 2018 8:47 pm

How to enable FATFS in ESP-IDF 4.2

Postby MickPF » Thu Jul 01, 2021 11:12 am

Hello,

I haven't changed anything in my ESP-IDF 4.2 environment (under Ubuntu 20.04 64 bit) for months.
For reasons unknown to me I have had certain problems with it and can not find any cause for it. I have probably changed something in "menuconfig" of my current project, which affects it. I just can't find it.
  • 1. When I enter the following lines

Code: Select all

#include "nvs_flash.h"
#include "nvs.h"
or

Code: Select all

#include "fatfs/vfs/esp_vfs_fat.h"
in my code, the C compiler does not find these files, although they can be found in the right places under "components".

  • 2. In “menuconfig” under “Component config” the menu item “NVS” is inactive. Somehow I probably deactivated it!
  • 3. Also in “menuconfig” under “Component config” I can not see “FAT filesystem support” anymore as in the past, which has now disappeared!
Can someone please help me to fix these errors!

Thanks in advance
Michael
Nobody is perfect!
My name is NOT Nobody...


Nobody lives forever to correct his mistakes someday in the future, if not right now!
Covid-19 is not responsible for any human failures!

User avatar
MickPF
Posts: 45
Joined: Tue Apr 03, 2018 8:47 pm

Re: How to enable FATFS in ESP-IDF 4.2

Postby MickPF » Fri Jul 02, 2021 11:08 am

I've found the cause: a component and its subdirectory in my project are named "fatfs". It causes a conflict with the component in ESP-IDF without any warning/error message!

Espressif should change its code to display a warning or an error message for such conflicts!
Nobody is perfect!
My name is NOT Nobody...


Nobody lives forever to correct his mistakes someday in the future, if not right now!
Covid-19 is not responsible for any human failures!

User avatar
mbratch
Posts: 302
Joined: Fri Jun 11, 2021 1:51 pm

Re: How to enable FATFS in ESP-IDF 4.2

Postby mbratch » Fri Jul 02, 2021 1:32 pm

Yeah it's a good idea to avoid "obvious" or common names for your own variables and classes for this reason. I've encountered this in the PlatformIO build environment as well, so it's not specific to Espressif tools. I think they have built in rules for what overrides what in those cases. Glad you found the issue!

chegewara
Posts: 2334
Joined: Wed Jun 14, 2017 9:00 pm

Re: How to enable FATFS in ESP-IDF 4.2

Postby chegewara » Fri Jul 02, 2021 5:54 pm

MickPF wrote:
Fri Jul 02, 2021 11:08 am
I've found the cause: a component and its subdirectory in my project are named "fatfs". It causes a conflict with the component in ESP-IDF without any warning/error message!

Espressif should change its code to display a warning or an error message for such conflicts!
Hi,
There is no conflict that may be reported, it is expected behaviour by design, which allows to copy esp-idf component and edit it. In that case your edited component from components folder is used and esp-idf toolchain is clean and can be updated when desired.
Of course it may be problematic when you have own component with the same name, but it requires only to change folder name.

Who is online

Users browsing this forum: Bing [Bot] and 65 guests