Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Cem Aksoylar <[email protected]>
  • Loading branch information
petejohanson and caksoylar authored Jun 20, 2024
1 parent 579419b commit 6f8af2a
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions docs/docs/development/usb-logging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ It is recommended to only enable logging when needed, and not leaving it on by d

## USB Logging Snippet

Using the `zmk-usb-logging` snippet is used to enable logging.
The `zmk-usb-logging` snippet is used to enable logging.

If using GitHub Actions to build your firmware, enabling logging
requires adding a `snippet: zmk-usb-logging` for any build you want logging enabled, e.g.
requires adding a `snippet: zmk-usb-logging` to your `build.yaml` file for any build you want logging enabled, e.g.

```
```yaml
---
include:
- board: nice_nano_v2
Expand All @@ -35,8 +35,8 @@ include:
When building locally, the `-S`/`--snippet` flag can be passed to `west build` to enable the snippet, e.g.

```
$ west build -b nice_nano_v2 -S zmk-usb-logging -- -DSHIELD="corne_left"
```sh
west build -b nice_nano_v2 -S zmk-usb-logging -- -DSHIELD="corne_left"
```

### Additional Config
Expand Down Expand Up @@ -96,22 +96,20 @@ From there, you should see the various log messages from ZMK and Zephyr, dependi

Standard boards such as the nice!nano and Seeeduino XIAO family have the necessary configuration for logging already added, however if you are developing your own standalone board you may wish to add the ability to use USB logging in the future.

To do so, you need to follow the upstream Zephyr [`cdc-acm-console` snippet requirements](https://docs.zephyrproject.org/3.6.0/snippets/cdc-acm-console/README.html#requirements) steps.
To do so, you need to follow the upstream Zephyr [`cdc-acm-console` snippet requirements](https://docs.zephyrproject.org/3.5.0/snippets/cdc-acm-console/README.html#requirements) steps.

Usually, this just requires ensuring that the USB node has been tagged with the `zephyr_udc0` label, e.g.

```
```dts
zephyr_udc0: &usbd {
status = "okay";
};
```

## Enabling Logging On Older Boards

Previously, enabling logging required editing Kconfig files to enable logging. If for whatever reason a build fails when using
a custom board definiton that does not support the new `zmk-usb-logging` snippet, you can use the following steps:
## Enabling Logging on Older Boards

The `CONFIG_ZMK_USB_LOGGING` Kconfig enables USB logging. This can be set at the keyboard level, typically in the `config/<your_keyboard>.conf`
Previously, enabling logging required setting the `CONFIG_ZMK_USB_LOGGING` Kconfig symbol. If for whatever reason
a custom board definition does not support the new `zmk-usb-logging` snippet, you can try setting this symbol at the keyboard level, typically in the `config/<your_keyboard>.conf`
file if you are using a [user config repository](user-setup.mdx). It can also be enabled at the ZMK level using the `app/prj.conf` file, or other
search locations described in the [configuration overview](config/index.md#config-file-locations).

Expand Down

0 comments on commit 6f8af2a

Please sign in to comment.