ADXL363 Sensor SPI2 Devicetree NRF9160DK :Only spi nodes accepted in /soc/peripheral@40000000/spi@a000/

Hi,

I am using nrf Connected SDK v2.6.2 on windows 10. I try to create a blank application project for the device ADXL363 on SPI2 bus on the nRF9160DK board.

I basically followed the sample here: https://github.com/aaron-mohtar-co/Lemon-IoT-LTE-nRF9160/tree/main/Examples/spi_sensor 

The error message shown as below:

Main.c

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(adxl363_driver, CONFIG_LOG_DEFAULT_LEVEL);
/* Get ADXL363 SPI device */
const struct device *adxl_dev = DEVICE_DT_GET_ANY(adi_adxl363);
/* SPI Configuration */
struct spi_config spi_cfg = {
.frequency = 5000000, // 5 MHz SPI clock
.operation = SPI_WORD_SET(8) | SPI_TRANSFER_MSB | SPI_MODE_CPOL | SPI_MODE_CPHA,
.slave = 0,
};
/* Read ADXL363 Device ID */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Devicetree

nrf9160dk_nrf9160_ns.overlay

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&pinctrl {
spi2_default: spi2_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 16)>,
<NRF_PSEL(SPIM_MISO, 0, 18)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>;
};
};
spi2_sleep: spi2_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 16)>,
<NRF_PSEL(SPIM_MISO, 0, 18)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>;
};
};
};
&spi2 {
compatible = "nordic,nrf-spim";
status = "okay";
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The blank application has no \dts directory. So, I created the binding file....

\dts\bindings\sensor\adi,adxl363.yaml

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
description: Analog Devices ADXL363 3-Axis Accelerometer
compatible: "adi,adxl363"
include: spi-device.yaml
properties:
reg:
type: int
required: true
description: "Chip Select (CS) number"
spi-max-frequency:
type: int
required: true
description: "Maximum SPI frequency in Hz"
int1-gpios:
type: phandle-array
required: false
description: "GPIO connected to the INT1 pin"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

How can I define the ADXL363 devicetree via SPI2 properly?