Using the Nordic Sidewalk sensor_monitor example with RAK4630

I have a custom board with a RAK4630 on it and I am trying to get the Nordic Sidewalk sensor_monitor sample to work on it. I have successfully got it working when only BLE is enabled but when enabling the LORA mask I am running into a Zephyr hard fault. I am assuming I have something configured wrong and need some help sorting it out.

Here are my board configs in the Nordic NCS.

Here is the overlay file I am using.


&spi3 {
	status = "disabled";
};

&spi1 {
	status = "disabled";
};

&qspi {
	status = "disabled";
};

&pwm0 {
	status = "disabled";
};

&i2c0 {
	status = "disabled";
};

sid_semtech: &spi2 {
	compatible = "nordic,nrf-spim";
	status = "okay";
	pinctrl-0 = <&spi2_default>;
	pinctrl-1 = <&spi2_sleep>;
	pinctrl-names = "default", "sleep";
	clock-frequency = <DT_FREQ_M(8)>;
};

/{
	semtech_sx1262_gpios{
		compatible = "gpio-keys";
		semtech_sx1262_cs: cs {
			gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
			label = "semtech_sx1262 CS";
		};
		semtech_sx1262_reset_gpios: reset {
			gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
			label = "semtech_sx1262 Reset";
		};
		semtech_sx1262_busy_gpios: busy {
			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
			label = "semtech_sx1262 Busy";
		};
		semtech_sx1262_antenna_enable_gpios: antena_enable {
			gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
			label = "semtech_sx1262 Antena Enable";
		};
		semtech_sx1262_dio1_gpios: dio1 {
			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
			label = "semtech_sx1262 DIO1";
		};
	};
};

&spi2_default {
	group1 {
		psels = <NRF_PSEL(SPIM_SCK, 1, 11)>,
		        <NRF_PSEL(SPIM_MOSI, 1, 12)>,
		        <NRF_PSEL(SPIM_MISO, 1, 13)>;
	};
};

&spi2_sleep {
	group1 {
		psels = <NRF_PSEL(SPIM_SCK, 1, 11)>,
		        <NRF_PSEL(SPIM_MOSI, 1, 12)>,
		        <NRF_PSEL(SPIM_MISO, 1, 13)>;
		low-power-enable;
	};
};

&uart0_default {
	group1 {
		psels = <NRF_PSEL(UART_TX, 0, 20)>;
	};
	group2 {
		psels = <NRF_PSEL(UART_RX, 0, 19)>;
		bias-pull-up;
	};
};

&uart0_sleep {
	group1 {
		psels = <NRF_PSEL(UART_TX, 0, 20)>,
				<NRF_PSEL(UART_RX, 0, 19)>;
		low-power-enable;
	};
};

&uart1_default {
	group1 {
		psels = <NRF_PSEL(UART_TX, 0, 16)>,
				<NRF_PSEL(UART_RX, 0, 15)>;
	};
};

&uart1_sleep {
	group1 {
		psels = <NRF_PSEL(UART_TX, 0, 16)>,
				<NRF_PSEL(UART_RX, 0, 15)>;
		low-power-enable;
	};
};

&qspi_default {
	group1 {
		psels = <NRF_PSEL(QSPI_SCK, 1, 5)>,
		        <NRF_PSEL(QSPI_IO0, 1, 9)>,
		        <NRF_PSEL(QSPI_IO1, 1, 8)>,
		        <NRF_PSEL(QSPI_IO2, 1, 7)>,
		        <NRF_PSEL(QSPI_IO3, 1, 6)>,
		        <NRF_PSEL(QSPI_CSN, 1, 5)>;
		nordic,drive-mode = <NRF_DRIVE_H0H1>;
	};
};

&qspi_sleep {
	group1 {
		psels = <NRF_PSEL(QSPI_SCK, 1, 5)>,
		        <NRF_PSEL(QSPI_IO0, 1, 9)>,
		        <NRF_PSEL(QSPI_IO1, 1, 8)>,
		        <NRF_PSEL(QSPI_IO2, 1, 7)>,
		        <NRF_PSEL(QSPI_IO3, 1, 6)>;
		low-power-enable;
	};
	group2 {
		psels = <NRF_PSEL(QSPI_CSN, 1, 5)>;
		low-power-enable;
		bias-pull-up;
	};
};

Here are the error logs if it helps:

[00:00:00.008,239] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.008,239] <inf> fs_nvs: alloc wra: 0, f80
[00:00:00.008,270] <inf> fs_nvs: data wra: 0, ac
[00:00:00.008,300] <inf> sm_main: Sidewalk demo started!
[00:00:00.008,453] <inf> sm_task: Initializing sidewalk with BLE & LoRa link mask.
[00:00:00.365,997] <wrn> sid_spi_bus: sid_pal_serial_bus_nordic_spi_create
[00:00:00.413,360] <inf> sid_ble: Enable BT
[00:00:00.413,482] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision: 
                                            c5 93 ba a9 14 4d 8d 05  30 4e 9b 92 d7 71 1e e8 |.....M.. 0N...q..
                                            aa 02 50 3c                                      |..P<             
[00:00:00.413,665] <inf> sm_task: Starting sidewalk_receive_task ...
[00:00:00.417,266] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.417,297] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.417,327] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 197.47763 Build 2370639017
[00:00:00.418,884] <inf> bt_hci_core: Identity: D0:78:8D:2B:D6:36 (random)
[00:00:00.418,914] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x1102, manufacturer 0x0059
[00:00:00.418,945] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x1102
[00:00:00.418,945] <inf> sid_ble: BT initialized
[00:00:00.474,914] <inf> sm_callbacks: Status changed: not ready
[00:00:00.474,945] <inf> sm_callbacks: sidewalk_state = STATE_SIDEWALK_NOT_READY
[00:00:00.475,006] <inf> sm_callbacks: Device Is registered, Time Sync Fail, Link Status Mask = 4
[00:00:00.475,067] <inf> sm_callbacks: Link mode cloud, on lora
[00:00:00.475,097] <inf> sm_callbacks: app_state = DEMO_APP_STATE_REGISTERED
[00:00:00.475,128] <inf> sm_task: sidewalk_state = STATE_SIDEWALK_NOT_READY
[00:00:00.475,158] <inf> sm_task: Starting sidewalk_main_task ...
abort()
[00:00:08.367,401] <err> os: r0/a1:  0x00000004  r1/a2:  0x20003eb0  r2/a3:  0x20003eb0
[00:00:08.367,431] <err> os: r3/a4:  0x20007768 r12/ip:  0x20000550 r14/lr:  0x0001cd0d
[00:00:08.367,462] <err> os:  xpsr:  0x61000000
[00:00:08.367,462] <err> os: s[ 0]:  0x34000000  s[ 1]:  0x0004b587  s[ 2]:  0x0000001b  s[ 3]:  0x00071e24
[00:00:08.367,492] <err> os: s[ 4]:  0x0006bb3d  s[ 5]:  0x0006ba98  s[ 6]:  0x2000ce45  s[ 7]:  0x0001ae8f
[00:00:08.367,523] <err> os: s[ 8]:  0x00000005  s[ 9]:  0x0003b719  s[10]:  0x20012070  s[11]:  0x20008ce0
[00:00:08.367,523] <err> os: s[12]:  0x20008c50  s[13]:  0x200022eb  s[14]:  0x00000000  s[15]:  0x00000000
[00:00:08.367,553] <err> os: fpscr:  0x00000000
[00:00:08.367,553] <err> os: Faulting instruction address (r15/pc): 0x0001cd18
[00:00:08.367,614] <err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:00:08.367,675] <err> os: Current thread: 0x20003eb0 (unknown)
[00:00:08.820,129] <err> os: Halting system

