Other than doing text comparison and replacement in the sdkconfig file -- is there any slick way to control the menuConfig selections programmatically?
Can anyone point me in a direction?
Is it possible to program menuConfig settings in code?
-
- Posts: 29
- Joined: Thu Sep 26, 2019 5:44 am
-
- Posts: 42
- Joined: Wed Dec 09, 2015 6:39 pm
Re: Is it possible to program menuConfig settings in code?
Probably not in the way you are thinking. The contents of the sdkconfig file are macro definitions, anywhere they appear in the code, they are replaced with that value that macro represents. What this means is once the code is running, those macro definitions don't even exist anymore, just their values.is there any slick way to control the menuConfig selections programmatically?
example
Code: Select all
#include "freertos/FreeRTOS.h"
#define TAG "main"
....
ESP_LOGI(TAG, "app_main running");
Code: Select all
#include "freertos/FreeRTOS.h"
....
ESP_LOGI("main" "app_main running");
Code: Select all
#ifdef TAG
#undef TAG
#define TAG "main2"
#endif
-
- Posts: 1725
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Is it possible to program menuConfig settings in code?
... which actually won't work either: None of the (IDF) components you use, and which #include "sdkconfig.h" for their configuration, will "see" the new definition from your code.
As I understand it, the OP doesn't want to reconfigure the SDK from inside the ESP application (code) but wants to set/override certain values e.g. from the command line w/o having to interactively navigate through the menuconfig TUI. - But I can't seem to find a solution for that either.
It would be kind-of doable if the sdkconfig.h were generated as a set of
Code: Select all
#ifndef X
#define X ...
#endif
Or, more simple, if sdkconfig.h would contain a line like #include "custom_sdkconfig.h" at the end, with a custom_sdkconfig.h which would be created empty by default but would not be re-generated by the build system. (Or even using __has_include("custom_sdkconfig.h") to also work in the absence of the file.)
-
- Posts: 1725
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Is it possible to program menuConfig settings in code?
Just found idf.py confserver which could help get the trick done.
-
- Posts: 29
- Joined: Thu Sep 26, 2019 5:44 am
Re: Is it possible to program menuConfig settings in code?
I have read your posts... very helpful information.
I'm trying to automate the application of security features and I'm not seeing a way forward without controlling items in menuConfig...
I have been setting eFuses -- but the application won't respond as expected. Then when I go back and set the menuConfig appropriately, then everything works.
I was just trying to get past the manual portion of this.
K.
I'm trying to automate the application of security features and I'm not seeing a way forward without controlling items in menuConfig...
I have been setting eFuses -- but the application won't respond as expected. Then when I go back and set the menuConfig appropriately, then everything works.
I was just trying to get past the manual portion of this.
K.
Who is online
Users browsing this forum: No registered users and 413 guests