Skip to content

Commit 72b00b3

Browse files
authored
docs: Add pointers to final Kconfig/devicetree files (#2796)
docs: Add diagnosis pointers for Kconfig/devicetree outputs docs: Add tip boxes for diagnosing config/devicetree changes
1 parent e4885d5 commit 72b00b3

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed
Loading
Loading

docs/docs/config/index.md

+12
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ The list of available settings is determined by various files in ZMK whose names
8282

8383
See [Zephyr's Kconfig documentation](https://docs.zephyrproject.org/3.5.0/build/kconfig/index.html) for more details on Kconfig files.
8484

85+
:::tip
86+
87+
You can investigate the [final set of configuration settings](../troubleshooting/building-issues.md#configuration-setting-issues) that are in effect during a build to diagnose any issues with changing Kconfig settings.
88+
89+
:::
90+
8591
### KConfig Value Types
8692

8793
#### bool
@@ -131,6 +137,12 @@ Devicetree properties apply to specific nodes in the tree instead of globally. T
131137

132138
See [Zephyr's Devicetree guide](https://docs.zephyrproject.org/3.5.0/build/dts/index.html) for more details on Devicetree files.
133139

140+
:::tip
141+
142+
You can investigate the [final combined Devicetree](../troubleshooting/building-issues.md#devicetree-related-issues) produced during a build to diagnose any issues with changing Devicetree nodes.
143+
144+
:::
145+
134146
### Changing Devicetree Properties
135147

136148
Since Devicetree properties are set for specific nodes in the tree, you will first need to find the node you want to configure. You will typically need to

docs/docs/troubleshooting/building-issues.md

+44
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,47 @@ Key positions are numbered starting from `0` at the top left key on the keymap,
6060
:::tip
6161
A common mistake that leads to this error is to use [key press keycodes](keymaps/behaviors/key-press.md) without the leading `&kp` binding. That is, having entries such as `SPACE` that should have been `&kp SPACE`.
6262
:::
63+
64+
## Diagnosing Unexpected Build Results
65+
66+
### Configuration Setting Issues
67+
68+
If you want to ensure that the [configuration settings](../config/index.md#kconfig-files) you intend to change are changed in the build, you can check the final compiled Kconfig file that the firmware build process produces.
69+
This file will display values for all set configurations and includes user, board, shield (if used in build), ZMK, and Zephyr-level settings.
70+
71+
When using GitHub Actions to build your firmware, the contents of this file are displayed in the "`<keyboard>` Kconfig file" step in your build job:
72+
73+
![](../assets/troubleshooting/building/kconfig-step.png)
74+
75+
If you are building locally, this file can be found inside the build folder at `<build_folder>/zephyr/.config`.
76+
77+
Additionally, the build command (in "West Build (`<keyboard>`)" step in GitHub Actions) logs what configuration files were found and used in the build:
78+
79+
```
80+
+ west build -s zmk/app -d /tmp/tmp.8cJefinXCb -b corneish_zen_v2_left -- -DZMK_CONFIG=/tmp/zmk-config/config -DZMK_EXTRA_MODULES=/__w/zmk-config/zmk-config
81+
...
82+
-- ZMK Config Kconfig: /tmp/zmk-config/config/corneish_zen.conf
83+
...
84+
```
85+
86+
### Devicetree-related Issues
87+
88+
If you want to ensure that your [devicetree files](../config/index.md#devicetree-files) are processed as you expect, you can check the final compiled devicetree file that the firmware build process produces.
89+
This file will contain a single devicetree that combines all of user, board, and shield (if used in build) devicetree files.
90+
Note that while it will include your keymap contents in it, [keycodes](../keymaps/list-of-keycodes.mdx) like `SPACE` will be displayed instead as hexadecimal numbers like `0x7002a`.
91+
92+
When using GitHub Actions to build your firmware, the contents of this file are displayed in the "`<keyboard>` Devicetree file" step in your build job:
93+
94+
![](../assets/troubleshooting/building/devicetree-step.png)
95+
96+
If you are building locally, this file can be found inside the build folder at `<build_folder>/zephyr/zephyr.dts`.
97+
98+
Additionally, the build command (in "West Build (`<keyboard>`)" step in GitHub Actions) logs what devicetree files were found and used in the build:
99+
100+
```
101+
+ west build -s zmk/app -d /tmp/tmp.8cJefinXCb -b corneish_zen_v2_left -- -DZMK_CONFIG=/tmp/zmk-config/config -DZMK_EXTRA_MODULES=/__w/zmk-config/zmk-config
102+
...
103+
-- Found BOARD.dts: /tmp/zmk-config/zmk/app/boards/arm/corneish_zen/corneish_zen_v2_left.dts
104+
-- Found devicetree overlay: /tmp/zmk-config/config/corneish_zen.keymap
105+
...
106+
```

0 commit comments

Comments
 (0)