bogus sdkconfig changes

DrMickeyLauer
Posts: 168
Joined: Sun May 22, 2022 2:42 pm

bogus sdkconfig changes

Postby DrMickeyLauer » Mon Apr 15, 2024 6:18 pm

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.

User avatar
ESP_Roland
Posts: 265
Joined: Tue Oct 09, 2018 10:28 am

Re: bogus sdkconfig changes

Postby ESP_Roland » Tue Apr 16, 2024 6:10 am

Here is one suggestion but I didn't get any response if it helped or not: https://github.com/espressif/esp-idf/is ... 2036568548

DrMickeyLauer
Posts: 168
Joined: Sun May 22, 2022 2:42 pm

Re: bogus sdkconfig changes

Postby DrMickeyLauer » Tue Apr 16, 2024 2:24 pm

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?

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: bogus sdkconfig changes

Postby chegewara » Tue Apr 16, 2024 6:06 pm

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).

MicroController
Posts: 1706
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: bogus sdkconfig changes

Postby MicroController » Tue Apr 16, 2024 9:43 pm

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.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 82 guests