Is there anything on the RAK that I need to configure differently for the LORA example to work? I have it working on the Nordic 52840 dev kit with the SX162MB2xAS shield but can’t seem to get the RAK module to function the same.

Any help is appreciated, Thanks

The fault seems to be originating from here if it helps debug:

Maybe this post is a similar problem (and solved)

Thanks, that post did solve the Zephyr fault issue. Unfortunately still not seeing data going over the Lora network. Bluetooth is still working. Any ideas what the issue could be based on my configuration?

It looks like it’s sending but I am not seeing anything make it to AWS:

nrf                  v2.5.0
zephyr               v3.4.99-ncs1-dirty
sidewalk             v2.5.1-rc1-dirty
----------------------------------------------------------------
sidewalk_fork_point = 0000000000000000000000000000000000000000
build time          = 2023-12-15 02:12:24.249830+00:00
----------------------------------------------------------------
[00:00:00.008,880] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.008,911] <inf> fs_nvs: alloc wra: 0, fe8
[00:00:00.008,911] <inf> fs_nvs: data wra: 0, 0
[00:00:00.008,972] <inf> sm_main: Sidewalk demo started!
[00:00:00.009,033] <inf> sm_task: Initializing sidewalk with BLE & LoRa link mask.
[00:00:00.361,450] <wrn> sid_spi_bus: sid_pal_serial_bus_nordic_spi_create
[00:00:00.423,095] <inf> sm_task: Starting sidewalk_receive_task ...
[00:00:00.429,351] <inf> sid_ble: Enable BT <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.433,380] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 197.47763 Build 2370639017
[00:00:00.435,028] <inf> bt_hci_core: Identity: D0:78:8D:2B:D6:36 (random)
[00:00:00.435,058] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x1102, manufacturer 0x0059
[00:00:00.435,089] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x1102
[00:00:00.435,119] <inf> sid_ble: BT initialized
[00:00:00.438,323] <inf> sm_callbacks: Status changed: not ready
[00:00:00.438,385] <inf> sm_callbacks: sidewalk_state = STATE_SIDEWALK_NOT_READY
[00:00:00.438,415] <inf> sm_callbacks: Device Unregistered, Time Sync Fail, Link Status Mask = 0
[00:00:00.438,446] <inf> sm_task: sidewalk_state = STATE_SIDEWALK_NOT_READY
[00:00:00.438,476] <inf> sm_task: Starting sidewalk_main_task ...
[00:00:13.635,620] <inf> sid_ble_conn: BT Connected
[00:00:44.826,385] <inf> sid_ble_conn: BT Disconnected Reason: 0x16 = LOCALHOST_TERM_CONN
[00:00:44.828,125] <inf> sm_callbacks: Status changed: not ready
[00:00:44.828,155] <inf> sm_callbacks: sidewalk_state = STATE_SIDEWALK_NOT_READY
[00:00:44.828,186] <inf> sm_callbacks: Device Unregistered, Time Sync Fail, Link Status Mask = 0
[00:03:11.410,217] <inf> sid_ble_conn: BT Connected
[00:03:16.573,791] <inf> sm_callbacks: Status changed: not ready
[00:03:16.573,822] <inf> sm_callbacks: sidewalk_state = STATE_SIDEWALK_NOT_READY
[00:03:16.573,883] <inf> sm_callbacks: Device Is registered, Time Sync Fail, Link Status Mask = 1
[00:03:16.573,913] <inf> sm_callbacks: app_state = DEMO_APP_STATE_REGISTERED
[00:03:16.969,390] <inf> sid_ble_conn: BT Disconnected Reason: 0x13 = REMOTE_USER_TERM_CONN
[00:03:16.972,290] <inf> sm_callbacks: Status changed: not ready
[00:03:16.972,351] <inf> sm_callbacks: sidewalk_state = STATE_SIDEWALK_NOT_READY
[00:03:16.972,381] <inf> sm_callbacks: Device Is registered, Time Sync Fail, Link Status Mask = 0
[00:03:18.567,199] <inf> sm_callbacks: Status changed: not ready
[00:03:18.567,230] <inf> sm_callbacks: sidewalk_state = STATE_SIDEWALK_NOT_READY
[00:03:18.567,291] <inf> sm_callbacks: Device Is registered, Time Sync Fail, Link Status Mask = 4
[00:03:18.567,321] <inf> sm_callbacks: Link mode cloud, on lora
[00:04:20.179,199] <inf> sid_ble_conn: BT Connected
[00:04:21.367,065] <inf> sm_callbacks: Status changed: ready
[00:04:21.367,126] <inf> sm_callbacks: sidewalk_state = STATE_SIDEWALK_READY
[00:04:21.367,187] <inf> sm_callbacks: Device Is registered, Time Sync Success, Link Status Mask = 5
[00:04:21.367,218] <inf> sm_callbacks: app_state = DEMO_APP_STATE_INIT
[00:04:21.367,248] <inf> sm_callbacks: Link mode cloud, on ble
[00:04:21.367,309] <inf> sm_callbacks: Link mode cloud, on lora
[00:04:21.367,340] <inf> sm_callbacks: app_state = DEMO_APP_STATE_REGISTERED
[00:04:21.367,370] <inf> sm_callbacks: app_state = DEMO_APP_STATE_NOTIFY_CAPABILITY
[00:04:21.524,322] <inf> sid_ble_conn: BT Disconnected Reason: 0x16 = LOCALHOST_TERM_CONN
[00:04:21.529,571] <inf> sm_callbacks: Status changed: ready
[00:04:21.529,632] <inf> sm_callbacks: sidewalk_state = STATE_SIDEWALK_READY
[00:04:21.529,693] <inf> sm_callbacks: Device Is registered, Time Sync Success, Link Status Mask = 4
[00:04:21.529,724] <inf> sm_callbacks: app_state = DEMO_APP_STATE_INIT
[00:04:21.529,754] <inf> sm_callbacks: Link mode cloud, on lora
[00:04:21.529,785] <inf> sm_callbacks: app_state = DEMO_APP_STATE_REGISTERED
[00:04:21.529,815] <inf> sm_callbacks: app_state = DEMO_APP_STATE_NOTIFY_CAPABILITY
[00:04:26.529,937] <inf> sm_notify: Sending demo app message notify capability
[00:04:26.530,334] <inf> sm_task: queued data message id:7
[00:04:27.421,936] <inf> sm_callbacks: Sent message(type: 2, id: 7)
[00:04:31.529,937] <inf> sm_notify: Sending demo app message notify capability
[00:04:31.530,334] <inf> sm_task: queued data message id:8
[00:04:36.316,772] <inf> sm_callbacks: Sent message(type: 2, id: 8)
[00:04:36.529,937] <inf> sm_notify: Sending demo app message notify capability
[00:04:36.530,426] <inf> sm_task: queued data message id:9
[00:04:40.217,132] <inf> sm_callbacks: Sent message(type: 2, id: 9)
[00:04:41.529,937] <inf> sm_notify: Sending demo app message notify capability
[00:04:41.530,364] <inf> sm_task: queued data message id:10
[00:04:42.040,374] <inf> sm_callbacks: Sent message(type: 2, id: 10)
[00:04:46.529,937] <inf> sm_notify: Sending demo app message notify capability
[00:04:46.530,334] <inf> sm_task: queued data message id:11
[00:04:50.936,584] <inf> sm_callbacks: Sent message(type: 2, id: 11)
[00:04:51.530,120] <inf> sm_notify: Sending demo app message notify capability
[00:04:51.530,548] <inf> sm_task: queued data message id:13

@Evan
Can you help with this issue?

Thanks @beegee, it looks like it’s working now after waiting a little while. Seems like the Lora sidewalk near me may not be very strong or we are having antenna issues. I will make a new post about it if it turns out to be an issue I need help with.

Thanks again.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.