Skip to content

Commit 2532d4c

Browse files
committed
samples: openthread: Align with USB changes
Align OpenThread samples with USB changes. Signed-off-by: Robert Lubos <[email protected]>
1 parent c7c95e5 commit 2532d4c

File tree

7 files changed

+40
-7
lines changed

7 files changed

+40
-7
lines changed

samples/openthread/cli/overlay-usb.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
CONFIG_SHELL_BACKEND_SERIAL_INIT_PRIORITY=51
88

99
CONFIG_UART_LINE_CTRL=y
10-
CONFIG_UART_SHELL_ON_DEV_NAME="CDC_ACM_0"
1110

1211
CONFIG_USB_DEVICE_STACK=y
1312
CONFIG_USB_DEVICE_MANUFACTURER="Nordic Semiconductor ASA"

samples/openthread/cli/sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ tests:
2626
platform_allow: nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns nrf52840dk_nrf52840 nrf52840dongle_nrf52840 nrf52833dk_nrf52833 nrf21540dk_nrf52840
2727
tags: ci_build
2828
extra_args: OVERLAY_CONFIG=overlay-usb.conf
29+
DTC_OVERLAY_FILE="usb.overlay"
2930
integration_platforms:
3031
- nrf5340dk_nrf5340_cpuapp
3132
- nrf5340dk_nrf5340_cpuapp_ns

samples/openthread/cli/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void main(void)
4141
return;
4242
}
4343

44-
dev = device_get_binding(CONFIG_UART_SHELL_ON_DEV_NAME);
44+
dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_shell_uart));
4545
if (dev == NULL) {
4646
LOG_ERR("Failed to find specific UART device");
4747
return;

samples/openthread/cli/usb.overlay

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2021 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
chosen {
9+
zephyr,shell-uart = &cdc_acm_uart0;
10+
};
11+
};
12+
13+
&zephyr_udc0 {
14+
cdc_acm_uart0: cdc_acm_uart0 {
15+
compatible = "zephyr,cdc-acm-uart";
16+
label = "CDC_ACM_0";
17+
};
18+
};

samples/openthread/coprocessor/overlay-usb.conf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
# Use USB-CDC-ACM for Co-Processor
8-
CONFIG_OPENTHREAD_COPROCESSOR_SPINEL_ON_UART_ACM=y
9-
CONFIG_OPENTHREAD_COPROCESSOR_SPINEL_ON_UART_DEV_NAME="CDC_ACM_0"
10-
117
CONFIG_USB_DEVICE_STACK=y
128
CONFIG_USB_CDC_ACM=y
139
CONFIG_USB_DEVICE_MANUFACTURER="Nordic Semiconductor ASA"

samples/openthread/coprocessor/sample.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ tests:
2424
build_only: true
2525
platform_allow: nrf52840dk_nrf52840 nrf52840dongle_nrf52840 nrf52833dk_nrf52833 nrf21540dk_nrf52840
2626
tags: ci_build
27-
extra_args: OVERLAY_CONFIG=overlay-usb.conf;
27+
extra_args: OVERLAY_CONFIG=overlay-usb.conf
28+
DTC_OVERLAY_FILE="usb.overlay"
2829
integration_platforms:
2930
- nrf52840dk_nrf52840
3031
- nrf52840dongle_nrf52840
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2021 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
chosen {
9+
zephyr,ot-uart = &cdc_acm_uart0;
10+
};
11+
};
12+
13+
&zephyr_udc0 {
14+
cdc_acm_uart0: cdc_acm_uart0 {
15+
compatible = "zephyr,cdc-acm-uart";
16+
label = "CDC_ACM_0";
17+
};
18+
};

0 commit comments

Comments
 (0)