Page 1 of 1

bogus sdkconfig changes

Posted: Mon Apr 15, 2024 6:18 pm
by DrMickeyLauer
I realize this is probably more of a Kconfig question, but it's ESP-IDF I have this problem with.

Whenever I build my ESP-IDF project (containing custom Kconfig projectbuild configurations), I get bogus changes in the sdkconfig like that:

Code: Select all

diff --git a/firmware/boards/ecuconnect/sdkconfig.debug b/firmware/boards/ecuconnect/sdkconfig.debug
index fe9366b..7cff1c2 100644
--- a/firmware/boards/ecuconnect/sdkconfig.debug
+++ b/firmware/boards/ecuconnect/sdkconfig.debug
@@ -2218,6 +2218,22 @@ CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y
 # CONFIG_WIFI_PROV_STA_FAST_SCAN is not set
 # end of Wi-Fi Provisioning Manager

+#
+# ESP-NimBLE-CPP configuration
+#
+# CONFIG_NIMBLE_CPP_LOG_LEVEL_NONE is not set
+# CONFIG_NIMBLE_CPP_LOG_LEVEL_ERROR is not set
+# CONFIG_NIMBLE_CPP_LOG_LEVEL_WARNING is not set
+CONFIG_NIMBLE_CPP_LOG_LEVEL_INFO=y
+# CONFIG_NIMBLE_CPP_LOG_LEVEL_DEBUG is not set
+CONFIG_NIMBLE_CPP_LOG_LEVEL=3
+# CONFIG_NIMBLE_CPP_ENABLE_RETURN_CODE_TEXT is not set
+# CONFIG_NIMBLE_CPP_ENABLE_GAP_EVENT_CODE_TEXT is not set
+# CONFIG_NIMBLE_CPP_ENABLE_ADVERTISEMENT_TYPE_TEXT is not set
+# CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED is not set
+CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH=20
+# end of ESP-NimBLE-CPP configuration
+
 #
 # LittleFS
 #
@@ -2244,22 +2260,6 @@ CONFIG_LITTLEFS_MALLOC_STRATEGY_DEFAULT=y
 # CONFIG_LITTLEFS_MALLOC_STRATEGY_INTERNAL is not set
 CONFIG_LITTLEFS_ASSERTS=y
 # end of LittleFS
-
-#
-# ESP-NimBLE-CPP configuration
-#
-# CONFIG_NIMBLE_CPP_LOG_LEVEL_NONE is not set
-# CONFIG_NIMBLE_CPP_LOG_LEVEL_ERROR is not set
-# CONFIG_NIMBLE_CPP_LOG_LEVEL_WARNING is not set
-CONFIG_NIMBLE_CPP_LOG_LEVEL_INFO=y
-# CONFIG_NIMBLE_CPP_LOG_LEVEL_DEBUG is not set
-CONFIG_NIMBLE_CPP_LOG_LEVEL=3
-# CONFIG_NIMBLE_CPP_ENABLE_RETURN_CODE_TEXT is not set
-# CONFIG_NIMBLE_CPP_ENABLE_GAP_EVENT_CODE_TEXT is not set
-# CONFIG_NIMBLE_CPP_ENABLE_ADVERTISEMENT_TYPE_TEXT is not set
-# CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED is not set
-CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH=20
-# end of ESP-NimBLE-CPP configuration
 # end of Component config

 CONFIG_IDF_EXPERIMENTAL_FEATURES=y
No substantial changes, but a block of configurations gets removed from somewhere and put to another location.

Is that a known problem and is there a fix? It really disturbs my diffs.

Re: bogus sdkconfig changes

Posted: Tue Apr 16, 2024 6:10 am
by ESP_Roland
Here is one suggestion but I didn't get any response if it helped or not: https://github.com/espressif/esp-idf/is ... 2036568548

Re: bogus sdkconfig changes

Posted: Tue Apr 16, 2024 2:24 pm
by DrMickeyLauer
Thanks, I commented on this post. Sadly, the suggested fix does not change anything for me. An `idf.py build` still mixes up a section.

I wonder... if the order of components in `sdkconfig` is not relevant, perhaps I could add a post-build line (via cmake?) that just sorts the `sdkconfig` line-by-line?

Re: bogus sdkconfig changes

Posted: Tue Apr 16, 2024 6:06 pm
by chegewara
This is not a problem with line endings or similar problems.
Obviously something is enabling and/or disabling some options in Kconfig. Do you have some extra build scripts?
Maybe rebuild with set-target is doing this?
Its rather not possible, but different targets may have different default sdkconfig options.
For example S2 does not have BLE, so the options related to bluetooth may be disabled (just example).

Re: bogus sdkconfig changes

Posted: Tue Apr 16, 2024 9:43 pm
by MicroController
Sounds like sdkconfig.defaults should be the solution to this problem.
In short, you menuconfig your project as desired (->sdkconfig), then idf.py save-defconfig to create an sdkconfig.defaults from the current sdkconfig, add sdkconfig.defaults to version control, and discard the original sdkconfig.