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.
impossible to override default sdkconfig settings
impossible to override default sdkconfig settings
Last edited by samTPL on Sun Jul 02, 2023 9:37 am, edited 1 time in total.
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: impossible to override default sdkconfig settings
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.
Re: impossible to override default sdkconfig settings
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?
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?
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: impossible to override default sdkconfig settings
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.
Re: impossible to override default sdkconfig settings
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???
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???
Re: impossible to override default sdkconfig settings
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...
Re: impossible to override default sdkconfig settings
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
Please see the note here: https://github.com/espressif/esp-idf/tr ... t-function
Re: impossible to override default sdkconfig settings
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 73 guests