Skip to content

Commit 8deebeb

Browse files
telink: add instructions how to use USB logging (#37376)
- modify lighting-app telink REDME.md file Signed-off-by: Borys Nykytiuk <borys.nykytiuk@telink-semi.com>
1 parent ff5f8fd commit 8deebeb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

examples/lighting-app/telink/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,33 @@ To get output from device, connect UART to following pins:
7474

7575
Baud rate: 115200 bits/s
7676

77+
### Using USB COM Port Instead of UART
78+
79+
Alternatively, the USB COM port can be used instead of UART for console output.
80+
81+
1. Build the project with the following parameter:
82+
83+
```bash
84+
$ west build -b <build_target> -- -DTLNK_USB_DONGLE=y
85+
```
86+
87+
2. Connect the USB cable to your device. A new serial device should appear in
88+
your system (e.g., `/dev/ttyACM0` on Linux or a COM port on Windows).
89+
3. Use your preferred terminal application (like `minicom`, `screen`, or
90+
`PuTTY`) to connect to the newly detected serial device.
91+
4. In your source code, ensure the following header is included and the USB
92+
device stack is initialized:
93+
94+
```c
95+
#ifdef CONFIG_USB_DEVICE_STACK
96+
#include <zephyr/usb/usb_device.h>
97+
#endif /* CONFIG_USB_DEVICE_STACK */
98+
99+
#ifdef CONFIG_USB_DEVICE_STACK
100+
usb_enable(NULL);
101+
#endif /* CONFIG_USB_DEVICE_STACK */
102+
```
103+
77104
### Buttons
78105

79106
The following buttons are available on **tlsr9518adk80d** board:

0 commit comments

Comments
 (0)