7

I'm working on an open-source embedded project which requires quite a lot of configuration - distortos - object-oriented C++ RTOS for microcontrollers. When starting a new project you can select the chip you will be targeting from several hundred supported devices, after that you may select the configuration of chip's clock (PLL multipliers, dividers, quartz crystal frequency, ...) and chip's peripherals (whether to enable serial port 1, serial port 2, serial port 5 and so on). During project's evolution you can configure other features of the RTOS (like sizes of stacks, run-time checking and so on).

At this moment the project uses kconfig-frontends, which is a tool used to configure Linux kernel - extracted to be a separate, standalone project. My configuration menus currently look more or less like this:

enter image description here enter image description here

While kconfig-frontends has quite a lot of nice features, it also has some very serious flaws.

  1. Impossible to build on Windows - one guy created a Windows build of a pretty old 3.12.0 version some time ago, but I never managed to reproduce his results, and his compilation covers only the "mconf" variant (ncurses-bases - pictured above), all other tools are not present in the binary package he uploaded.
  2. Unknown whether it builds on Mac.
  3. In most Linux distros you have to manually build it yourself from source. This is a problem, as people working with microcontrollers (users of my project) are not very used to doing that, and the process is not that easy as you would imagine.
  4. Doing some things is extremely tedious - for example you can "force select" an option, but you cannot "force unselect" it, except hiding it from the user...
  5. Doing some things is impossible - for example dependencies can only be based on bool values, you cannot have some options depend on an exact integer value or a string.
  6. (related to 5.) There are limited possibilities for checking the validity of user's input - for example for integers you can only allow a contiguous range of values, while sometimes a list of valid integers would be more suitable (this can be worked around with a list of bools + hidden integer with default value based on bool, but then see 4. - this is not very practical if there is more than - say - a dozen of allowed values).
  7. I probably forgot about something anyway...

Mainly because of first three items I'm considering moving to some other tool. But the problem here is that I actually only know one alternative - cmake-gui (or ccmake). It nicely solves the most important problems listed above (1-3), but doesn't solve all of them - I'm pretty sure points 4-6 remain in place, maybe affecting some different areas, but still... There are also some more issues with cmake:

  1. With kconfig-frontends the hierarchical structure of the configuration can be freely created - you can have as many levels of menus as you like, arranged anyway you want. With cmake the configuration is flat, with the possibility to group the options by the prefix of each value (more-or-less something like a menu with 2 levels in kconfig-frontends).
  2. There are only strings and bools as "types" of options, having integers with value checking requires some workarounds.
  3. The dependencies among options is very cumbersome. In kconfig-frontends if "option B" depends on "option A" being enabled, then changing value of "option A" results in "option B" being immediately hidden or displayed to the user. In cmake-gui when you have such dependencies, you have to click "Configure" to actually see any effect.

One user of my project created a preliminaty port to cmake and it looks like that: enter image description here

My question therefore is - are there any other alternatives to kconfig-frontends and cmake-gui? The most important features I'm after are:

  • easy to use on all major OS platforms;
  • GUI;

For other features I'm flexible and I may adapt.

I also know that I could write my own configuration tool and ship that with the project, but I'd really prefer not to go that way, unless forced by lack of other options. I prefer to have some GUI tool instead of a typical approach of embedded project - requiring the user to manually edit some header files with all the options. This is because there are way too many things to configure (even though I try to keep the number of options down to a minimum), most of options depending on some other options, and also because some of the options affect the build process, so using .h file for that is not very convenient.

5
  • 3
    I have no idea what you're attempting to do, but +1 for the well written and researched question!
    – DankyNanky
    Commented Jan 22, 2018 at 10:29
  • Did you ever find an answer?
    – Mawg
    Commented Nov 14, 2018 at 15:16
  • 1
    @Mawg unfortunately no, I'm going on with CMake and its cmake-gui for now. Commented Nov 14, 2018 at 21:53
  • Then perhaps you ought to post that as an answer, and accept it, in order to help others in future
    – Mawg
    Commented Nov 15, 2018 at 7:53
  • Latest kernels come with qconf - QT based GUI front-end for kconfig, used for make xconfig target. Might be possible to port it on Windows.
    – il--ya
    Commented Apr 25, 2019 at 1:30

1 Answer 1

0

I am just researching the same issue (need a portable configuration option handing tool with UI), and found the Kconfiglib project. It is a kconfig implementation written in python, support console and graphical UI. Please see: https://github.com/ulfalizer/Kconfiglib

(I am in an early phase and did not checked the tool yet. Some may still find Kconfiglib useful.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.