0

I want to provide a Kconfig / menuconfig configuration for an implementation. I'm using the toolchain from Espressif ESP-IDF 3.3, but it seems not to be related with the toolchain. I want to have a minimum resulting sdkconfig file without any additional "helper" symbols.

The user should either use (a) a predefined configuration option or choose (b) to set all values by himself.

Here is my current Kconfig code:

menu "Test"

    choice PREDEFINED
        prompt "Select predefined configuration"
        default PREDEF_NONE

        config PREDEF_NONE
            bool "None"
        config PREDEF_OPT_A
            bool "Option A"
            select BOARD_A
            select FEATURE_A
        config PREDEF_OPT_B
            bool "Option B"
            select BOARD_B
            select FEATURE_B
    endchoice

    menu "Submenu"
        visible if PREDEF_NONE

        choice
            prompt "Select Board"
            config BOARD_A
                bool "Board A"
            config BOARD_B
                bool "Board B"
        endchoice

        choice
            prompt "Select Feature"
            config FEATURE_A
                bool "Board A"
            config FEATURE_B
                bool "Board B"
        endchoice
    endmenu

endmenu

If the predefined option A is chosen, the submenu should not be visible (this is working) and the resulting sdkconfig created by make menuconfig using this Kconfig file should read like this:

#
# Test
#
CONFIG_PREDEF_NONE=
CONFIG_PREDEF_OPT_A=y
CONFIG_PREDEF_OPT_B=

#
# Submenu
#
CONFIG_BOARD_A=y
CONFIG_BOARD_B=
CONFIG_FEATURE_A=y
CONFIG_FEATURE_B=

but I get only the first three lines

#
# Test
#
CONFIG_PREDEF_NONE=
CONFIG_PREDEF_OPT_A=y
CONFIG_PREDEF_OPT_B=

When I choose PREDEF_NONE and set the values in the Submenu manually, everything is fine.

Any idea on how to proceed or what's wrong here?

Regards Andreas

artless noise
  • 21,212
  • 6
  • 68
  • 105
AnErd
  • 415
  • 3
  • 12

1 Answers1

0

It's a example:

    choice SPI_HOST
        prompt "SPI HOST"
        default USE_SPI3_HOST

        config USE_SPI1_HOST
            bool "USE SPI1 HOST"
        config USE_SPI2_HOST
            bool "USE SPI2 HOST"
        config USE_SPI3_HOST
            bool "USE SPI3 HOST"
        config USE_SPI4_HOST
            bool "USE SPI4 HOST"
    endchoice

    config SPI_HOST
        int
        default 0 if USE_SPI1_HOST
        default 1 if USE_SPI2_HOST
        default 2 if USE_SPI3_HOST
        default 3 if USE_SPI4_HOST
Esmaeill
  • 47
  • 5