Page 1 of 1

sdkconfig and sdkconfig.h issues

Posted: Wed Aug 10, 2022 12:09 pm
by ThomasBit
Hi

I probably is doing something wrong, but I have some difficulties to generate a usable sdkconfig.h file. Sometime it revert to something different that I have made in menuconfig

I have ESP IDF v4.4.1 and using visual studio and CMake

My application folder:
Esp32Config
sdkconfig
main
main.cpp
CmakeLists

I run 'idf.py menuconfig' from the \Esp32Config folder. It builds the menuconfig fine and the folder is containing a good sdkconfig file with the changes after i have saved the config

I than open my project and reconfigure. Than the file \MyApp\Esp32Config\sdlconfig is changed back to was it was before? And when I build the sdkconfig.h in the output directory used for the build is wrong.

I set 'SDKCONFIG ${CMAKE_CURRENT_SOURCE_DIR}/Esp32Config/sdkconfig' in my idf_build_process structure in the CMakeLists.txt for the application

Code: Select all

idf_build_process( esp32
  PROJECT_NAME "${PROJECT_NAME}"
  PROJECT_VER "${PROJECT_VER}"
  COMPONENTS esp32 freertos esptool_py app_update esp_eth    
  SDKCONFIG ${CMAKE_CURRENT_SOURCE_DIR}/Esp32Config/sdkconfig
  BUILD_DIR ${CMAKE_BINARY_DIR}
)
My build dir is C:/CMakeBuilds/build/Esp32-Freertos-Debug

SDKCONFIG is set to C:\MyApp/Application/Esp32Config/sdkconfig

The \MyApp\* is under git control

Any idea what I have missed?`Maybe I must use sdkconfig.defaults, but how does that exactly work?

Thomas

Re: sdkconfig and sdkconfig.h issues

Posted: Mon Aug 15, 2022 11:07 pm
by ESP_igrr
Hi ThomasBit,

Could you please explain the project(s) structure in a bit more detail?
Based on your description, I understood as that you have two projects:
- one IDF build system project where you execute 'idf.py menuconfig'
- another CMake project where you use IDF as a library and reference the sdkconfig file generated by the first project
Is my understanding correct?

If it is, then the reason why the sdkconfig file content may change is that you are not building the same set of components in the second project as in the first one. Please try setting the COMPONENTS variable in the CMakeLists.txt file of the first project to the same list of components as you are building in the 2nd project.