|
| 1 | +.. _external_module_dtsh: |
| 2 | + |
| 3 | +dtsh |
| 4 | +####################### |
| 5 | + |
| 6 | +Introduction |
| 7 | +************ |
| 8 | + |
| 9 | +`DTSh <DTSh-Handbook_>`_ is an interactive DTS file viewer with |
| 10 | +a shell-like command line interface: |
| 11 | + |
| 12 | +- easily *navigate* and *visualize* the devicetree |
| 13 | +- find nodes based on e.g. supported bus protocols, bindings, generated IRQs, |
| 14 | + memory size, or keywords like "sensor" or "PWM" |
| 15 | +- redirect commands output to files (text, HTML, SVG) |
| 16 | + to document hardware configurations or simply take notes |
| 17 | +- contextual auto-completion, commands history, semantic highlighting, user profiles |
| 18 | +- script-able (aka batch modes) |
| 19 | + |
| 20 | +This Zephyr module adds DTSh as a West extension to your Zephyr workspace. |
| 21 | + |
| 22 | + |
| 23 | +Usage with Zephyr |
| 24 | +***************** |
| 25 | + |
| 26 | +To install the DTSh module, you will need to define your own manifest file, |
| 27 | +or pull it in by adding a submanifest. |
| 28 | + |
| 29 | +E.g. assuming the same paths as in `Zephyr Getting Started Guide`_, |
| 30 | +create ``zephyrproject/zephyr/submanifests/dtsh.yaml`` with the following content: |
| 31 | + |
| 32 | +.. code-block:: yaml |
| 33 | +
|
| 34 | + manifest: |
| 35 | + projects: |
| 36 | + - name: dtsh |
| 37 | + url: https://github.com/dottspina/dtsh.git |
| 38 | + revision: zephyr |
| 39 | + path: modules/tools/dtsh |
| 40 | + west-commands: scripts/west-commands.yml |
| 41 | +
|
| 42 | +
|
| 43 | +Then update the workspace and install DTSh requirements: |
| 44 | + |
| 45 | +.. code-block:: sh |
| 46 | +
|
| 47 | + west update dtsh |
| 48 | + west packages -m dtsh pip --install |
| 49 | +
|
| 50 | +.. note:: |
| 51 | + |
| 52 | + ``west update dtsh`` will fetch all tags from the `DTSh project <DTSh-project_>`_: ignore them, |
| 53 | + they don't point to versions of this Zephyr module, and are entirely irrelevant here. |
| 54 | + |
| 55 | + |
| 56 | +The West command |
| 57 | +***************** |
| 58 | + |
| 59 | +Once installed, this project/module should provide the ``west dtsh`` command. |
| 60 | + |
| 61 | +.. code-block:: none |
| 62 | +
|
| 63 | + $ west build |
| 64 | + $ west dtsh |
| 65 | + dtsh (0.2.5-zephyr): Shell-like interface with Devicetree |
| 66 | + How to exit: q, or quit, or exit, or press Ctrl-D |
| 67 | +
|
| 68 | + / |
| 69 | + > cd &flash_controller |
| 70 | +
|
| 71 | + /soc/flash-controller@4001e000 |
| 72 | + > find -E --also-known-as (image|storage).* --format NKd -T |
| 73 | + Also Known As Description |
| 74 | + ─────────────────────────────────────────────────────────────────────────────────── |
| 75 | + flash-controller@4001e000 flash_controller Nordic NVMC (Non-Volatile Memory Controller) |
| 76 | + └── flash@0 flash0 Flash node |
| 77 | + └── partitions This binding is used to describe fixed partitions… |
| 78 | + ├── partition@c000 image-0, slot0_partition Each child node of the fixed-partitions node represents… |
| 79 | + ├── partition@82000 image-1, slot1_partition Each child node of the fixed-partitions node represents… |
| 80 | + └── partition@f8000 storage, storage_partition Each child node of the fixed-partitions node represents… |
| 81 | +
|
| 82 | +
|
| 83 | +For the full West command synopsis, run ``west dtsh -h``. |
| 84 | + |
| 85 | +.. note:: |
| 86 | + |
| 87 | + It's recommended to install the module to its default location, ``modules/tools/dtsh``. |
| 88 | + Otherwise, be sure to set the ``ZEPHYR_BASE`` environment variable before running ``west dtsh``. |
| 89 | + |
| 90 | + |
| 91 | +Reference |
| 92 | +********* |
| 93 | + |
| 94 | +- `DTSh project <DTSh-project_>`_ |
| 95 | +- `DTSh Handbook <DTSh-Handbook_>`_ |
| 96 | +- `dtsh module <dtsh-module_>`_ |
| 97 | + |
| 98 | + |
| 99 | +.. _DTSh-project: https://github.com/dottspina/dtsh |
| 100 | + |
| 101 | +.. _DTSh-Handbook: https://dottspina.github.io/dtsh/handbook.html |
| 102 | + |
| 103 | +.. _dtsh-module: https://github.com/dottspina/dtsh/tree/zephyr |
| 104 | + |
| 105 | +.. _Zephyr Getting Started Guide: https://docs.zephyrproject.org/latest/develop/getting_started/ |
0 commit comments