Kconfig Configuration in Zephyr

Introduction

Kconfig provides a compile-time project configuration mechanism and offers configuration options of several types, e.g., integers, strings, and booleans.

Range of Input Values

The RANGE_MIN and RANGE_MAX macros can be used to limit the range of possible input values for int and hex symbols. For example:

``` CONFIG_FOO=10 ```

However, the following syntax is not valid:

``` CONFIG_FOO="1 3" ```

Warnings and Errors

If you set CONFIG_KCONFIG_WARN_AS_ERROR in the environment, Kconfig will prefix all symbols with its value when issuing warnings.

Zephyr Configuration

In Zephyr, Kconfig configuration is done after selecting a target board. It is not recommended to use Kconfig for values that will change at runtime.

Conclusion

Kconfig is a powerful tool for managing project configuration in Zephyr. By understanding its syntax and options, you can effectively control the behavior of your embedded system.


No comments:

Post a Comment