From 499d26545b33ec88da11fb3d77a1ac1eb8d5a89d Mon Sep 17 00:00:00 2001 From: Borys Nykytiuk <165832970+BorysNykytiuk@users.noreply.github.com> Date: Fri, 7 Feb 2025 16:25:22 +0200 Subject: [PATCH] telink: add instructions how to use USB logging (#37376) - modify lighting-app telink REDME.md file Signed-off-by: Borys Nykytiuk --- examples/lighting-app/telink/README.md | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/examples/lighting-app/telink/README.md b/examples/lighting-app/telink/README.md index ba41630d9ff37f..d940d55aafe794 100644 --- a/examples/lighting-app/telink/README.md +++ b/examples/lighting-app/telink/README.md @@ -74,6 +74,33 @@ To get output from device, connect UART to following pins: Baud rate: 115200 bits/s +### Using USB COM Port Instead of UART + +Alternatively, the USB COM port can be used instead of UART for console output. + +1. Build the project with the following parameter: + + ```bash + $ west build -b -- -DTLNK_USB_DONGLE=y + ``` + +2. Connect the USB cable to your device. A new serial device should appear in + your system (e.g., `/dev/ttyACM0` on Linux or a COM port on Windows). +3. Use your preferred terminal application (like `minicom`, `screen`, or + `PuTTY`) to connect to the newly detected serial device. +4. In your source code, ensure the following header is included and the USB + device stack is initialized: + + ```c + #ifdef CONFIG_USB_DEVICE_STACK + #include + #endif /* CONFIG_USB_DEVICE_STACK */ + + #ifdef CONFIG_USB_DEVICE_STACK + usb_enable(NULL); + #endif /* CONFIG_USB_DEVICE_STACK */ + ``` + ### Buttons The following buttons are available on **tlsr9518adk80d** board: