doc: update devicetree sections
Reflect the removal of BOARD.dts.pre.tmp in favor of zephyr.dts.pre in SVG diagrams. Clean up adjacent text. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
2b7c61e306
commit
fa41f4bb8f
4 changed files with 38 additions and 28 deletions
3
doc/guides/build/build-config-phase.svg
generated
3
doc/guides/build/build-config-phase.svg
generated
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 47 KiB |
|
@ -61,8 +61,8 @@ phase (driven by CMake) and a build phase (driven by Make or Ninja).
|
||||||
Configuration Phase
|
Configuration Phase
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
The configuration phase begins when the user invokes *CMake*,
|
The configuration phase begins when the user invokes *CMake* to generate a
|
||||||
specifying a source application directory and a board target.
|
build system, specifying a source application directory and a board target.
|
||||||
|
|
||||||
.. figure:: build-config-phase.svg
|
.. figure:: build-config-phase.svg
|
||||||
:align: center
|
:align: center
|
||||||
|
@ -75,7 +75,10 @@ directory, which refers to the :file:`CMakeLists.txt` file in the Zephyr
|
||||||
top-level directory, which in turn refers to :file:`CMakeLists.txt` files
|
top-level directory, which in turn refers to :file:`CMakeLists.txt` files
|
||||||
throughout the build tree (directly and indirectly). Its primary output is a
|
throughout the build tree (directly and indirectly). Its primary output is a
|
||||||
set of Makefiles or Ninja files to drive the build process, but the CMake
|
set of Makefiles or Ninja files to drive the build process, but the CMake
|
||||||
scripts also do some processing of their own:
|
scripts also do some processing of their own, which is explained here.
|
||||||
|
|
||||||
|
Note that paths beginning with :file:`build/` below refer to the build
|
||||||
|
directory you create when running CMake.
|
||||||
|
|
||||||
Devicetree
|
Devicetree
|
||||||
:file:`*.dts` (*devicetree source*) and :file:`*.dtsi` (*devicetree source
|
:file:`*.dts` (*devicetree source*) and :file:`*.dtsi` (*devicetree source
|
||||||
|
@ -86,19 +89,26 @@ Devicetree
|
||||||
preprocessor (often abbreviated *cpp*, which should not be confused with
|
preprocessor (often abbreviated *cpp*, which should not be confused with
|
||||||
C++). The C preprocessor is also used to merge in any devicetree
|
C++). The C preprocessor is also used to merge in any devicetree
|
||||||
:file:`*.overlay` files, and to expand macros in :file:`*.dts`,
|
:file:`*.overlay` files, and to expand macros in :file:`*.dts`,
|
||||||
:file:`*.dtsi`, and :file:`*.overlay` files.
|
:file:`*.dtsi`, and :file:`*.overlay` files. The preprocessor output is
|
||||||
|
placed in :file:`build/zephyr/zephyr.dts.pre`.
|
||||||
|
|
||||||
The preprocessed devicetree sources (stored in :file:`*.dts.pre.tmp`) are
|
The preprocessed devicetree sources are parsed by
|
||||||
parsed by :zephyr_file:`gen_defines.py <scripts/dts/gen_defines.py>` to
|
:zephyr_file:`gen_defines.py <scripts/dts/gen_defines.py>` to generate a
|
||||||
generate a :file:`devicetree_unfixed.h` header with preprocessor macros.
|
:file:`build/zephyr/include/generated/devicetree_unfixed.h` header with
|
||||||
|
preprocessor macros.
|
||||||
|
|
||||||
As a debugging aid, :file:`gen_defines.py` writes the final devicetree to
|
Source code should access preprocessor macros generated from devicetree by
|
||||||
:file:`zephyr.dts`. This file is just for reference. It is not used
|
including the :zephyr_file:`devicetree.h <include/devicetree.h>` header,
|
||||||
anywhere.
|
which includes :file:`devicetree_unfixed.h`.
|
||||||
|
|
||||||
The ``dtc`` devicetree compiler also gets run on the preprocessed devicetree
|
:file:`gen_defines.py` also writes the final devicetree to
|
||||||
sources to catch any extra warnings and errors generated by it. The output
|
:file:`build/zephyr/zephyr.dts` in the build directory. This file's contents
|
||||||
from ``dtc`` is unused otherwise.
|
may be useful for debugging.
|
||||||
|
|
||||||
|
If the devicetree compiler ``dtc`` is installed, it is run on
|
||||||
|
:file:`build/zephyr/zephyr.dts` to catch any extra warnings and errors
|
||||||
|
generated by this tool. The output from ``dtc`` is unused otherwise, and
|
||||||
|
this step is skipped if ``dtc`` is not installed.
|
||||||
|
|
||||||
The above is just a brief overview. For more information on devicetree, see
|
The above is just a brief overview. For more information on devicetree, see
|
||||||
:ref:`dt-guide`.
|
:ref:`dt-guide`.
|
||||||
|
@ -106,12 +116,8 @@ Devicetree
|
||||||
Devicetree fixups
|
Devicetree fixups
|
||||||
Files named :file:`dts_fixup.h` from the target’s architecture, SoC, board,
|
Files named :file:`dts_fixup.h` from the target’s architecture, SoC, board,
|
||||||
and application directories are concatenated into a single
|
and application directories are concatenated into a single
|
||||||
:file:`devicetree_fixups.h` file. :file:`dts_fixup.h` files are used to
|
:file:`devicetree_fixups.h` file. :file:`dts_fixup.h` files are a legacy
|
||||||
rename generated macros to names expected by the source code.
|
feature which should not be used in new code.
|
||||||
|
|
||||||
Source code accesses preprocessor macros generated from devicetree by
|
|
||||||
including the :zephyr_file:`devicetree.h <include/devicetree.h>` header,
|
|
||||||
which includes :file:`devicetree_unfixed.h` and :file:`devicetree_fixups.h`.
|
|
||||||
|
|
||||||
Kconfig
|
Kconfig
|
||||||
:file:`Kconfig` files define available configuration options for for the
|
:file:`Kconfig` files define available configuration options for for the
|
||||||
|
|
|
@ -630,6 +630,11 @@ These are created in your application's build directory.
|
||||||
Don't include the header files directly. :ref:`dt-from-c` explains
|
Don't include the header files directly. :ref:`dt-from-c` explains
|
||||||
what to do instead.
|
what to do instead.
|
||||||
|
|
||||||
|
:file:`<build>/zephyr/zephyr.dts.pre`
|
||||||
|
The preprocessed DTS source. This is an intermediate output file, which is
|
||||||
|
input to :file:`gen_defines.py` and used to create :file:`zephyr.dts` and
|
||||||
|
:file:`devicetree_unfixed.h`.
|
||||||
|
|
||||||
:file:`<build>/zephyr/include/generated/devicetree_unfixed.h`
|
:file:`<build>/zephyr/include/generated/devicetree_unfixed.h`
|
||||||
The generated macros and additional comments describing the devicetree.
|
The generated macros and additional comments describing the devicetree.
|
||||||
Included by ``devicetree.h``.
|
Included by ``devicetree.h``.
|
||||||
|
@ -639,10 +644,7 @@ These are created in your application's build directory.
|
||||||
Included by ``devicetree.h``.
|
Included by ``devicetree.h``.
|
||||||
|
|
||||||
:file:`<build>/zephyr/zephyr.dts`
|
:file:`<build>/zephyr/zephyr.dts`
|
||||||
The final merged devicetree. This file is output by :file:`gen_defines.py`
|
The final merged devicetree. This file is output by :file:`gen_defines.py`.
|
||||||
as a debugging aid, and is unused otherwise.
|
It is useful for debugging any issues. If the devicetree compiler ``dtc`` is
|
||||||
|
installed, it is also run on this file, to catch any additional warnings or
|
||||||
:file:`<build>/zephyr/<BOARD>.dts.pre.tmp`
|
errors.
|
||||||
The preprocessed and concatenated DTS sources and overlays. This is an
|
|
||||||
intermediate output file, which is used to create :file:`zephyr.dts`
|
|
||||||
and :file:`devicetree_unfixed.h`.
|
|
||||||
|
|
3
doc/guides/dts/zephyr_dt_inputs_outputs.svg
generated
3
doc/guides/dts/zephyr_dt_inputs_outputs.svg
generated
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 24 KiB |
Loading…
Add table
Add a link
Reference in a new issue