@@ -61,8 +61,8 @@ phase (driven by CMake) and a build phase (driven by Make or Ninja).
6161Configuration Phase
6262-------------------
6363
64- The configuration phase begins when the user invokes *CMake *,
65- specifying a source application directory and a board target.
64+ The configuration phase begins when the user invokes *CMake * to generate a
65+ build system, specifying a source application directory and a board target.
6666
6767.. figure :: build-config-phase.svg
6868 :align: center
@@ -75,7 +75,10 @@ directory, which refers to the :file:`CMakeLists.txt` file in the Zephyr
7575top-level directory, which in turn refers to :file: `CMakeLists.txt ` files
7676throughout the build tree (directly and indirectly). Its primary output is a
7777set of Makefiles or Ninja files to drive the build process, but the CMake
78- scripts also do some processing of their own:
78+ scripts also do some processing of their own, which is explained here.
79+
80+ Note that paths beginning with :file: `build/ ` below refer to the build
81+ directory you create when running CMake.
7982
8083Devicetree
8184 :file: `*.dts ` (*devicetree source *) and :file: `*.dtsi ` (*devicetree source
@@ -86,32 +89,35 @@ Devicetree
8689 preprocessor (often abbreviated *cpp *, which should not be confused with
8790 C++). The C preprocessor is also used to merge in any devicetree
8891 :file: `*.overlay ` files, and to expand macros in :file: `*.dts `,
89- :file: `*.dtsi `, and :file: `*.overlay ` files.
92+ :file: `*.dtsi `, and :file: `*.overlay ` files. The preprocessor output is
93+ placed in :file: `build/zephyr/zephyr.dts.pre `.
94+
95+ The preprocessed devicetree sources are parsed by
96+ :zephyr_file: `gen_defines.py <scripts/dts/gen_defines.py> ` to generate a
97+ :file: `build/zephyr/include/generated/devicetree_unfixed.h ` header with
98+ preprocessor macros.
9099
91- The preprocessed devicetree sources (stored in :file: ` *.dts.pre.tmp `) are
92- parsed by :zephyr_file: `gen_defines.py <scripts/dts/gen_defines.py > ` to
93- generate a :file: `devicetree_unfixed.h ` header with preprocessor macros .
100+ Source code should access preprocessor macros generated from devicetree by
101+ including the :zephyr_file: `devicetree.h <include/devicetree.h > ` header,
102+ which includes :file: `devicetree_unfixed.h `.
94103
95- As a debugging aid, :file: `gen_defines.py ` writes the final devicetree to
96- :file: `zephyr.dts `. This file is just for reference. It is not used
97- anywhere .
104+ :file: `gen_defines.py ` also writes the final devicetree to
105+ :file: `build/ zephyr/zephyr .dts ` in the build directory. This file's contents
106+ may be useful for debugging .
98107
99- The ``dtc `` devicetree compiler also gets run on the preprocessed devicetree
100- sources to catch any extra warnings and errors generated by it. The output
101- from ``dtc `` is unused otherwise.
108+ If the devicetree compiler ``dtc `` is installed, it is run on
109+ :file: `build/zephyr/zephyr.dts ` to catch any extra warnings and errors
110+ generated by this tool. The output from ``dtc `` is unused otherwise, and
111+ this step is skipped if ``dtc `` is not installed.
102112
103113 The above is just a brief overview. For more information on devicetree, see
104114 :ref: `dt-guide `.
105115
106116Devicetree fixups
107117 Files named :file: `dts_fixup.h ` from the target’s architecture, SoC, board,
108118 and application directories are concatenated into a single
109- :file: `devicetree_fixups.h ` file. :file: `dts_fixup.h ` files are used to
110- rename generated macros to names expected by the source code.
111-
112- Source code accesses preprocessor macros generated from devicetree by
113- including the :zephyr_file: `devicetree.h <include/devicetree.h> ` header,
114- which includes :file: `devicetree_unfixed.h ` and :file: `devicetree_fixups.h `.
119+ :file: `devicetree_fixups.h ` file. :file: `dts_fixup.h ` files are a legacy
120+ feature which should not be used in new code.
115121
116122Kconfig
117123 :file: `Kconfig ` files define available configuration options for for the
0 commit comments