logo elektroda
logo elektroda
X
logo elektroda

[Solved] Creating a new ESP-IDF project with led_strip component - errors in Cmakelists.txt

NIXIE_123 1104 5
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19330984
    NIXIE_123
    Level 34  
    Hello

    Starting a project from "examples" containing the led_strip component, everything compiles. The problem occurs when I create a new project and add the same component manually, i.e. I add the following line to Cmakelists.txt
    set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/led_strip)
    .

    The pictures below explain everything. Please don't write "then start with an example what's the problem". What if I want to use two or three components?
    Creating a new ESP-IDF project with led_strip component - errors in Cmakelists.txt Creating a new ESP-IDF project with led_strip component - errors in Cmakelists.txt Creating a new ESP-IDF project with led_strip component - errors in Cmakelists.txt .
  • ADVERTISEMENT
  • #2 19331551
    ex-or
    Level 28  
    The sdkconfig for the project is one and is located in the root directory of the project. The file is generated from the Kconfig files of the components. So, did you execute "idf.py menuconfig" before compilation?
  • ADVERTISEMENT
  • #3 19332154
    NIXIE_123
    Level 34  
    ex-or wrote:
    did you execute "idf.py menuconfig" before compilation?
    .

    Yes, it looks the same:
    Creating a new ESP-IDF project with led_strip component - errors in Cmakelists.txt Creating a new ESP-IDF project with led_strip component - errors in Cmakelists.txt .

    EDIT:

    I went into the led_strip/main directory copied the Kconfig.projbuild file to the main folder of my project and finally the same options as in the example appeared in sdkconfig. The compilation went.
    Terribly non-obvious is all this. They would have done two lines of define at the beginning of the code like they used to and everything would have been clear. But don't you man scratch your head and look for the settings from ws2812 under the heading.... example configuration
    And what now I add a second component and where will it have the settings? example configuration2 ? Of course if I make myself such an item....
  • ADVERTISEMENT
  • #4 19332255
    ex-or
    Level 28  
    NIXIE_123 wrote:
    I went to the led_strip/main folder copied the Kconfig.projbuild file to the main folder
    .
    That's not how it works (or at least it shouldn't). The Kconfig files in the main and component folders work independently of each other. When you fire up idf.py mencuconfig, you should see definitions from all the files. Something probably got messed up, maybe the same section name in two different files.
  • ADVERTISEMENT
  • #5 19333915
    Nagus
    Level 27  
    The configuration created by menuconfig, which manifests itself by generating an sdkconfig file in the project root directory, can be extended by the user. That is, in this beautiful configurator displayed by menuconfig, you can have your own elements.
    The bugs reported were precisely about the lack of these additional definitions, they were not in the sdkconfig file.
    And custom elements in the configurator are done by adding a Kconfig.projbuild file in the source directory with the contents e.g.:
    menu "MOJE settingsy"
    
        config STA_WIFI_SSID
            string "WiFi SSID"
            default "myssid"
            help
                Initial SSID (network name).
    
        config STA_WIFI_PASS
            string "WiFi Password"
            default "mypassword"
            help
                Initial WiFi password (WPA or WPA2).
    
    endmenu
    .
    In the configurator, there will be a new menu item named MY settings and in the code there will be self defined macros named CONFIG_ + the name from the config field, e.g. CONFIG_STA_WIFI_SSID.
  • #6 19577703
    NIXIE_123
    Level 34  
    Nothing like a good old #define
ADVERTISEMENT