Error in compiling samples/sensor/lps22hh on nRF52840 DK

Hello,

I am trying to build the sample/sensor/lps22hh project on nRF52840 DK and STEVAL-MKI220V1, but receive errors in build.

I have added an overlay file as in boards/nrf52840dk_nrf52840.overlay below: (the sensor CS pin is high, and SA0 is 0)

&i2c0 {
    status = "okay";
    pinctrl-0 = <&i2c0_default>;
    pinctrl-1 = <&i2c0_sleep>;
    pinctrl-names = "default", "sleep";
    mysensor: lps22hh@5C{
        compatible = "st,lps22hh";
        status = "okay";
        reg = < 0x5C >;
    };
};

&pinctrl {
    i2c0_default: i2c0_default {
        group1  {
            psels = <NRF_PSEL(TWIM_SCL, 0, 27)>,
                        <NRF_PSEL(TWIM_SDA, 0, 26)>;
        };
    };

    i2c0_sleep: i2c0_sleep {
        group1  {
            psels = <NRF_PSEL(TWIM_SCL, 0, 27)>,
                        <NRF_PSEL(TWIM_SDA, 0, 26)>;
            low-power-enable;
        };
    };
};

&ppi {
    status = "disabled";
};

&clock {
    status = "disabled";
};
I have added the following include in main.c:
#include <zephyr/devicetree.h>
Also, modified line 54 in main.c to:
const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(mysensor));
I am receiving the following warning and error in the log:
-- Found assembler: C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
CMake Warning at C:/ncs/v3.0.2/zephyr/CMakeLists.txt:1002 (message):
No SOURCES given to Zephyr library: drivers__clock_control

Excluding target from build.


-- Configuring done
-- Generating done
-- Build files have been written to: C:/nordic_apps/lps22hh/build_1/lps22hh
-- Configuring done
-- Generating done
-- Build files have been written to: C:/nordic_apps/lps22hh/build_1
-- west build: building application
[4/158] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.0.99 (C:/ncs/v3.0.2/zephyr), build: v4.0.99-ncs1-2
[107/158] Building C object zephyr/drivers/sensor/nordic/temp/CMakeFiles/drivers__sensor__nordic__temp.dir/temp_nrf5.c.obj
FAILED: zephyr/drivers/sensor/nordic/temp/CMakeFiles/drivers__sensor__nordic__temp.dir/temp_nrf5.c.obj
I appreciate your help in resolving this problem.
Thanks,
Parents Reply Children
Related