Lines Matching +full:dts +full:- +full:bindings

1 .. _dt-trouble:
8 See :ref:`dt-howtos` for other "HOWTO" style information.
10 .. _dt-trouble-try-pristine:
17 See :ref:`west-building-pristine` for examples, or just delete the build
39 .. code-block:: c
43 where ``NODE_ID`` is a valid :ref:`node identifier <dt-node-identifiers>`, but
53 = "okay";``; see :ref:`dt-important-props` for more information about
73 .. code-block:: none
78 * DTS input file:
79 * <build>/zephyr/zephyr.dts.pre
81 * Directories with bindings:
82 * $ZEPHYR_BASE/dts/bindings
91 Now look for this node in :file:`<build>/zephyr/zephyr.dts`, which is the final
92 devicetree for your application build. (See :ref:`get-devicetree-outputs` for
95 If the node has ``status = "disabled";`` in :file:`zephyr.dts`, then you need
97 :ref:`overlay <set-devicetree-overlays>`. For example, if :file:`zephyr.dts`
100 .. code-block:: DTS
107 :ref:`dt-trouble-try-pristine`:
109 .. code-block:: DTS
115 Make sure that you see ``status = "okay";`` in :file:`zephyr.dts` after you
128 :ref:`device_model_api` pages. See :ref:`dt-important-props` and the Devicetree
138 - Look in :zephyr_file:`drivers` for the appropriate subdirectory that
140 - Look inside that directory for relevant files until you figure out what the
146 example, if your node's compatible is ``vnd,foo-device``, look for a file with this
149 .. code-block:: C
164 .. code-block:: DTS
167 compatible = "nordic,nrf-twim";
172 that handles the compatible ``nordic,nrf-twim``. In this case, that is
183 .. code-block:: cmake
194 making sure to :ref:`dt-trouble-try-pristine`:
196 .. code-block:: cfg
209 .. _dt-use-the-right-names:
216 - In C/C++, devicetree names must be lowercased and special characters must be
217 converted to underscores. Zephyr's generated devicetree header has DTS names
218 converted in this way into the C tokens used by the preprocessor-based
220 - In overlays, use devicetree node and property names the same way they
221 would appear in any DTS file. Zephyr overlays are just DTS fragments.
223 For example, if you're trying to **get** the ``clock-frequency`` property of a
226 .. code-block:: c
229 * foo.c: lowercase-and-underscores names
233 #define MY_CLOCK_FREQ DT_PROP(DT_PATH(soc, i2c@1234000), clock-frequency)
235 * @ should be _ - should be _ */
243 .. code-block:: none
246 * foo.overlay: DTS names with special characters, etc.
254 /* Do this instead. Overlays are just DTS fragments. */
256 clock-frequency = <115200>;
266 .. code-block:: sh
268 west build -b BOARD samples/hello_world -- -DCONFIG_COMPILER_SAVE_TEMPS=y
277 .. code-block:: sh
279 $ find build -name main.c.i
283 them. For example, to use ``clang-format`` to reformat the file in place:
285 .. code-block:: sh
287 clang-format -i build/CMakeFiles/app.dir/src/main.c.i
306 .. code-block:: sh
308 west build -b BOARD samples/hello_world -- -DCONFIG_COMPILER_TRACK_MACRO_EXPANSION=n
317 .. code-block:: c
323 .. code-block:: c
330 isn't referring to a valid node. :ref:`get-devicetree-outputs` and debug from
335 - did you :ref:`dt-use-the-right-names`?
336 - does the :ref:`property exist <dt-checking-property-exists>`?
337 - does the node have a :ref:`matching binding <dt-bindings>`?
338 - does the binding define the property?
340 .. _missing-dt-binding:
342 Check for missing bindings
345 See :ref:`dt-bindings` for information about bindings, and
346 :ref:`devicetree_binding_index` for information on bindings built into Zephyr.
348 If the build fails to :ref:`dts-find-binding` for a node, then either the
351 source file, ``compatible`` should look like ``"vnd,some-device"`` --
352 :ref:`dt-use-the-right-names`.
354 If your binding file is not under :file:`zephyr/dts`, you may need to set
355 :ref:`DTS_ROOT <dts_root>`; see :ref:`dt-where-bindings-are-located`.
361 ``DT_DRV_COMPAT`` to the lowercase-and-underscores version of the compatible
362 you are interested in. See :ref:`dt-create-devices-inst`.