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
vendor No String The vendor of the SDK extension the component is from. Only the vendors listed under extension/vendor or sdk/vendor key may be used.
package No String The ID of the SDK extension the component is from. Only SDK extensions listed using the extension/id or sdk/id key may be used.

When the override property is set, the configuration file is treated as an overriding configuration file. This file is only included in the generated project if the file it overrides -- identified by the combination of file_id, instance, and the component reference (component id with optional package and vendor fields) -- is also added to the project. In such cases, 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
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
config_file:
  - path: config/marlin_hunt.h
    override:
      # Fully implicit reference; Search within the containing package
      component: marlin
      file_id: hunt_control
  - path: config/tuna_speed.h
    override:
      # Fully qualified reference; Limit search to atlantic package by vendor fishmonger
      component: tuna
      file_id: speed_settings
      vendor: fishmonger
      package: atlantic
  - path: config/cod_school.h
    override:
      # Vendor-specific reference; Limit search to vendor's specific SDK/extension
      component: cod
      file_id: school_config
      vendor: fishmonger
  - path: config/salmon_swim.h
    override:
      # Package-specific reference; Limit search to package ID by any vendor
      component: salmon
      file_id: swim_style
      package: pacific