From ae22c697b3dca9bf1f24a00f1ab0c0e4549cd7fd Mon Sep 17 00:00:00 2001 From: Stancu Florin Date: Thu, 18 Aug 2022 13:25:15 +0300 Subject: [PATCH] boards: cc1352r1_launchxl: fix echo samples Recent Zephyr changes (IEEE 802.15.4 config moved from KConfig to DeviceTree) left the TI CC1352r1_launchxl board's net examples in a non-working state, mainly due to the fact that CC13x2 has two IEEE802154 interfaces available (2.4GHz and sub-GHz) and none were enabled. This commit enables the 2.4GHz radio inside the board's DTS and also introduces a new devicetree overlay inside the echo* samples: 'boards/boards/cc1352-enable-subg.overlay', enabling the sub-GHz interface. Signed-off-by: Stancu Florin --- .../cc1352r1_launchxl/cc1352r1_launchxl.dts | 13 +++++++++++ .../boards/cc1352-enable-subg.overlay | 23 +++++++++++++++++++ .../echo_client/overlay-802154-subg.conf | 3 +++ .../boards/cc1352-enable-subg.overlay | 23 +++++++++++++++++++ .../echo_server/overlay-802154-subg.conf | 3 +++ 5 files changed, 65 insertions(+) create mode 100644 samples/net/sockets/echo_client/boards/cc1352-enable-subg.overlay create mode 100644 samples/net/sockets/echo_server/boards/cc1352-enable-subg.overlay diff --git a/boards/arm/cc1352r1_launchxl/cc1352r1_launchxl.dts b/boards/arm/cc1352r1_launchxl/cc1352r1_launchxl.dts index 18f1cce56ad..b98da899ef7 100644 --- a/boards/arm/cc1352r1_launchxl/cc1352r1_launchxl.dts +++ b/boards/arm/cc1352r1_launchxl/cc1352r1_launchxl.dts @@ -28,6 +28,7 @@ zephyr,flash = &flash0; zephyr,console = &uart0; zephyr,shell-uart = &uart0; + zephyr,ieee802154 = &ieee802154; }; leds { @@ -112,3 +113,15 @@ &rtc { status = "okay"; }; + +&radio { + status = "okay"; +}; + +&ieee802154 { + status = "okay"; +}; + +&ieee802154g { + status = "disabled"; +}; diff --git a/samples/net/sockets/echo_client/boards/cc1352-enable-subg.overlay b/samples/net/sockets/echo_client/boards/cc1352-enable-subg.overlay new file mode 100644 index 00000000000..ff82423b77d --- /dev/null +++ b/samples/net/sockets/echo_client/boards/cc1352-enable-subg.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Florin Stancu + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * Overlay to enable for CC1352R1 / CC1352P1-based boards. + */ + +/ { + chosen { + zephyr,ieee802154 = &ieee802154g; + }; +}; + +&ieee802154 { + status = "disabled"; +}; + +&ieee802154g { + status = "okay"; +}; diff --git a/samples/net/sockets/echo_client/overlay-802154-subg.conf b/samples/net/sockets/echo_client/overlay-802154-subg.conf index e529a4c8f14..d9e479bfa43 100644 --- a/samples/net/sockets/echo_client/overlay-802154-subg.conf +++ b/samples/net/sockets/echo_client/overlay-802154-subg.conf @@ -15,4 +15,7 @@ CONFIG_NET_L2_IEEE802154=y CONFIG_NET_L2_IEEE802154_SHELL=y CONFIG_NET_L2_IEEE802154_LOG_LEVEL_INF=y +# Uncomment for 868 MHz +#CONFIG_NET_CONFIG_IEEE802154_CHANNEL=0 +# Uncomment for 906 MHz: CONFIG_NET_CONFIG_IEEE802154_CHANNEL=1 diff --git a/samples/net/sockets/echo_server/boards/cc1352-enable-subg.overlay b/samples/net/sockets/echo_server/boards/cc1352-enable-subg.overlay new file mode 100644 index 00000000000..ff82423b77d --- /dev/null +++ b/samples/net/sockets/echo_server/boards/cc1352-enable-subg.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Florin Stancu + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * Overlay to enable for CC1352R1 / CC1352P1-based boards. + */ + +/ { + chosen { + zephyr,ieee802154 = &ieee802154g; + }; +}; + +&ieee802154 { + status = "disabled"; +}; + +&ieee802154g { + status = "okay"; +}; diff --git a/samples/net/sockets/echo_server/overlay-802154-subg.conf b/samples/net/sockets/echo_server/overlay-802154-subg.conf index cda923ec621..66da936e300 100644 --- a/samples/net/sockets/echo_server/overlay-802154-subg.conf +++ b/samples/net/sockets/echo_server/overlay-802154-subg.conf @@ -13,4 +13,7 @@ CONFIG_NET_L2_IEEE802154=y CONFIG_NET_L2_IEEE802154_SHELL=y CONFIG_NET_L2_IEEE802154_LOG_LEVEL_INF=y +# Uncomment for 868 MHz +#CONFIG_NET_CONFIG_IEEE802154_CHANNEL=0 +# Uncomment for 906 MHz: CONFIG_NET_CONFIG_IEEE802154_CHANNEL=1