Hi,
I am using nRF54L15 with SDK v3.0.2. I am facing an issue while initializing the LSM6DS3 sensor on a custom PCB.
Device Initialization Code:
#define LSM_NODE DT_NODELABEL(lsm6dsl)
static const struct device *lsm6dsl_dev = DEVICE_DT_GET(LSM_NODE);
if (!device_is_ready(lsm6dsl_dev))
{
LOG_ERR("LSM6DSL not ready\n");
return -ENODEV;
}
Issue Description:
The device_is_ready() check fails, and I receive the following log:
<err> lsm6ds1: LSM6DSL not ready
Observations:
- When I scan/read the I2C bus, I am able to detect the correct I2C address of the LSM6DS3 sensor.
- The same firmware and overlay configuration work correctly on the nRF54L15 DK, The issue occurs only on the custom PCB.
I am attaching the overlay file for reference.
Could you please suggest what might cause device_is_ready() to fail on the custom PCB, even though the sensor responds on the I2C bus and the same firmware works correctly on the nRF54L15 DK?
&pinctrl {
i2c21_default: i2c21_default {
group1 {
psels = <NRF_PSEL(TWIM_SCL, 1, 11)>, /* P1.11 */
<NRF_PSEL(TWIM_SDA, 1, 12)>; /* P1.12 */
};
};
i2c21_sleep: i2c21_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SCL, 1, 11)>,
<NRF_PSEL(TWIM_SDA, 1, 12)>;
low-power-enable; /* Put SCL/SDA in low-leakage state during deep sleep */
};
};
};
/* Remove button2 node */
/delete-node/ &button2;
/* Remove sw2 alias */
/ {
aliases {
/delete-property/ sw2;
};
};
&i2c21 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c21_default>;
pinctrl-1 = <&i2c21_sleep>;
pinctrl-names = "default", "sleep";
fdc1004: fdc1004@50 {
compatible = "i2c-device";
reg = <0x50>; // 7-bit I2C address
status = "okay";
};
lsm6dsl: lsm6dsl@6a {
compatible = "st,lsm6dsl";
reg = <0x6a>; // 7-bit I2C address
status = "okay";
irq-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; // INT1 connected here
wakeup-source; // system can wake from deep sleep
};
pcf_rtc: rtc@51 {
compatible = "nxp,pcf8563";
reg = <0x51>; // 7-bit I2C address
status = "okay";
};
max17048: fuelgauge@36 {
compatible = "i2c-device";
reg = <0x36>; // 7-bit I2C address
status = "okay";
};
};
&spi00 {
status = "okay";
cs-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>, <&gpio2 6 GPIO_ACTIVE_LOW>; // P2.05 = CS1 , P2.06 = CS2
//cs-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&spi00_default>;
pinctrl-1 = <&spi00_sleep>;
pinctrl-names = "default", "sleep";
w25q64: w25q64jv@1 {
compatible = "jedec,spi-nor";
reg = <1>;
spi-max-frequency = <8000000>;
size = <67108864>; /* 8 MB */
jedec-id = [ef 40 17];
has-dpd;
t-enter-dpd = <3000>;
t-exit-dpd = <30000>;
status = "okay";
};
};
/ {
chosen {
nvs-partition = &storage_partition;
};
};
&cpuapp_rram {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
storage_partition: partition@15c000 {
label = "storage";
reg = <0x15c000 DT_SIZE_K(36)>; // 36KB internal flash partition
};
};
};
&led0 {
gpios = <&gpio1 6 0>;
};
&uart20_default {
group2 {
psels = <NRF_PSEL(UART_CTS, 1, 7)>;
};
};
&uart20_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 4)>, <NRF_PSEL(UART_CTS, 1, 7)>;
};
};
&led1 {
gpios = <&gpio1 5 0>;
};