The dfe.conf file
The dfe.conf file is the heart of any application or library. It defines a 'firmware element' - either a library or an application.
Its purpose is to provide information to dbuild about how to build the element it defines.
The format of the dfe.conf file is YAML, below is a short example:
1 name: my_example_application 2 type: app 3 mmcu: atmega1284p 4 freq: 10MHz 5 deps: 6 - dio 7 - spi 8 9 compiler_options: 10 - -DFOOBAR=test123
The dfe.conf file must contain at least the following options:
- name - the name of the element - duplicates are not allowed!
- type - either 'lib' or 'app'
While libraries are meant to be used regardless of the hardware they will run on, applications need to be built specifically for a target platform. Therefore, applications will also require the following:
- mmcu - target microcontroller
- freq - target microcontroller core frequency in Hz (can be specified either as '10000000' or '10MHz').
As explored above, both applications and libraries may depend on other libraries. These dependencies are also declared in dfe.conf as an array named deps:
1 # ... 2 deps: 3 - dio 4 - spi
In some cases, we might need to override options passed to the compiler or the linker. This can happen in case of very specific build requirements or when we want to override a preprocessor macro.
The dfe.conf file allows us to specify additional compiler options, that will be added to the list of command-line arguments passed to the compiler.
1 # ... 2 compiler_options: 3 - -DFOO=0 4 - -DBAR=0xff
In the same way, we can also specify additional linker options that will be passed to the linker:
1 # ... 2 linker_options: 3 - -Wl,--section-start=.text=0x1fc00
Note: the example above is taken from the Kiwi bootloader and tells the linker where the text (code) section begins in the flash memory.