LoRa send sample gets stuck when no LoRa module is connected

Hello,

Basically I'm using NCS SDK (1.7.0 - see Generated Info in the end) and Zephyr.

The board I'm adventuring on is the nRF52840 DK.

In the project, I have 1 main function (actual main(), not a custom RTOS thread) running BLE advertising.

Also, I have 4 other threads, 3 for running blinky sample and another thread for running a UARTE sample using interrupt driven configuration.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
// thread for blinky sample
K_THREAD_DEFINE(blink0_id, STACKSIZE, blink0, NULL, NULL, NULL,
PRIORITY, 0, 0);
K_THREAD_DEFINE(blink1_id, STACKSIZE, blink1, NULL, NULL, NULL,
PRIORITY, 0, 0);
K_THREAD_DEFINE(uart_out_id, STACKSIZE, uart_out, NULL, NULL, NULL,
PRIORITY, 0, 0);
// thread uses UARTE with interrupt driven
K_THREAD_DEFINE(uarte_sample_task_id, STACKSIZE, uarte_task, NULL, NULL, NULL,
PRIORITY, 0, 0);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Everything works fine until here, the Zephyr system boots up and logs everything, from BLE adv to UARTE debug communication.

The problem started when I added the LoRa sample thread.

P.S.: I don't have the LoRa module connected yet.

The project with the LoRa send sample thread compiles just right.

However, after flashing, the NRF Terminal shows the following LOG, and it doesn't print anything else (not even the RTOS entry log):

Fullscreen
1
[00:00:00.200,561] <inf> sx127x: SX127x version 0xff found
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

There is no other logs other than that. The board simply prints this and kind of stops running. If resetted, prints that log again and stops.

If I exclude this thread from the build the system boots up just right as before.

What am I missing?

Below the prj.conf with all the configs used:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -- Bluetooth LE
CONFIG_BT=y
CONFIG_BT_BROADCASTER=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_SCAN=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_LL_SW_SPLIT=n
# -- Lora
CONFIG_SPI=y
CONFIG_LORA=y
CONFIG_LORA_SX12XX=y
CONFIG_LORA_SX127X=y
# -- Blinky
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_ASSERT=y
# -- UART
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Below is my .overlay file:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/ {
aliases {
lora0 = &lora;
gpsuart = &uart1;
};
};
&spi3 {
compatible = "nordic,nrf-spim";
status = "okay";
sck-pin = <17>;
mosi-pin = <18>;
miso-pin = <22>;
cs-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
lora: sx1276@0 {
compatible = "semtech,sx1276";
reg = <0>;
label = "sx1276";
reset-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Infos by the Generated Support Information:

 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"platform": {
"os": "darwin",
"osVersion": "Darwin Kernel Version 19.6.0: Thu Sep 16 20:58:47 PDT 2021; root:xnu-6153.141.40.1~1/RELEASE_X86_64",
"osKernel": "19.6.0",
"vscode": "1.61.2",
"electron": "13.5.1",
"node": "v14.16.0"
},
"system": {
"date": "2021-10-21T03:48:30.370Z",
"vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
"nrfConnectForDesktopInstalled": true,
"vscodeUptime": "00:27:36",
"osUptime": "06:45:11",
"cpu": {
"model": "Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz",
"speed": "2500 MHz",
"count": 2
},
"memory": {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX