Skip to content

Commit 46de74b

Browse files
mbolivar-nordiccfriedt
authored andcommitted
doc: dts: clear up DTC_OVERLAY_FILE
Make it clearer that you can set it explicitly or the build system will try to set it for you, and try to make it clearer what the build system is doing when it tries to set it on your behalf. Signed-off-by: Martí Bolívar <[email protected]>
1 parent 9e85264 commit 46de74b

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

doc/guides/dts/howtos.rst

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -201,26 +201,30 @@ Set devicetree overlays
201201

202202
Devicetree overlays are explained in :ref:`devicetree-intro`. The CMake
203203
variable :makevar:`DTC_OVERLAY_FILE` contains a space- or semicolon-separated
204-
list of overlays. If :makevar:`DTC_OVERLAY_FILE` specifies multiple files, they
205-
are included in that order by the C preprocessor.
206-
207-
Here are some ways to set it:
208-
209-
1. on the cmake build command line
210-
(``-DDTC_OVERLAY_FILE="file1.overlay;file2.overlay"``)
211-
#. with the CMake ``set()`` command in the application ``CMakeLists.txt``,
212-
before including zephyr's :file:`boilerplate.cmake` file
213-
#. create a ``boards/<BOARD>_<revision>.overlay`` file in the application
214-
folder for the current board revision. This requires that the board supports
215-
multiple revisions, see :ref:`porting_board_revisions`.
216-
The ``boards/<BOARD>_<revision>.overlay`` file will be merged with
217-
``boards/<BOARD>.overlay`` if this file also exists.
218-
#. create a ``boards/<BOARD>.overlay`` file in the application
219-
folder, for the current board
220-
#. create a ``<BOARD>.overlay`` file in the application folder
221-
#. create an ``app.overlay`` file in the application folder
222-
223-
Here is an example :ref:`using west build <west-building-dtc-overlay-file>`.
204+
list of overlay files to use. If :makevar:`DTC_OVERLAY_FILE` specifies multiple
205+
files, they are included in that order by the C preprocessor.
206+
207+
You can set :makevar:`DTC_OVERLAY_FILE` to contain exactly the files you want
208+
to use. Here is an example :ref:`using west build
209+
<west-building-dtc-overlay-file>`.
210+
211+
If you don't set :makevar:`DTC_OVERLAY_FILE`, the build system will follow
212+
these steps, looking for files in your application source directory to use
213+
as devicetree overlays:
214+
215+
#. If the file :file:`boards/<BOARD>.overlay` exists, it will be used.
216+
#. If the current board has :ref:`multiple revisions <porting_board_revisions>`
217+
and :file:`boards/<BOARD>_<revision>.overlay` exists, it will be used.
218+
This file will be used in addition to :file:`boards/<BOARD>.overlay`
219+
if both exist.
220+
#. If one or more files have been found in the previous steps, the build system
221+
stops looking and just uses those files.
222+
#. Otherwise, if :file:`<BOARD>.overlay` exists, it will be used, and the build
223+
system will stop looking for more files.
224+
#. Otherwise, if :file:`app.overlay` exists, it will be used.
225+
226+
Using :ref:`shields` will also add devicetree overlay files.
227+
224228
However you set the value, it is saved in the CMake cache between builds.
225229

226230
The :ref:`build system <build_overview>` prints all the devicetree overlays it

0 commit comments

Comments
 (0)