Hi there,
SPI device is not ready.
What's wrong?
NCS version: v2.6.1
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&spi1 {
compatible = "nordic,nrf-spi";
status = "okay";
pinctrl-0 = <&spi1_default>;
pinctrl-names = "default";
max-frequency = <DT_FREQ_M(24)>;
cs-gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
icm42670p: icm42670p@0 {
compatible = "invensense,icm42670";
reg = <0>;
spi-max-frequency = <DT_FREQ_M(24)>;
accel-hz = <1600>;
accel-fs = <16>;
gyro-hz = <1600>;
gyro-fs = <2000>;
};
};
&pinctrl {
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/sys/printk.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/spi.h>
// #include <zephyr/drivers/gpio.h>
// #include <zephyr/logging/log.h>
// #include <zephyr/device.h>
// #include <zephyr/drivers/uart/cdc_acm.h>
// #include <zephyr/drivers/uart.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/settings/settings.h>
#include "lib/bluetooth_manager/bluetooth_manager.h"
#include "lib/gpio/gpio.h"
#include "lib/magneto/magneto.h"
#define ICM42670P_NODE DT_NODELABEL(icm42670p)
const struct device *icm42670p_spec = DEVICE_DT_GET(ICM42670P_NODE);