Skip to content

Commit

Permalink
docs: Add diagnosis pointers for Kconfig/devicetree outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
caksoylar committed Jan 25, 2025
1 parent 4f72e7c commit 9793523
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions docs/docs/troubleshooting/building-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,47 @@ Key positions are numbered starting from `0` at the top left key on the keymap,
:::tip
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`.
:::

## Diagnosing Unexpected Build Results

### Configuration Setting Issues

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.
This file will display values for all set configurations includes user, keyboard, ZMK and Zephyr-level settings.

If using GitHub Actions to build your firmware, the contents of this file are displayed in the "<keyboard> Kconfig file" step in your build job:

![](../assets/troubleshooting/building/kconfig-step.png)

If you are building locally, this file can be found inside the build folder at `<build_folder>/zephyr/.config`.

Additionally, build logs (displayed in "West Build (<keyboard>)" step in GitHub Actions) also display what configuration files were found and used in the build:

```
+ 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
...
-- ZMK Config Kconfig: /tmp/zmk-config/config/corneish_zen.conf
...
```

### Devicetree-related Issues

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.
This file will contain a single devicetree that is the result of all user, keyboard (board and/or shield) devicetree settings.
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`.

If using GitHub Actions to build your firmware, the contents of this file are displayed in the "<keyboard> Devicetree file" step in your build job:

![](../assets/troubleshooting/building/devicetree-step.png)

If you are building locally, this file can be found inside the build folder at `<build_folder>/zephyr/zephyr.dts`.

Additionally, build logs (displayed in "West Build (<keyboard>)" step in GitHub Actions) also display what devicetree files were found and used in the build:

```
+ 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
...
-- Found BOARD.dts: /tmp/zmk-config/zmk/app/boards/arm/corneish_zen/corneish_zen_v2_left.dts
-- Found devicetree overlay: /tmp/zmk-config/config/corneish_zen.keymap
...
```

0 comments on commit 9793523

Please sign in to comment.