I am using AWS FreeRTOS with the Espressif ESP32. I have mulitple configuration keys that do not match the default sdkconfig.defaults. They can be set using idf.py menuconfig
, but this is manual and error-prone for more than one or two changes. Even more important, these customizations must be non-manually applied so that automated builds will work.
The documentation here: Getting started with the Espressif ESP32-DevKitC and the ESP-WROVER-KIT - FreeRTOS, says to supply a custom sdkconfig.default by using the -DIDF_SDKCONFIG_DEFAULTS=path/to/sdkconfig.default
flag.
This does not work. When I start with a clean build, and use the command
cmake -DVENDOR=espressif -DBOARD=esp32_wrover_kit -DCOMPILER=xtensa-esp32 -S . -B build -GNinja -DCMAKE_BUILD_TYPE=release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DIDF_SDKCONFIG_DEFAULTS=/home/me/tryagain/sdkconfig.defaults
the build fails like this:
Loading defaults file /home/ian/wwork/firefly/tryagain/build/sdkconfig.defaults...
Traceback (most recent call last):
File "/home/ian/work/firefly/tryagain/vendors/espressif/esp-idf/tools/kconfig_new /confgen.py", line 641, in <module>
main()
File "/home/ian/work/firefly/tryagain/vendors/espressif/esp-idf/tools/kconfig_new /confgen.py", line 285, in main
raise RuntimeError("Defaults file not found: %s" % name)
RuntimeError: Defaults file not found: /home/ian/work/firefly/tryagain/build/sdkconfig.defaults
CMake Error at vendors/espressif/esp-idf/tools/cmake/kconfig.cmake:225 (message):
Failed to run confgen.py
Indeed, looking in the build directory, no sdkconfig.defaults or sdkconfig file has been generated. The named file does exist, so it is not a typo issue.
When I do a build without the -DIDF_SDKCONFIG_DEFAULTS flag set, the build completes successfully.
I’ve also tried:
-
cmake ...
without the flag, thenidf.py build
with the flag -
cmake ...
without the flag, then with the flag -
cmake ...
without the flag, then overwriting the generated sdkconfig.defaults - etc
In every combination there is either an error in either the cmake build
, or the idf.py
build caused by a missing config key.
What is the proper approach to solve this problem?