Skip to content

config_file

Required: No
Type: List of configuration files
Condition: Yes

List of configuration files to be included in the project. Configuration files may reside anywhere in the SDK, and are copied to the config/ directory in the project upon project generation. The config/ directory is automatically added as an include path in exported IDE projects if not empty. If any configuration file has export set to true, the same applies to the config/export/ directory. Both the config and config/export/ directories shall be created on disk by the project generator, even if they are empty.

If multiple components contribute configuration files with the same name to the same project, it is implementation-defined how this is handled.

See the description of configuration files for more details.

A configuration file entry may have the following keys:

Key Required Type Description
path Yes String Path to configuration file
directory No String Copy the file to the given subdirectory of the config directory. Cannot be used with export
file_id No String ID of this configuration file. If multiple configuration files have the same ID, they are assumed to have mutually exclusive conditions.
override No Override map Map containing information about another configuration file to override
condition No List of features The configuration file is added if all the given features are present
unless No List of features The configuration file is added unless any of the given features are present
export No Boolean Default false if not set. If true, the file is copied into the config/export/ directory instead of the default config/ directory. Cannot be used with directory. Exported content is always put at at config/export without subdirectories. This is to better support configuration sharing because compiler include paths are not recursive.
1
2
3
4
id: driver
config_file:
  - path: path/to/driver_config.h
    file_id: driver_config

Configuration Override

The override entry may have the following keys:

Key Required Type Description
file_id Yes String ID of the configuration file to override
component Yes String ID of the component containing the original configuration file
instance No String Instance name of the instance whose configuration file shall be overridden

When the override property is set, the configuration file is considered an overriding configuration file. Such a configuration file is only added to the project if the file referenced by the override property (combination of file_id, component and instance) is due to be added to the project. In this case, the overriding configuration file replaces the original.

Overriding a configuration file that doesn't have a file_id in the original component is not supported.

When overriding a configuration file, the export setting of the overridden configuration file is the one that is considered, while the export setting of the overriding file is ignored.

1
2
3
4
5
config_file:
  - path: other_path/to/driver_config.h
    override:
      component: driver
      file_id: driver_config
Back to top