From 9659f9d14d9170d82ece1232442dde6fcce7316c Mon Sep 17 00:00:00 2001 From: Krzysztof Taborowski Date: Fri, 19 Apr 2024 15:37:34 +0200 Subject: [PATCH 1/6] samples: add rak board it builds Signed-off-by: Krzysztof Taborowski --- .../boards/rak4631_nrf52840.conf | 7 +++ .../boards/rak4631_nrf52840.overlay | 57 +++++++++++++++++++ .../pm_static_rak4631_nrf52840.yml | 5 ++ 3 files changed, 69 insertions(+) create mode 100644 samples/sid_end_device/boards/rak4631_nrf52840.conf create mode 100644 samples/sid_end_device/boards/rak4631_nrf52840.overlay create mode 100644 samples/sid_end_device/pm_static_rak4631_nrf52840.yml diff --git a/samples/sid_end_device/boards/rak4631_nrf52840.conf b/samples/sid_end_device/boards/rak4631_nrf52840.conf new file mode 100644 index 0000000000..77eb8c97b8 --- /dev/null +++ b/samples/sid_end_device/boards/rak4631_nrf52840.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_SIDEWALK_DFU=n diff --git a/samples/sid_end_device/boards/rak4631_nrf52840.overlay b/samples/sid_end_device/boards/rak4631_nrf52840.overlay new file mode 100644 index 0000000000..07c9e35a5a --- /dev/null +++ b/samples/sid_end_device/boards/rak4631_nrf52840.overlay @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +sid_semtech: &spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + clock-frequency = ; +}; + +/{ + semtech_sx1262_gpios{ + compatible = "gpio-keys"; + semtech_sx1262_cs: cs { + gpios = <&gpio1 0x8 GPIO_ACTIVE_LOW>; + label = "semtech_sx1262 CS"; + }; + semtech_sx1262_reset_gpios: reset { + gpios = <&gpio0 0x3 GPIO_ACTIVE_LOW>; + label = "semtech_sx1262 Reset"; + }; + semtech_sx1262_busy_gpios: busy { + gpios = <&gpio1 0x4 GPIO_ACTIVE_HIGH>; + label = "semtech_sx1262 Busy"; + }; + semtech_sx1262_antenna_enable_gpios: antena_enable { + gpios = <&gpio1 0xa GPIO_ACTIVE_HIGH>; + label = "semtech_sx1262 Antena Enable"; + }; + semtech_sx1262_dio1_gpios: dio1 { + gpios = <&gpio1 0x6 GPIO_ACTIVE_HIGH>; + label = "semtech_sx1262 DIO1"; + }; + }; +}; + +&spi1_default { + group1 { + psels = , + , + ; + }; +}; + +&spi1_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; +}; diff --git a/samples/sid_end_device/pm_static_rak4631_nrf52840.yml b/samples/sid_end_device/pm_static_rak4631_nrf52840.yml new file mode 100644 index 0000000000..658ce757c1 --- /dev/null +++ b/samples/sid_end_device/pm_static_rak4631_nrf52840.yml @@ -0,0 +1,5 @@ +mfg_storage: + address: 0xff000 + end_address: 0x100000 + region: flash_primary + size: 0x1000 From 2fe08ddb66cf363a19995a1a7ac8098a0abc0de4 Mon Sep 17 00:00:00 2001 From: Krzysztof Taborowski Date: Fri, 19 Apr 2024 15:37:34 +0200 Subject: [PATCH 2/6] samples: update rak board pins based on zephyr/boards/arm/rak4631_nrf52840/rak4631_nrf52840.dts antena_enable unknow Signed-off-by: Krzysztof Taborowski --- .../boards/rak4631_nrf52840.overlay | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/samples/sid_end_device/boards/rak4631_nrf52840.overlay b/samples/sid_end_device/boards/rak4631_nrf52840.overlay index 07c9e35a5a..db9780e0d7 100644 --- a/samples/sid_end_device/boards/rak4631_nrf52840.overlay +++ b/samples/sid_end_device/boards/rak4631_nrf52840.overlay @@ -17,23 +17,23 @@ sid_semtech: &spi1 { semtech_sx1262_gpios{ compatible = "gpio-keys"; semtech_sx1262_cs: cs { - gpios = <&gpio1 0x8 GPIO_ACTIVE_LOW>; + gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; label = "semtech_sx1262 CS"; }; semtech_sx1262_reset_gpios: reset { - gpios = <&gpio0 0x3 GPIO_ACTIVE_LOW>; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; label = "semtech_sx1262 Reset"; }; semtech_sx1262_busy_gpios: busy { - gpios = <&gpio1 0x4 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; label = "semtech_sx1262 Busy"; }; semtech_sx1262_antenna_enable_gpios: antena_enable { - gpios = <&gpio1 0xa GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; label = "semtech_sx1262 Antena Enable"; }; semtech_sx1262_dio1_gpios: dio1 { - gpios = <&gpio1 0x6 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; label = "semtech_sx1262 DIO1"; }; }; @@ -41,17 +41,17 @@ sid_semtech: &spi1 { &spi1_default { group1 { - psels = , - , - ; + psels = , + , + ; }; }; &spi1_sleep { group1 { - psels = , - , - ; + psels = , + , + ; low-power-enable; }; }; From bb0a0d4f718f1546bbddb2f6fe1054924f6d8263 Mon Sep 17 00:00:00 2001 From: Krzysztof Taborowski Date: Fri, 19 Apr 2024 15:37:34 +0200 Subject: [PATCH 3/6] samples: add rak specyfic configuration enable rtt shell change bt name Signed-off-by: Krzysztof Taborowski --- samples/sid_end_device/boards/rak4631_nrf52840.conf | 1 + samples/sid_end_device/prj.conf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/sid_end_device/boards/rak4631_nrf52840.conf b/samples/sid_end_device/boards/rak4631_nrf52840.conf index 77eb8c97b8..ac3e671ef8 100644 --- a/samples/sid_end_device/boards/rak4631_nrf52840.conf +++ b/samples/sid_end_device/boards/rak4631_nrf52840.conf @@ -5,3 +5,4 @@ # CONFIG_SIDEWALK_DFU=n +CONFIG_SHELL_BACKEND_RTT=y diff --git a/samples/sid_end_device/prj.conf b/samples/sid_end_device/prj.conf index 9c80ed925b..f693ffcab8 100644 --- a/samples/sid_end_device/prj.conf +++ b/samples/sid_end_device/prj.conf @@ -15,7 +15,7 @@ CONFIG_LOG_BUFFER_SIZE=2048 CONFIG_NVS_LOG_LEVEL_WRN=y # Bluetooth -CONFIG_BT_DEVICE_NAME="Nordic" +CONFIG_BT_DEVICE_NAME="RAK-46" # Power Management CONFIG_PM_DEVICE=y From dae0efadf13e64a0b2d8a7d98049f84cad81c5d7 Mon Sep 17 00:00:00 2001 From: Krzysztof Taborowski Date: Fri, 19 Apr 2024 15:43:43 +0200 Subject: [PATCH 4/6] subsys: add patch on subghz config To patch sidewalk subsys for RAK4631 Signed-off-by: Krzysztof Taborowski --- subsys/config/common/src/app_subGHz_config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subsys/config/common/src/app_subGHz_config.c b/subsys/config/common/src/app_subGHz_config.c index fac4d7f5d8..16019592e6 100644 --- a/subsys/config/common/src/app_subGHz_config.c +++ b/subsys/config/common/src/app_subGHz_config.c @@ -117,7 +117,9 @@ static radio_sx126x_device_config_t radio_sx1262_cfg = { .pa_cfg_callback = radio_sx1262_pa_cfg, .tcxo = { - .ctrl = SX126X_TCXO_CTRL_NONE, + .ctrl = SX126X_TCXO_CTRL_DIO3, + .voltage = RADIO_SX126X_TCXO_CTRL_3_3V, + .timeout = 320, }, .trim_cap_val_callback = radio_sx1262_trim_val, From ccc13c064980599cb3e842ce280653618c6e23e2 Mon Sep 17 00:00:00 2001 From: Krzysztof Taborowski Date: Fri, 19 Apr 2024 17:24:43 +0200 Subject: [PATCH 5/6] samples: udate reak dts overlay based on https://github.com/RAKWireless/RAK4630-Amazon-Sidewalk-Example/blob/main/app/rak4631_sid_dut/boards/rak4631_nrf52840.overlay Signed-off-by: Krzysztof Taborowski --- .../boards/rak4631_nrf52840.overlay | 38 ++++++++----------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/samples/sid_end_device/boards/rak4631_nrf52840.overlay b/samples/sid_end_device/boards/rak4631_nrf52840.overlay index db9780e0d7..34dadf4802 100644 --- a/samples/sid_end_device/boards/rak4631_nrf52840.overlay +++ b/samples/sid_end_device/boards/rak4631_nrf52840.overlay @@ -4,13 +4,22 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ +/ { + chosen { + zephyr,console = &uart1; + zephyr,shell-uart = &uart1; + }; +}; + + sid_semtech: &spi1 { compatible = "nordic,nrf-spim"; - status = "okay"; - pinctrl-0 = <&spi1_default>; - pinctrl-1 = <&spi1_sleep>; - pinctrl-names = "default", "sleep"; clock-frequency = ; + /delete-property/ cs-gpios; + + lora: lora@0 { + status = "disabled"; + }; }; /{ @@ -29,7 +38,7 @@ sid_semtech: &spi1 { label = "semtech_sx1262 Busy"; }; semtech_sx1262_antenna_enable_gpios: antena_enable { - gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; + gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; label = "semtech_sx1262 Antena Enable"; }; semtech_sx1262_dio1_gpios: dio1 { @@ -37,21 +46,4 @@ sid_semtech: &spi1 { label = "semtech_sx1262 DIO1"; }; }; -}; - -&spi1_default { - group1 { - psels = , - , - ; - }; -}; - -&spi1_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; -}; +}; \ No newline at end of file From a9074b4ecc06da1c7285366bc5cef21d12397922 Mon Sep 17 00:00:00 2001 From: Krzysztof Taborowski Date: Fri, 19 Apr 2024 18:02:50 +0200 Subject: [PATCH 6/6] samples: increase rtt buffer to see longer logs Signed-off-by: Krzysztof Taborowski --- samples/sid_end_device/boards/rak4631_nrf52840.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/sid_end_device/boards/rak4631_nrf52840.conf b/samples/sid_end_device/boards/rak4631_nrf52840.conf index ac3e671ef8..ba573dad29 100644 --- a/samples/sid_end_device/boards/rak4631_nrf52840.conf +++ b/samples/sid_end_device/boards/rak4631_nrf52840.conf @@ -6,3 +6,4 @@ CONFIG_SIDEWALK_DFU=n CONFIG_SHELL_BACKEND_RTT=y +CONFIG_LOG_BACKEND_RTT_BUFFER_SIZE=8096