Lines Matching +full:i2c +full:- +full:errors
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
71 the node you are interested in is ``/soc/i2c@deadbeef``:
73 .. code-block:: none
88 * 15 /soc/i2c@deadbeef
92 devicetree for your application build. (See :ref:`get-devicetree-outputs` for
97 :ref:`overlay <set-devicetree-overlays>`. For example, if :file:`zephyr.dts`
100 .. code-block:: DTS
102 i2c0: i2c@deadbeef {
107 :ref:`dt-trouble-try-pristine`:
109 .. code-block:: DTS
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
166 i2c0: i2c@deadbeef {
167 compatible = "nordic,nrf-twim";
171 Then you would look inside of :zephyr_file:`drivers/i2c` for the driver file
172 that handles the compatible ``nordic,nrf-twim``. In this case, that is
173 :zephyr_file:`drivers/i2c/i2c_nrfx_twim.c`. Notice how even in cases where
181 :zephyr_file:`drivers/i2c/CMakeLists.txt` has a line that looks like this:
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
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
223 For example, if you're trying to **get** the ``clock-frequency`` property of a
224 node with path ``/soc/i2c@12340000`` in a C/C++ file:
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
249 /* Don't do this; you'll get devicetree errors. */
255 &{/soc/i2c@12340000/} {
256 clock-frequency = <115200>;
264 :zephyr:code-sample:`hello_world` with west with this option set, use:
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
295 Compiler messages for devicetree errors can sometimes be very long. This
303 For example, to build :zephyr:code-sample:`hello_world` with west and this option disabled,
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:
345 See :ref:`dt-bindings` for information about bindings, and
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`.
355 :ref:`DTS_ROOT <dts_root>`; see :ref:`dt-where-bindings-are-located`.
357 Errors with DT_INST_() APIs
361 ``DT_DRV_COMPAT`` to the lowercase-and-underscores version of the compatible
362 you are interested in. See :ref:`dt-create-devices-inst`.