Sdkconfig (SPIFFS) For ESP32

I am trying to use SPIFFS to store an html file and I want to change CONFIG_SPIFFS_META_LENGTH in my sdkconfig to CONFIG_SPIFFS_META_LENGTH=0.
When I do this through menuconfig or even manually edit the file, I check the build folder and the change is not there.

My sdkconfig location:

./amazon-freertos/vendors/espressif/boards/esp32/aws_demos/sdkconfig

sdkconfig:

#
# SPIFFS Configuration
#
CONFIG_SPIFFS_MAX_PARTITIONS=3

#
# SPIFFS Cache Configuration
#
CONFIG_SPIFFS_CACHE=y
CONFIG_SPIFFS_CACHE_WR=y
CONFIG_SPIFFS_CACHE_STATS=
CONFIG_SPIFFS_PAGE_CHECK=y
CONFIG_SPIFFS_GC_MAX_RUNS=10
CONFIG_SPIFFS_GC_STATS=
CONFIG_SPIFFS_PAGE_SIZE=256
CONFIG_SPIFFS_OBJ_NAME_LEN=32
CONFIG_SPIFFS_USE_MAGIC=y
CONFIG_SPIFFS_USE_MAGIC_LENGTH=y
CONFIG_SPIFFS_META_LENGTH=0
CONFIG_SPIFFS_USE_MTIME=y

#
# Debug Configuration
#
CONFIG_SPIFFS_DBG=
CONFIG_SPIFFS_API_DBG=
CONFIG_SPIFFS_GC_DBG=
CONFIG_SPIFFS_CACHE_DBG=
CONFIG_SPIFFS_CHECK_DBG=
CONFIG_SPIFFS_TEST_VISUALISATION=

But in the

./build/config/sdkconfig.h

the following line is present,

#define CONFIG_SPIFFS_META_LENGTH 4

Not sure why since I’ve made change in that sdkconfig file before and its worked. Any help would be appreciated. Thanks!

./amazon-freertos/vendors/espressif/boards/esp32/aws_demos/sdkconfig file is used only if you are building as a Makefile project.

Are you using CMake to build the project ? If so the sdkconfig is generated by CMake in the build folder.

So you need to edit the sdkconfig in the build folder:./build/sdkconfig. Alternatively from build folder, you can run make menuconfig or ninja menuconfig depending on your build system.

Yes I am using CMake.

  1. Do I build the project first and then change the values I need to in the ./build/sdkconfig?

  2. If yes to the previous question, won’t they get removed if the build folder gets deleted?

Thanks!

You can configure the project first using CMake command which will create a build folder. You can then change sdkconfig values anytime from within the build folder.

skdconfig gets removed if build folder is deleted. You can save any configurations to be not deleted in sdkconfig.defaults file.

Makes sense but just to confirm,

I should add

#define CONFIG_SPIFFS_META_LENGTH 4

to the sdkconfig.defaults in order to ensure that this option is maintained. So if someone else were to clone my repository and build the project, this option would be enabled (since the ./build is not added to git)?

It should be CONFIG_SPIFFS_META_LENGTH=4

That’s correct.

1 Like