impossible to override default sdkconfig settings

samTPL
Posts: 11
Joined: Thu Jun 29, 2023 2:55 pm

impossible to override default sdkconfig settings

Postby samTPL » Thu Jun 29, 2023 3:15 pm

Hi,
I am trying to combine the functionality of several sample ESP2 projects (I'm using the VSCode with
the Espressif IDF extension).
I created the project based on Blink example and I'm trying to add features from advanced_https_ota.
To do this I modified the sdkconfig.defaults file.

The ESP-IDF Programming Guide states that
"It can contain all the options which matter for the given application.
The format is the same as that of the sdkconfig file.
Project build targets will automatically create sdkconfig file, populated with the settings
from sdkconfig.defaults file, and the rest of the settings will be set to their default values."

My CMakeLists.txt looks like this:
cmake_minimum_required(VERSION 3.5)

set(BUILD_DIR ${CMAKE_BINARY_DIR})
set(SDKCONFIG "${BUILD_DIR}/sdkconfig")
set(SDKCONFIG_DEFAULTS "sdkconfig.defaults")

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(main)

What actually happens is that the resulting sdkconfig file only reflects change of
parameters contained in the default (in my case Blink) project.
If I add some additional parameters from advanced_https_ota(e.g. CONFIG_EXAMPLE_OTA_RECV_TIMEOUT),
into sdkconfig.defaults file, they are completely ignored.

Whenever I add them manually into sdkconfig or sdkconfig.cmake they are immediately deleted
by the ESP-IDF build system.

Where do these default parameters of sample projects come from and how can I add parameters
to configure my own application?

Thanks in advance for any possible help.
Last edited by samTPL on Sun Jul 02, 2023 9:37 am, edited 1 time in total.

ESP_Sprite
Posts: 9727
Joined: Thu Nov 26, 2015 4:08 am

Re: impossible to override default sdkconfig settings

Postby ESP_Sprite » Fri Jun 30, 2023 1:09 am

They're defaults, not overrrides: given that you presumably already ran menuconfig, you have a good set of configs in sdkconfig so the defaults file does nothing. Try removing that file and the defaults should apply.

samTPL
Posts: 11
Joined: Thu Jun 29, 2023 2:55 pm

Re: impossible to override default sdkconfig settings

Postby samTPL » Sun Jul 02, 2023 11:08 am

I am not sure my problem is well understood. Surely I run menuconfig, but it only displays
settings specific to the current example project!

To be more precise: the blink project contains CONFIG_BLINK_GPIO=15 parameter
in its sdk config. Running menuconfig I can find "Blink GPIO number" and the coresponding value
(15) that can be changed.

On the other hand, the project advanced_https_ota contains, CONFIG_EXAMPLE_OTA_RECV_TIMEOUT=5000
which corresponds to the menu item OTA Receive Timeout, while CONFIG_BLINK_GPIO is missing here
as well as CONFIG_EXAMPLE_OTA_RECV_TIMEOUT is missing in the Blink project.
Respectively, running menuconfig I cannot find relevant menu items.

My objective is to merge functionalities of both project in one,
so I want my project to contain both parameters
(in fact, it should contain a larger number of parameters).

Regarding "defaults file does nothing" - actually it does!
If I set e.g. CONFIG_BLINK_GPIO=25 instead of 15 in sdkconfig.defaults
the resulting sdkconfig reflects this change.

But if I put into sdkconfig.defaults CONFIG_EXAMPLE_OTA_RECV_TIMEOUT=5000
this parameter is totally ignored by sdkconfig, also the relative item doesn't
show up in the menu (note that my default project is Blink).

Where do defaults come from and how can I control them?

ESP_Sprite
Posts: 9727
Joined: Thu Nov 26, 2015 4:08 am

Re: impossible to override default sdkconfig settings

Postby ESP_Sprite » Mon Jul 03, 2023 12:51 am

Ah, like that. The options you see in menuconfig come from various Kconfig.projbuild files; see e.g. here for the blink one. If you merge the two Kconfig.projbuild files from both examples, you should get both options.

samTPL
Posts: 11
Joined: Thu Jun 29, 2023 2:55 pm

Re: impossible to override default sdkconfig settings

Postby samTPL » Mon Jul 03, 2023 4:53 pm

Thanks a lot for this!
I have merged two Kconfig.projbuild as you suggested and missing parameters are now
peacefully integrated into sdkconfig and are also visible in the menu.

HOWEVER, I still cannot find the placement of parameters such as
EXAMPLE_WIFI_PASSWORD and EXAMPLE_WIFI_SSID (I'm talking about advanced_https_ota project).

They do not appear in Kconfig.projbuild, and yet they show up in the menu
("WiFi SSID" and "WiFi Password" items).

Where do these ones originate from???

samTPL
Posts: 11
Joined: Thu Jun 29, 2023 2:55 pm

Re: impossible to override default sdkconfig settings

Postby samTPL » Mon Jul 10, 2023 8:10 am

I found the solution: I took the above parameters from Kconfig.projbuild of OTHER ESP projects, integrated them into mine, and it works. Yet I wonder why they are missing in advanced_https_ota, while appropriate settings show up in the menu...

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

Re: impossible to override default sdkconfig settings

Postby ESP_igrr » Mon Jul 10, 2023 3:16 pm

These Kconfig options originate from https://github.com/espressif/esp-idf/tr ... les_common — a helper component used by all of the protocols-related examples.

Please see the note here: https://github.com/espressif/esp-idf/tr ... t-function

Riscy00
Posts: 5
Joined: Wed May 15, 2024 7:12 pm

Re: impossible to override default sdkconfig settings

Postby Riscy00 » Thu May 16, 2024 3:04 pm

I just figured out now, the sdkconfig need to be deleted or renamed sdkconfigold so that sdkconfig_default can be applied to new sdkconfig!

Who is online

Users browsing this forum: No registered users and 82 guests